summaryrefslogtreecommitdiff
path: root/pbr
Commit message (Collapse)AuthorAgeFilesLines
* Use context blocks for open() calls in packagingJeremy Stanley2021-11-191-8/+6
| | | | | | | | Two unclosed file descriptors in packaging are raising ResourceWarning on termination in newer Python interpreters. Make sure they're closed as soon as we're done with them. Change-Id: I07f500e1157da18de799eb0ff9bf82d3bcb46510
* Allow PEP517 without setup_requiresClark Boylan2021-11-122-1/+14
| | | | | | | | | | | | | | | When using PBR PEP517 support without setup_requires were were infinitely recursing because Distribution.finalize_options calls pbr() and pbr() calls Distribution.finalize_options. With a setup_requires this doesn't seem to happen because something is resetting dist.pbr's value from True (callable) to None (not callable) after the initial pbr() call and before further recursion can occur. Explicitly enforce this behavior in pbr() via an explicit update of dist.pbr to None to avoid calling pbr() more than once resulting in the unwanted loop. Change-Id: I1f2b4d34e587389f7e11b99d000e14477cf5091b
* Clarify the need for setup.py with PEP517Clark Boylan2021-11-081-5/+3
| | | | | | | | | | | | | There was a misunderstanding that PBRs PEP517 build hooks meant we no longer needed a setup.py. But it turns out the setuptools build_meta hooks that we wrap call out to setup.py. This means PBR will continue to need to be used in conjunction with a setup.py. This is better for backward compatibiltiy anyway so not a huge loss. Document this more properly and update the test to reflect it. Change-Id: If4320da1e89a5c765e0bfe56b724364f9cba34f3
* Add a PEP517 interface5.7.0Monty Taylor2021-11-032-1/+112
| | | | | | | | | | | | | | | | | | | | | | pep517 defines a new module method of specifying build backends. To allow pbr to exist in this world, we should define the interface that's needed. For this to be used, one will put: [build-system] requires = ["pbr>=5.7.0", "setuptools>=36.6.0", "wheel"] build-backend = "pbr.build" Into pyproject.toml - and the pep517 interface will be used. This doesn't really change anything else - it just makes us support this. So by itself this commit isn't SUPER helpful. But maybe let's take baby steps with something this prone to strife, yeah? After this we can start teasing some things apart and doing our own things directly. Co-Authored-By: Clark Boylan <clark.boylan@gmail.com> Change-Id: I293f59b5074a38c78adffe580de2f1533bb01ce7
* PBR package testing improvementsClark Boylan2021-11-031-3/+5
| | | | | | | | | | | | | | | | We simplify virtualenv setup for PBR package installation testing by switching to a simple file path for the PBR installation rather than a full url with egg specifier. The egg specifer isn't necessary and neither is the url and simpler is easier to understand. We also add the verbose flag to the pip installations of tools into that virtualenv to better understand problems when they occur. Finally we add the option to skip writing package files if their contents are empty. This allows us to ensure that we can omit certain files which will be useful for the next change. Change-Id: I1f081d29d62c905c1bb1abee5402b0990c83e948
* Correct comment for 'D1_D2_SETUP_ARGS'Stephen Finucane2021-04-231-4/+2
| | | | | | | | Change Ic7b71f1093671533c9f17fd621e02299bfbd7a6d reversed the order of this list but didn't update the comment. Do so now. Change-Id: I36f2dd791297a9e3df4f1e427db5b45017820bbf Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Reverse ordering of 'D1_D2_SETUP_ARGS'Stephen Finucane2021-04-221-45/+38
| | | | | | | | | | The previous ordering was confusing and placed new values before old ones. Switch this order, making it more obvious what we're going *from* and what we're going *to*. With this reordering, the old name no longer makes sense so we rename the attribute. Change-Id: Ic7b71f1093671533c9f17fd621e02299bfbd7a6d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add test for cfg -> py transformationStephen Finucane2021-04-222-3/+104
| | | | | Change-Id: I176dc6a2c6d8f37717e1e17ba41ee72bef9536fb Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Don't pass empty 'long_description'Stephen Finucane2021-04-221-17/+15
| | | | | | | | | | | | | Correct a small logic error that would result in us passing an empty 'long_description' value to 'setup' if 'description_file' pointed to a file that was empty. Fixing this also makes it a little more obvious that we are only setting values that are present in 'setup.cfg', since that wasn't totally clear before. A small, unrelated typo is addressed. Change-Id: Ib32b5fb5da84215376c8e372470b2ff08eb47908 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Map requires-python to python-requires (attempt 2)Stephen Finucane2021-04-081-0/+1
| | | | | | | | | | Attempt two at the problem, this time done properly. As discussed in change I7158e75934535b80eb60d6b4b7dcef08866b5bab, the previous attempt actually mapped 'python_requires' to 'requires_python' rather than the other way around. This resolves that. Change-Id: I415b64d5b51a248d2f45a28234f1635e8b82ffcc Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Prevent test failure due to use of setpref"Zuul2021-04-011-1/+0
|\
| * Prevent test failure due to use of setprefSorin Sbarnea2021-04-011-1/+0
| | | | | | | | | | | | | | | | | | | | This fixes a bug that prevented successful test gpg key creation on some machines. gpg: invalid item '(setpref)' in preference string Bug: #1627102 Change-Id: I848e2c0972c3def9e67ff954eb17c560e474e8cf
* | util: Convert 'D1_D2_SETUP_ARGS' to a list of tuplesStephen Finucane2021-03-151-41/+44
| | | | | | | | | | | | | | | | Dicts can't have duplicate keys. Lists of tuples can. We're going to need duplicates. Change-Id: Id43ba91585160448ad9737ba958ace5163d26f3d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Revert "Map requires-python to python-requires"Stephen Finucane2021-03-151-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d5da2121f875109a94809eeb8aa271fd5a0b3edd. This was done incorrectly. The 'D1_D2_SETUP_ARGS' dictionary modified here is a mapping of distutils (and by extension, setuptools) supported options to their legacy distutils2 equivalents, and is used to transform the latter to the former. For example, consider the following entry: "long_description": ("metadata", "description"), This will transform an entry like so in a 'setup.cfg' file: [metadata] description = ... Into the following equivalent call to setuptools' 'setup' function: setup( ..., long_description='...', ... ) By that measure, the entry added in this change, namely: "requires_python": ("metadata", "python_requires"), Will result in a 'requires_python' argument being added to the 'setup' call. That's not what we want. Rather, we likely want to transform a '[metadata] requires_python' entry to a 'python_requires' argument to 'setup'. The change is reverted here in expectation of a forthcoming proper fix. Change-Id: I7158e75934535b80eb60d6b4b7dcef08866b5bab Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Dropping lower constraints testingHervé Beraud2021-03-091-3/+3
| | | | | | | | | | | | | | | | | We facing errors related to the new pip resolver, this topic was discussed on the ML and QA team proposed to to test lower-constraints [1]. I propose to drop this test because the complexity and recurring pain needed to maintain that now exceeds the benefits provided by this mechanismes. Replace assertTrue by assertIn to fix with the latest flake8 version. Add six in the documentation requirements to fix the build. Fix the conflict status with hacking. [1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html Change-Id: I580da15fefd6ad352e69749b77cc4664aef84f9c
* Merge "Remove use_2to3 backward compat for Setuptools"5.5.1Zuul2020-10-191-2/+1
|\
| * Remove use_2to3 backward compat for SetuptoolsJeremy Stanley2020-09-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Odds are this was never used by any PBR-based projects, but was included from the beginning to support a feature of Setuptools for a utility which has been long since discouraged. As of Setuptools 46.2.0 and Python 3.9 it's generating deprecation warnings, and is slated for removal from the Python 3.10 standard library. https://bugs.python.org/issue40360 https://github.com/pypa/setuptools/issues/2086 Change-Id: I6972984f29413d2534d802b142fa9323a7e4a4a3
* | More easy_install.ScriptWriter.get_header()Jeremy Stanley2020-09-191-1/+5
|/ | | | | | | | | | | | Setuptools 12.0 deprecated easy_install.get_script_header() when it was released five years ago, and if called with PYTHONWARNINGS=error raises a deprecation exception. Switch to the preferred class method, but keep the original call as a fallback since it won't work on older Setuptools versions (such as the 3.3 shipped with Ubuntu Trusty). This continues 9a219f9a4f47243123d50d30938506bcc792e55d to remove a second call for the same deprecated function. Change-Id: I365075c2cff88283f92298ce2f5e53d263dc7f4b
* Merge "trivial: Improve logging of run commands"5.5.0Zuul2020-08-281-2/+5
|\
| * trivial: Improve logging of run commandsStephen Finucane2020-08-061-2/+5
| | | | | | | | | | Change-Id: I5ee1f506a162692fe2882651f7ab68afb441aacf Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Remove bdist_wininst supportJeremy Stanley2020-08-271-10/+6
| | | | | | | | | | | | | | | | | | | | | | Odds are this was never used, but as of Python 3.8 and Setuptools 47.2 it's deprecated in favor of just using wheels for Windows platform packaging anyway. https://discuss.python.org/t/deprecate-bdist-wininst/ https://discuss.python.org/t/remove-distutils-bdist-wininst-command/ Change-Id: I3840d9fccb1f87be5c2c03470e156559c01b7cd6
* | Merge "Use easy_install.ScriptWriter.get_header()"Zuul2020-08-271-1/+5
|\ \
| * | Use easy_install.ScriptWriter.get_header()Jeremy Stanley2020-08-061-1/+5
| |/ | | | | | | | | | | | | | | | | | | | | Setuptools 12.0 deprecated easy_install.get_script_header() when it was released five years ago, and if called with PYTHONWARNINGS=error raises a deprecation exception. Switch to the preferred class method, but keep the original call as a fallback since it won't work on older Setuptools versions (such as the 3.3 shipped with Ubuntu Trusty). Change-Id: I2ba68a47dd3f309e356a6e88bf890ac2f80d99a0
* | Update some url to use opendev.orgAntoine Musso2020-08-062-3/+3
| | | | | | | | | | | | | | | | | | The git web URL is now: https://opendev.org/openstack/pbr Also stop linking README.rst to no more existing history/changelog documentation page (removed by 96b84a90141). Change-Id: I56b0e2b86a7fc66c5ae25e06175033a885f500f6
* | Merge "Update python requires packaging metadata for package"Zuul2020-08-061-1/+1
|\ \
| * | Update python requires packaging metadata for packageMatthew Treinish2020-08-061-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The metadata field, 'python-requires' was introduced in PEP440 and appears to have superseded 'requires-python'. [1] The metadata that pbr uses for itself and it's test package was using the old incorrect field, this commit updates it to be the proper metadata to show a working example. To a certain extent it probably doesn't matter because it's very unlikely someone will try to install pbr with python 2.5, but it's more about making sure that pbr itself is leading by example and that it's own config actually works. [1] https://github.com/mtreinish/stestr/issues/292 Change-Id: I5eb14d490a3731b6b95d7a1137c33ec2d73f193f
* | Map requires-python to python-requiresMonty Taylor2020-08-061-0/+1
|/ | | | | | | | Apparently requires-python is the old value and isn't valid anymore. What people mean is python-requires. Of course, people are still using the old value. Fix it for them. Change-Id: Id49cf641f2eddac17f1b21b186aa3a150bd863f9
* Update hackingClark Boylan2020-08-053-4/+4
| | | | | | | | This allows us to run tox -epep8 on newer python versions. Fix the issues newer hacking calls out. They were complaints about indentation and ambigious l value variable names. Change-Id: I9552fba791bdf54649fbe25fc26bffdf8186ff0a
* Add support for virtualenv 20.xStephen Finucane2020-08-053-35/+60
| | | | | | | | | | | | | | | | | | | | virtualenv is undergoing a rewrite and has changed how the programmatic API works [1]. Switch to the "new way". While we're here, we also need to get Python 2.7 tests passing again. That requires dropping support for upper-constraints and using our own, limited local constraints based on supported Python versions. We also need to migrate integration tests since those run with Python 3 now. Update the scenarios for pip/setuptools in integration testing similarly. Finally clean up the installation of all devstack repos as requirements are managed different now. Instead of worrying about syncing them we use constraints. [1] https://github.com/pypa/virtualenv/issues/1585#issuecomment-585228492 Change-Id: I493e88985d2c4d09612fea4d20d8ffa20043a0cb Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Depends-On: https://review.opendev.org/739014
* trivial: Use 'open' context manager5.4.4Stephen Finucane2019-08-271-5/+5
| | | | | | | It's a little nicer to look at. Change-Id: If5bc9b7e3927fe3203ba9adadaa1185c4a1cc7ed Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Update to latest hackingStephen Finucane2019-08-2710-143/+137
| | | | | Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Mark strings as rawStephen Finucane2019-08-275-26/+26
| | | | | | | | | Resolves the following deprecation warning: DeprecationWarning: invalid escape sequence \. Change-Id: If0bc30e646a3bb35c02dc73cc31fb146b3ecd6b5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Use more verbose logging for test failure"5.4.3Zuul2019-08-121-1/+3
|\
| * Use more verbose logging for test failureStephen Finucane2019-05-211-1/+3
| | | | | | | | | | Change-Id: Iae259fe064b8f88037894247585a8394c8368b22 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Fix parsing on egg names with dashes from git URLs"5.4.2Zuul2019-07-182-15/+213
|\ \
| * | Fix parsing on egg names with dashes from git URLsHervé Beraud2019-06-262-15/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | repository urls for non editables end up in the `install_requires` list causing setup to fail. In this commit, all usable external urls get inserted into the `dependency_links` list with the corresponding egg fragments parsed into package names and versions (maintaining dashes if any) and added to `install_requires` list. Introduce parsing by using urlparse to extract properly the url fragment. Change-Id: If19576869fdf38e1768190c2d9c33f32504f7c54 Closes-Bug: #1373623
* | | option to print only the version of a package5.4.0Gaetan Semet2019-06-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Example: $ pbr info -s pkgname 1.2.3 Change-Id: Ic66848dbe44ed946800979fb73776ab6d00869f6 Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
* | | Merge "Fix Windows support"5.3.1Zuul2019-06-172-4/+21
|\ \ \
| * | | Fix Windows supportLucian Petrut2019-05-312-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent commit [1] broke Windows support by using shlex to unquote paths. The issue with shlex.split is that it doesn't work with Windows paths, treating backslashes as escape characters. We'll just replace backslashes with slashes before using shlex.split, converting them back afterwards. Closes-Bug: #1831242 [1] Id2cc32e4e40c1f834b19756e922118d8526358d3 Change-Id: Icb3abca004a35ab9760db8116fedfa96d012d0d0
* | | | Merge "Read description file as utf-8"5.3.0Zuul2019-06-102-1/+22
|\ \ \ \
| * | | | Read description file as utf-8Ben Nemec2019-05-242-1/+22
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently pbr fails if the description file contains unicode characters. To fix this we need to open the description file as utf-8 explicitly. Since open() in Python 2 doesn't support an encoding parameter, use io.open() which works on both 2 and 3. Co-Authored-By: Hervé Beraud<hberaud@redhat.com> Change-Id: I1bee502ac84b474cc9db5523d2437a8c0a861c00 Closes-Bug: 1704472
* | | | Merge "Allow git-tags to be SemVer compliant"Zuul2019-06-102-1/+19
|\ \ \ \
| * | | | Allow git-tags to be SemVer compliantMartin Domke2019-05-242-1/+19
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | This fix allows it to use git-tags with a pre-release suffix that follows the SemVer specification (e.g. 1.2.3-rc1). Change-Id: Ie2e3c0e4145a105aff0a35c8dc6ec2a0cc1fc04e
* | | | Make WSGI tests listen on localhostBen Nemec2019-06-071-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we rely on the wsgi server to choose its own bind address, which tends to result in it listening on a DNS name. This means we have a dependency on that name resolving as expected on the node, which seems to not always be the case. In the interest of removing that environment dependency, let's have the wsgi tests explicitly listen on 127.0.0.1, which should always work and still allows us to verify our part of the WSGI functionality. This also includes a fix to use constraints for building docs because that is also blocking ci on this repo. We need both of these changes for anything to merge without endless rechecks. Change-Id: I48438eb31ee9dd102f06e30b13c6d892a93aba3b Closes-Bug: 1830962
* | | Merge "Set subparser argument required"Zuul2019-05-231-1/+3
|\ \ \
| * | | Set subparser argument requiredHervé Beraud2019-05-231-1/+3
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When subparser argument is not provided by user argparse return an error message not really useful for user: 'Namespace' object has no attribute 'func' This is due to the fact that when we launch the pbr in cli mode the subparser argument is not mandatory (required) and directly we try to execute a undefined function. Set the subparser required is more helpful for users due to the fact that argparse display the helping message with the available sub-commands that users can use These changes provides the following output if the argument is not passed: usage: pbr [-h] [-v] {sha,info,freeze} ... main.py: error: too few arguments Change-Id: I7982f9d40cb0979ddb89d7bc53964167f8e4b269
* | | Fix white space handling in file namesWill Szumski2019-04-254-15/+103
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when using data_files with a glob that matched a file with whitespace in the name, pip would error with a message that the file does not exist, e.g: error: can't copy 'ansible/roles/yatesr.timezone/templates/timezone-Arch': doesn't exist or not a regular file The problem was that ansible/roles/yatesr.timezone/templates/timezone-Arch was a truncated form of the actual filename: ansible/roles/yatesr.timezone/templates/timezone-Arch Linux.j2 Note the space in the filename and that it has been split on this space. This change allows you to use a glob that matches files with whitespace in the name. It does this by quoting the path. Change-Id: Id2cc32e4e40c1f834b19756e922118d8526358d3 Fixes-Bug: 1810934
* | Support provides_extra metadataBen Nemec2019-03-252-1/+15
|/ | | | | | | | | This was added to setuptools in [1] so we should support passing it through from pbr. Change-Id: I46493c18756bcb01c53575ab51ec5e5e97670fc3 1: https://github.com/pypa/setuptools/commit/b2ea3c4a20d008622caec445f5b6916ddd420d16 Closes-Bug: 1760938
* Merge "Fix error when keywords are defined as a list in cfg"Zuul2019-03-203-3/+33
|\
| * Fix error when keywords are defined as a list in cfgHervé Beraud2019-03-043-3/+33
| | | | | | | | | | | | | | | | When keywords are defined as a list in cfg file the generated output have errors and breaks metadata generation. Change-Id: Ie8a5f30d6af1e81ecf3ca40bc94bc460cca38179 Closes-Bug: #1811475