Commit Graph

191 Commits

Author SHA1 Message Date
Clark Boylan 47c5afe79a Remove sphinx doc building integration
Setuptools and sphinx [0] have removed support for building docs through
setup.py. This has broken imports which break our own local doc builds.
Lets just remove it all (including the tests) so that we are compatible
with modern setuptools and sphinx.

An alternative approach would be to do conditional imports and continue
to support this for old setuptools and sphinx. But that feels like a
dead end that will be difficult to test. Probably better to rip this
bandaid off.

[0] https://www.sphinx-doc.org/en/master/changes.html#id7

Change-Id: I65038caceb192f495288414079ca0f07ce6318bb
2023-05-31 13:25:13 -07:00
Chris Dohmen 0aecbea81b Fix symbol identification in multiline message
* 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
2022-08-05 10:08:09 -04:00
Chris Dohmen 3793d87deb Allow leading spaces when determining symbols
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
2022-06-03 09:21:25 -04:00
Jeremy Stanley b6b204e33e Use context blocks for open() calls in packaging
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
2021-11-19 18:36:32 +00:00
Jeremy Stanley 013ca172c9 More easy_install.ScriptWriter.get_header()
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 9a219f9a4f to
remove a second call for the same deprecated function.

Change-Id: I365075c2cff88283f92298ce2f5e53d263dc7f4b
2020-09-19 13:47:41 +00:00
Jeremy Stanley e52e608e35 Remove bdist_wininst support
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
2020-08-27 17:01:31 +00:00
Jeremy Stanley 9a219f9a4f Use easy_install.ScriptWriter.get_header()
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
2020-08-06 08:32:13 +00:00
Stephen Finucane 57d7c53739 Update to latest hacking
Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-08-27 16:57:23 +01:00
Stephen Finucane fa0dd5652d Mark strings as raw
Resolves the following deprecation warning:

  DeprecationWarning: invalid escape sequence \.

Change-Id: If0bc30e646a3bb35c02dc73cc31fb146b3ecd6b5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-08-27 16:57:23 +01:00
Hervé Beraud 4627305b8a Fix parsing on egg names with dashes from git URLs
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
2019-06-26 16:55:13 +02:00
Zuul 7909c7afd3 Merge "Ignore --find-links in requirements file" 2019-01-22 21:04:45 +00:00
Ben Nemec bc4193b183 Ignore --find-links in requirements file
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
2019-01-22 17:19:24 +00:00
Zuul bd300d07ee Merge "Add an option to skip generating RELEASENOTES.rst" 2018-10-16 16:08:13 +00:00
Zuul 32bfe7808f Merge "packaging: Remove support for pyN requirement files" 2018-10-06 21:14:59 +00:00
Chris Dent 126b7f7dec Remove my_ip from generated wsgi script
The variable is not used by the generated script and the
socket calls will block in some contexts.

Change-Id: Id5f9c14e2bdda434883c24bb05359c0c36a1b569
2018-09-24 12:07:31 +00:00
Tim Burke a34629a956 Add an option to skip generating RELEASENOTES.rst
This is comparable to the existing skip_authors and skip_changelog
options.

