summaryrefslogtreecommitdiff
path: root/pbr/packaging.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix symbol identification in multiline messageChris Dohmen2022-08-051-5/+7
| | | | | | | | | * Fix an issue where a multiline message with leading spaces would cause invalid symbol identification. * Add unit-tests around multiple symbols in a single line Sem-Ver: bugfix Change-Id: Id799c2fd368d9df38a5c01fc2071283aecef67c6
* Allow leading spaces when determining symbolsChris Dohmen2022-06-031-1/+1
| | | | | | | | | Update the logic that checks for sem-ver to strip out leading spaces. This helps solve an issue during automated squashes appending a tab character to the start of each line in a commit message. Closes-Bug: #1977479 Change-Id: I6f56500c366fd9610d98507f01e8af21862e4421
* 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
* 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
* 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
* 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 to latest hackingStephen Finucane2019-08-271-0/+2
| | | | | Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Mark strings as rawStephen Finucane2019-08-271-14/+14
| | | | | | | | | Resolves the following deprecation warning: DeprecationWarning: invalid escape sequence \. Change-Id: If0bc30e646a3bb35c02dc73cc31fb146b3ecd6b5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Fix parsing on egg names with dashes from git URLsHervé Beraud2019-06-261-15/+40
| | | | | | | | | | | | | | 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
* Merge "Ignore --find-links in requirements file"5.1.2Zuul2019-01-221-1/+2
|\
| * Ignore --find-links in requirements fileBen Nemec2019-01-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | We already skip things like --index-url, but --find-links can also be present and also shouldn't be included in install_requires. This also fixes some issues with the existing unit test for this filtering. Change-Id: Ie8eca8c19e955d52722feaa71d5843ccd74b0da0 Closes-Bug: 1716808
* | Merge "Add an option to skip generating RELEASENOTES.rst"5.1.0Zuul2018-10-161-0/+7
|\ \
| * | Add an option to skip generating RELEASENOTES.rstTim Burke2018-09-241-0/+7
| |/ | | | | | | | | | | | | | | This is comparable to the existing skip_authors and skip_changelog options. Change-Id: Icfefb20fb3c9b2e983e56f6e5440119d4dce2d3f Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
* | Merge "packaging: Remove support for pyN requirement files"Zuul2018-10-061-1/+3
|\ \
| * | packaging: Remove support for pyN requirement filesStephen Finucane2018-07-231-1/+3
| | | | | | | | | | | | | | | Change-Id: I7f915ecdc819bc4d3c6811949f12bdadb108a1ab Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Remove my_ip from generated wsgi scriptChris Dent2018-09-241-2/+0
| |/ |/| | | | | | | | | | | The variable is not used by the generated script and the socket calls will block in some contexts. Change-Id: Id5f9c14e2bdda434883c24bb05359c0c36a1b569
* | Support subdirectory in the urlWei Tie2018-08-231-2/+4
|/ | | | | | | | | | | | Pip supports git+https://foo.com/zipball#egg=bar&subdirectory=baz when setup.py is not at the root directory of the project [1]. This commit keeps pbr function in this case. [1] https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support Change-Id: I70dac755caacc89859a8646c090b69800401bbc0 Closes-Bug: 1786306 Signed-off-by: Wei Tie <nuaafe@gmail.com>
* Deprecate 'test' integration4.2.0Stephen Finucane2018-07-181-0/+6
| | | | | | | | | | No one in OpenStack should be using this command any more and it's unlikely that anyone outside it is even using these. We don't want to have to continue supporting this going forward so let's start the deprecation process. Change-Id: I51e8ebb0268ff7ec1e71d66ff59422fcc7377c4c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add docstring from LocalManifestMaker.add_defaultsStephen Finucane2018-07-051-0/+9
| | | | | | | | | | | | | | | | A not-so-recent change to setuptools [1] has resulted in the inclusion of a docstring from distutils that uses broken rST. docstring of pbr.packaging.LocalManifestMaker.add_defaults:11:Definition list ends without a blank line; unexpected unindent. Resolve the issue by simply redefining the docstring. [1] https://github.com/pypa/setuptools/compare/252ee6f...f1cf491f [2] https://github.com/python/cpython/blob/3.4/Lib/distutils/command/sdist.py#L217-L229 Change-Id: I84b5097bc31af601061a77dfea9d6a6f38b018cc Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Revert "Remove win32/nt checks for wrapper script gen"4.0.4Matthew Treinish2018-05-311-1/+9
| | | | | | | | | | | | | | | | | | | | | This reverts commit 07de844615eaec520d817558462cda5f91f9b7b8. The output console_scripts generated after this commit landed are no longer directly callable from windows machines. Prior to the this reverts we wrapped console_script entrypoints in a .exe on windows so you could directly execute them, just like on *nix systems. However, after the commit we are no longer generating callables on windows. Instead PBR generates a txt file, without a suffix, that is not a valid executable on windows. It is exactly the same output as on a *nix system, but this neglects that scripts with shebangs don't work on windows. (For example generated output on windows see [1]) The exe files were needed so that we could directly execute the console scripts on windows. This commit restores this functionality so that PBR will properly generate executable console_scripts on windows machines again. Closes-Bug: #1761134 [1] http://paste.openstack.org/show/722389/ Change-Id: Ifc13879b7f64650d444e3a14df1a53b2172828e4
* Better Sem-Ver header handlingClark Boylan2018-03-201-3/+7
| | | | | | | | | | | | This makes Sem-Ver header handling more reliable by ignoring any potential user configured git log output format. Instead PBR supplies its own format string that will output the commit message bodies in their entirety without wrapping and other whitespace formatting done for humans. Change-Id: I957a8c182585119534b4e02c34e7140a3e07d1d6 Related-Bug: 1738685 Fixes-Bug: 1704625
* deprecations: Deprecate support for '-py{N}' requirementsStephen Finucane2018-01-091-4/+16
| | | | | | | | This has been marked as deprecated for a long time in the docs but we've done nothing to indicate this from a code perspective. Fix this. Change-Id: I916bf16773a2a2cffa3c352d5dba52e3fbc298c2 Fixes-Bug: #431529
* Deprecate testr and nose integrationStephen Finucane2018-01-031-0/+7
| | | | | | | | | | These are not recommended for use in OpenStack anymore and both nose and testr offer native setuptools commands that can be manually aliased to 'test' on a per-project basis if necessary. Deprecate with an eye to removal in the future. Change-Id: I753f2ffe8b223b180b8ed813d879b3a28b47a1ab Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Use 'build_reno' setuptools extension if available"Zuul2017-10-191-0/+46
|\
| * Use 'build_reno' setuptools extension if availableStephen Finucane2017-10-181-0/+46
| | | | | | | | | | | | | | | | reno recently gained a 'build_reno' command that could be used to build a reno cache file via setuptools. Integrate this and start including that file as part of the final distribution. Change-Id: I54cb7a894770040165cc918469cb0ed486518789
* | Remove win32/nt checks for wrapper script genJoe D'Andrea2017-09-211-9/+1
| | | | | | | | | | | | | | | | | | | | It now appears safe to remove the Windows conditions that skip executing override_get_script_args() and install_wrapper_scripts(). Having demonstrated that bdist_wheel works, it should now work for sdist too, and experiments do indeed appear to bear that out. Change-Id: Ic243a3ccd3aee0dcb17d6419bc44271f5ebe5551 Closes-Bug: 1521407
* | Restore previous IP binding3.1.1Mehdi Abaakouk2017-06-201-1/+1
|/ | | | | | | | | | | This commit 6fdf4e1086c53adf47561697cf82417e1f3b14ed have changed the default binded ip, it binds one random interface on the system instead of all. Break breaks all gate that expect the default to at least listen on localhost. This change restore the previous default. Change-Id: I6323e66ea98d15c52b07c8e737fdd6f30aef0238
* Merge "Ignore index URL lines in requirements.txt files"Jenkins2017-05-201-0/+4
|\
| * Ignore index URL lines in requirements.txt filesMatthew Montgomery2017-05-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if an index is specified by either -i, --index-url or --extra-index-url, the following error may be encountered when setup is run. Invalid requirement, parse error at "u'-i https'" This patch ignores those lines in a requirements.txt file durning parsing. Closes-Bug: #1394999 Change-Id: Ie03f54ca7a7edad7a26fa1721f7b26532b65e760
* | Add binding option for WSGI serverA403512017-05-191-3/+6
|/ | | | | | | | | The packaged WSGI server currently only accepts a custom port. This patch adds a new option to accept a custom interface. This is useful in some cloud environments where there are restrictions on which IP addresses are available to mount a server. Change-Id: Iddf10bc422ae607b2d6bf2304dd032d7471ec458
* Remove 'build_sphinx_latex'Stephen Finucane2017-04-141-2/+0
| | | | | | | | | | codesearch.o.o shows a single, long-dead project using this [1]. Let's just remove it and push people to set 'builders' instead in they really want LaTeX. [1] http://codesearch.openstack.org/?q=build_sphinx_latex Change-Id: I820d9c540ae81717d7b33bbb4d2a4031b529b52c
* Add more words to a confusing error messageMonty Taylor2016-08-261-1/+5
| | | | | | | | | | When setup.cfg has a different value than pbr.version.VersionInfo(), then the version call is unable to look up the right value in the pkg_resources metadata. However, nothing in the current error message communicates this to the user, which leads to them not being able to look in all the right places for the possible error. Change-Id: I31c4e0e2ed15986ba8274a0c5270a9d214ac4b48
* Merge "Replace OpenStack LLC with OpenStack Foundation"Jenkins2016-08-181-1/+1
|\
| * Replace OpenStack LLC with OpenStack Foundationdineshbhor2016-07-261-1/+1
| | | | | | | | | | Change-Id: I03fac862d7346bdac83503afb5f26119d0ea300d Closes-Bug: #1214176
* | Expose deb version to match exposing rpm versionJoshua Harlow2016-08-031-0/+19
|/ | | | | | | | | It seems like we only (currently) exposed to rpm version translation command when the deb version translation command is equally useful (for those that package deb things). Change-Id: I0df175e5206d9d3a806bf33c486765ad1aa8aa6b
* Fix wsgiref script use with oslo.configThomas Herve2016-04-141-1/+14
| | | | | | | | | | | The script generated for wsgi-script entrypoint adds a argument for listening on a specific port using argparse. Unfortunately it's not compatible with oslo.config handling of config options, as used by keystone for example. This fixes the situation by only parsing known options. Change-Id: I37f82e8d78a4288323854282da300c123561218a Closes-Bug: #1501756
* Correct server testBrant Knudson2016-04-131-0/+2
| | | | | | | | | This test was relying on the short sleep allowing the subprocess time to write to an external file. Rather than write to an external file, have the output go to a pipe that the test process can read so that the test doesn't have to guess how long to sleep. Change-Id: I128a9dc5c7525d941f6e00c0073d983eab1e44e6
* package: fix wrong catch in email parsingJulien Danjou2016-04-011-1/+2
| | | | | | | | email.MessageError exception does not exist, so if an error occur, the code block will fail completely. Fix the path to the correct class. Co-Authored-By: Ian Cordasco <graffatcolmingov@gmail.com> Change-Id: Ic4e69405ca6346191da66a86f0b7aa5b3b75bed6
* Do not convert git tags when searching historySteve Kowalik2016-03-241-2/+5
| | | | | | | | | | Currently, when the sem-ver processing is searching the git history, it stores the canonical version and uses that as the tag, which is fine if the project uses the canonical version as a tag. Instead, return the original tag so that history can be correctly checked. Change-Id: I1b83fc3dc3dd287ae3b23fd4cba07fdfdd673a7f Closes-Bug: 1561254
* Include wsgi_scripts in generated wheelsIan Cordasco2016-03-221-13/+48
| | | | | | | | | | | | | | | Downstream consumers, such as OpenStack Ansible, generate wheels for all packages (including services). More and more services are moving to use the wsgi_scripts entry-points provided and handled by pbr. Unfortunately, these scripts are not generated during wheel creation unless we force them to be generated because Setuptools and Distutils will only generate console_scripts entry-points. This also fixes the C extension on Python 3 because it was previously broken. Change-Id: Icecc8474028436e8b2fb752d576204d9439fb0e7 Closes-bug: #1542383
* Merge "Enable pep8 H405 tests"Jenkins2015-12-091-4/+6
|\
| * Enable pep8 H405 testsLuo Gangyi2015-12-081-4/+6
| | | | | | | | | | | | | | | | Enabled H405 multi line docstring summary not separated with an empty line in tox testing. Change-Id: I1a4bfbd2bad6eb2c132843ca21451807737121df Closes-Bug:#1524176
* | Support git://, git+ssh://, git+https:// without -e flag.Ryan Bourgeois2015-11-131-4/+5
|/ | | | | Closes-Bug: 1467683 Change-Id: I09163c8072ecbee5c1a24951511c75009511b6f8
* Protect WSGI application with a critical sectionAlexander Makarov2015-08-281-1/+8
| | | | | | | | | | | | | | When configured as an Apache WSGI module a race condition is possible during keystone cache initialization. The operation raises exception region.RegionAlreadyConfigured. This is a result of the race condition involving global 'application' variable being initialized several times (1 per thread). Apache modwsgi documentation suggests protecting global objects with thread locks. Change-Id: Ib9e2207b0d1d9cee656736e94865fb404b6a868d Related-Bug: 1482271
* Strip comments in requirements files1.6.0Davanum Srinivas2015-08-231-0/+1
| | | | | | | | | | | | | Since we don't strip comments from end of the requirements like: requests-kerberos>=0.6;python_version=='2.7' # MIT The currnet code ends up failing with a: "Invalid environment marker" We should strip the comments out before processing. Closes-Bug: #1487835 Change-Id: I75d2e83a5f60f93e1c38d53fb4f0a29ba35120b1
* Merge "Expose a 'rpm_version' extra command"Jenkins2015-08-171-0/+20
|\
| * Expose a 'rpm_version' extra commandJoshua Harlow2015-07-021-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intended usage, getting a rpm *compatible* version number from pbr from a pbr using python package. Typically this will then get put into a rpm spec file (what is used to build an rpm) and used to build an rpm using `rpmbuild` (the thing used to translate rpm spec files into rpms). For example: this allows [1][2] (which I am the primary maintainer of and godaddy, cray, and y! are users of) to get out of the whacky and/or flakey rpm version number calculation/conversion process (which previously just worked around by saying only use tags). [1] https://github.com/stackforge/anvil [2] https://anvil.readthedocs.org/en/latest/topics/summary.html Change-Id: I26cd1d6e8aef69d52e8a4f36bd264c690e712ba3
* | Fix retrieval of commit data and most recent tag.Florian Wilhelm2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git._iter_log_online() returns None in some cases for instance when SKIP_WRITE_GIT_CHANGELOG is set to true. This is fixed by returning an empty list in _iter_log_online. Also the check if a changelog based on git should be written was moved from git._iter_log_online to git.write_git_changelog which makes more sense since some functions were calling git._iter_log_online to get the changelog for other reasons than writing it. Additionally a unittest was added to check that setting the environment variable SKIP_WRITE_GIT_CHANGELOG to true does not break anything when retrieving the git version. Change-Id: Ib12df23ab25b290dd394f9cb1456b8d5da57306a Closes-Bug: 1467440
* | Export ChangeLog and AUTHORS in installRobert Collins2015-07-291-6/+25
| | | | | | | | | | | | | | | | | | | | readthedocs uses 'setup.py install' to prepare trees for doc creation, but ChangeLog is not currently created there, and doing so would be nice. This won't affect develop invocations AFAICT, and even if it did, the overheads are ~10% of the time to run 0 tests in Nova today - e.g. quite tolerable. Change-Id: I7bc18fc9ca2dbe852598cc79b2ad6273fc53557d
* | Add wsgi_scripts support to PBRSean Dague2015-07-141-2/+41
|/ | | | | | | | | | | | | | | | | | | | | | | | As we attempt to get more of OpenStack API servers to be runnable as a regular WSGI application, we should provide support in PBR for building these base scripts just like the console scripts. This adds a new 'wsgi_scripts' group which builds a base script that will run under mod_wsgi as expected. It also has a CLI fallback mode, so that the application can be brought up as a wsgiref simple_server for quick local testing and development. All wsgiref servers default to binding to port 8000, but that can be overridden. To support this, and possible future expansion of the script types, the group list now iterates over a dictionary of group_name => template mappings. This includes basic testing. It also includes tests which would run an actual wsgi environment. These are currently skipped as they can't be reliably run in the gate for timing reasons on stdout processing. Change-Id: I334639d7ecaad2703d1ff675880a314cc28e2334