Change-Id: Icfefb20fb3c9b2e983e56f6e5440119d4dce2d3f
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
2018-09-24 13:05:35 +01:00
Wei Tie bca35333bc Support subdirectory in the url
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>
2018-08-23 10:46:56 -07:00
Stephen Finucane 8ea9d9262d packaging: Remove support for pyN requirement files
Change-Id: I7f915ecdc819bc4d3c6811949f12bdadb108a1ab
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-07-23 11:04:39 +01:00
Stephen Finucane 6f5c1ee8e4 Deprecate 'test' integration
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>
2018-07-18 15:26:52 +01:00
Stephen Finucane 3dc5ae566b Add docstring from LocalManifestMaker.add_defaults
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] 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>
2018-07-05 15:30:35 +01:00
Matthew Treinish ee26945cb3
Revert "Remove win32/nt checks for wrapper script gen"
This reverts commit 07de844615.
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
2018-05-31 11:05:34 -04:00
Clark Boylan 183b445c0f Better Sem-Ver header handling
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
2018-03-20 16:12:20 -07:00
Stephen Finucane 9be181e8e6 deprecations: Deprecate support for '-py{N}' requirements
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
2018-01-09 14:31:01 +00:00
Stephen Finucane 113685e1b9 Deprecate testr and nose integration
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>
2018-01-03 15:10:14 +00:00
Zuul 721aa9547b Merge "Use 'build_reno' setuptools extension if available" 2017-10-19 10:58:02 +00:00
Stephen Finucane 3a6b96c799 Use 'build_reno' setuptools extension if available
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
2017-10-18 09:16:25 +00:00
Joe D'Andrea 07de844615 Remove win32/nt checks for wrapper script gen
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
2017-09-21 14:54:29 +00:00
Mehdi Abaakouk d43badb6c1 Restore previous IP binding
This commit 6fdf4e1086 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
2017-06-20 15:43:40 +02:00
Jenkins c9a183b2c5 Merge "Ignore index URL lines in requirements.txt files" 2017-05-20 17:14:56 +00:00
A40351 6fdf4e1086 Add binding option for WSGI server
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
2017-05-19 17:04:31 +08:00
Matthew Montgomery 2a0f2e589c Ignore index URL lines in requirements.txt files
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
2017-05-18 08:51:35 -05:00
Stephen Finucane 1ed8531095 Remove 'build_sphinx_latex'
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
2017-04-14 18:05:42 +00:00
Monty Taylor 8d64858523
Add more words to a confusing error message
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
2016-08-26 10:45:41 -05:00
Jenkins aa54bfed27 Merge "Replace OpenStack LLC with OpenStack Foundation" 2016-08-18 09:31:55 +00:00
Joshua Harlow 76d3ab1242 Expose deb version to match exposing rpm version
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
2016-08-03 18:48:01 -07:00
dineshbhor a95982f9a0 Replace OpenStack LLC with OpenStack Foundation
Change-Id: I03fac862d7346bdac83503afb5f26119d0ea300d
Closes-Bug: #1214176
2016-07-26 17:37:42 +05:30
Thomas Herve 8778c64776 Fix wsgiref script use with oslo.config
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
2016-04-14 17:11:15 +02:00
Brant Knudson ef759ed5db Correct server test
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
2016-04-13 14:17:31 -05:00
Julien Danjou 9b5f422c34 package: fix wrong catch in email parsing
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
2016-04-01 17:41:06 -05:00
Steve Kowalik b4d21581e2 Do not convert git tags when searching history
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
2016-03-24 12:54:44 +11:00
Ian Cordasco 139110c89b Include wsgi_scripts in generated wheels
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
2016-03-22 16:44:49 -05:00
Jenkins 6c5ccdebce Merge "Enable pep8 H405 tests" 2015-12-09 10:18:03 +00:00
Luo Gangyi 768c53474d Enable pep8 H405 tests
Enabled H405 multi line docstring summary not separated with an empty
line in tox testing.

Change-Id: I1a4bfbd2bad6eb2c132843ca21451807737121df
Closes-Bug:#1524176
2015-12-08 22:35:42 -08:00
Ryan Bourgeois 31a0e97cbf Support git://, git+ssh://, git+https:// without -e flag.
Closes-Bug: 1467683
Change-Id: I09163c8072ecbee5c1a24951511c75009511b6f8
2015-11-13 13:05:27 +11:00
Alexander Makarov 6757913f0f Protect WSGI application with a critical section
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
2015-08-28 15:04:44 +03:00
Davanum Srinivas 1e05037c2a Strip comments in requirements files
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
2015-08-23 21:54:15 -04:00
Jenkins 628073a31c Merge "Expose a 'rpm_version' extra command" 2015-08-17 18:08:18 +00:00
Florian Wilhelm c3fc63c64f Fix retrieval of commit data and most recent tag.
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
2015-08-03 14:44:11 +02:00
Robert Collins 89402a7177 Export ChangeLog and AUTHORS in install
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
2015-07-29 06:19:40 +12:00
Sean Dague 5b46cb8574 Add wsgi_scripts support to PBR
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
2015-07-14 11:40:39 -04:00