Commit Graph

411 Commits

Author SHA1 Message Date
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 ecbda3076e Deprecate 'build_sphinx' integration
We now have a path away from this feature, so let's deprecate it while
we can.

Change-Id: Idfc34b9085c6da9b8cac24986be5f3bad142d927
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-07-18 15:23:44 +01:00
Stephen Finucane 75bac5d50b Add Sphinx extension
This duplicates what already exists in openstackdocstheme but provides a
migration path for users outside of the OpenStack ecosystem.

Change-Id: I73750b3fe984f9d2f339aac0f435a83ee68c89da
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-07-18 15:22:16 +01:00
Stephen Finucane 915e62ef7b trivial: Fix file permissions
No reason for these to be executable.

Change-Id: I9b22f4b9e679a5f618bb3f2a007327bdb0c80305
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2018-07-18 10:12:17 +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
Zuul 73234c84b5 Merge "Support python-requires metadata" 2018-06-27 03:23:28 +00:00
Ben Nemec 74680aa5f1 Support python-requires metadata
Expose the python_require setuptools option via the python-requires
metadata item in setup.cfg.

Closes-Bug: 1735668

Change-Id: Idf2bb90882121e118f5b7531e027d350c0e4a441
Co-authored-by: Dennis Verspuij <dennisverspuij@users.noreply.github.com>
2018-06-01 18:02:55 +00: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
Ian Wienand a562b12446 Fix builddoc with sphinx <= 1.6
I went to build infra-specs which specifies sphinx==1.5.6 and hit

 Traceback (most recent call last):
   File "setup.py", line 29, in <module>
     pbr=True)
   ...
  File ".../pbr/builddoc.py", line 235, in run
    self._sphinx_run()
  File ".../pbr/builddoc.py", line 162, in _sphinx_run
    freshenv=self.fresh_env, warningiserror=self.warning_is_error)
  File ".../sphinx/application.py", line 244, in __init__
    self._init_builder(self.buildername)
  File "...//sphinx/application.py", line 311, in _init_builder
    raise SphinxError('Builder name %s not registered' % buildername)
 sphinx.errors.SphinxError: Builder name h not registered

It appears to be a typo introduced with
I18bbf693bca2f6e49d822ae2940d2170a2b90ce9; make sure we're walking the
self.builders list; not the string self.builder.

Change-Id: Ic038029c361b3ede48f2b495c74430d3ad1eab82
2018-04-24 14:27:40 +10:00
Zuul 7767c44ab1 Merge "Better Sem-Ver header handling" 2018-04-03 23:55:23 +00:00
Ben Nemec 10fce39a7b Explicitly read setup.cfg as utf-8 on Python 3
Per the referenced bug, relying on the terminal encoding to read
setup.cfg is not safe.  Unfortunately, Python 2 doesn't accept an
encoding when reading config files so we need a fallback path for
that version.

Change-Id: If49344db2f9139c0557f6acd17671163e02468a5
Closes-Bug: 1745396
2018-03-27 10:54:57 +00:00
Stephen Finucane 1fe0ceab39 builddoc: Treat '[pbr] autodoc_tree_excludes' as a multi-line opt
We were treating this a single line, comma- or space-delimited option.
This was incorrect and was causing issues for projects like neutron-lib
when Sphinx 1.7, which switches from optparse to the stricter argparse
was used. In addition, this project was including comments in the
multi-line opt. These were being passed through but Sphinx < 1.7 was
simply ignoring them. These are now filtered out.

Change-Id: I177edf0f44714175da220cf3a960b8f23aa4ab09
Closes-Bug: #1753082
2018-03-26 12:40:20 +00:00
Doug Hellmann 37a1ce7f85 update parse test to use reliable comparison
Different versions of setuptools seem to produce
different representations of the version specifiers,
so use pkg_resources to parse the values again
and then compare the resulting objects so we
aren't tripped up by rendering differences.

Change-Id: Ic67cc936208dbd96b6d811c6aa284fd87df5b118
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Closes-Bug: #1758877
2018-03-26 12:39:28 +00: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
Doug Hellmann 8aaf237382 future-proof invocation of apidoc
Newer versions of Sphinx have moved the apidoc module into sphinx.ext
and the API is slightly different (the function expects sys.argv[1:]
instead of sys.argv[:]. So, figure out where we can import it from and
set a flag so we can invoke it properly. See this change in sphinx for
details:
87630c8ae8

Change-Id: I8235968f8a474c9e6088d935d0868570b2917c07
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-01-17 15:34:07 -05:00
Doug Hellmann ea3e5ab403 emit warning correctly
distutils.log has a warn() function but not a warning() function.

Change-Id: Iebfdb9e4d062d188ef9c73b66007a70f9c289ed2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-01-17 15:34:07 -05: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
Zuul 8a9a6d80bf Merge "Support PEP 345 Project-URL metadata" 2018-01-08 13:54:33 +00:00
Gaetan Semet 4c775e7890 Support v<semver> version
Allow protect tag (in gitlab, github) using "v*" regex.

Change-Id: I3e6eb1031ae92349c5a9531b143b6470482664e7
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
2018-01-05 14:19:47 +00:00
Zuul 4e859e76d3 Merge "Deprecate testr and nose integration" 2018-01-04 04:09:24 +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 b26b135560 Merge "tests: Increase coverage of requirements parsing" 2017-12-15 03:49:31 +00:00
Zuul ae661b4a0a Merge "trivial: Move packaging tests to test_packaging" 2017-12-11 16:09:40 +00:00
Stephen Finucane 6c8455c8c5 tests: Increase coverage of requirements parsing
This is mostly an exercise in refactoring, moving tests into a single
test case. An additional test is added, however, verifying that default
requirement files are indeed used if nothing else is provided.

Change-Id: I8dc6cc8c50f1280f24731480501fab61fc401809
2017-12-06 11:34:25 +00:00
Stephen Finucane ec210af0f5 trivial: Move packaging tests to test_packaging
There's a little bit of duplication going on here. Resolve this by
moving tests that predominantly focus on FILE to tests/test_FILE.

Change-Id: I29355155853e543d017db00c936bcdc88c1c97ad
2017-12-06 11:32:44 +00:00
Monty Taylor 225e882322 Put test-requirements into an extra named 'test'
In bindep files we use a 'test' environment to indicate dependencies
that are needed for testing. Make the same thing available for our
python dependencies, allowing things like "pip install .[test]" or "pip
install shade[test]" to work.

Change-Id: If3ad8b6a79a8cab2f7434b73207f35384e8516ba
2017-12-06 11:01:52 +00:00
Jeremy Stanley 538d2c21a1 Support Description-Content-Type metadata
As of setuptools 36.4.0, support for Description-Content-Type
metadata was added via the long_description_content_type variable.
Add a metadata.description-content-type option for setup.cfg so it
can be provided through PBR. This makes it possible to instruct PyPI
and potentially other frontends to know an explicit RFC 1341 content
type, along with character set and variant, for the accompanying
long description.

Change-Id: I852f603d9ca4e4cd469eab4cae9933ef2581e3af
2017-12-04 19:46:41 +00:00
Jeremy Stanley 839ef3428d Support PEP 345 Project-URL metadata
By including one or more Project-URL entries in PKG-INFO metadata,
PyPI can display helpful hyperlinks in a generic manner. Add support
here to be able to pass it through setup.cfg with a project_urls
dict. See the corresponding section of the Core Metadata
Specifications from the Python Packaging User Guide for details:

https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use

Setuptools implementation is underway here:

    https://github.com/pypa/setuptools/pull/1210

Change-Id: I14e580c654b619cab7eb24e31f736056d6cf9bd4
2017-11-22 23:55:17 +00:00
Zuul 6a3c826e3b Merge "Remove unnecessary 'if True'" 2017-10-20 06:10:00 +00:00
Zuul 3db298ad90 Merge "Discover Distribution through the class hierarchy" 2017-10-20 06:10:00 +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
Stephen Finucane 897ec13869 Remove unnecessary 'if True'
This was done in change I7418cc3ab36823d029a93f86df9c8b25aa7b0c5f to
keep the diff clean [1]. If can be removed now.

[1] https://bugs.launchpad.net/pbr/+bug/1620153/comments/1

Change-Id: Id66ca0522cc4c5601714e1e9ba9379492edc5905
2017-10-12 13:44:59 +01:00
Jason R. Coombs a260dc3f29 Discover Distribution through the class hierarchy
Discovering the underlying Distribution class through the class
hierarchy saves unpatching and repatching.

Based on commits ed579a5dbb2a1843874969a58bb2b6f1eca2e50d and
10b87cc1eb92f50906ff645d0221c74f03de94b9 from [1].

[1] https://github.com/jaraco/pbr/commits/issue-1620153-signoff

Closes-Bug: #1620153.
Change-Id: I7418cc3ab36823d029a93f86df9c8b25aa7b0c5f
Signed-off-by: Jason R. Coombs <jaraco@jaraco.com>
Signed-off-by: Monty Taylor <mordred@inaugust.com>
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2017-10-12 13:44:04 +01:00
Jenkins c45687fb9b Merge "Deprecate support for Sphinx < 1.6" 2017-10-09 17:33:49 +00:00
Jenkins 7208bba2c0 Merge "Remove support for command hooks" 2017-10-09 17:31:42 +00:00
Jenkins d9f2ef0396 Merge "builddoc: Use '[sphinx_build] builders' with Sphinx < 1.6" 2017-10-09 17:12:33 +00:00
Stephen Finucane 32c90ba598 Remove support for command hooks
distutils2 is long dead and many of its best ideas have been
incorporated into setuptools. One of the ideas that *has not* been
incorporated is the idea of command hooks, of either the pre or post
kind. pbr is still carrying the code for this, and there are several
issues with this:

- No one is using this functionality in OpenStack and, given the
  complete lack of documentation on the matter, it's very doubtful that
  it's being used anywhere else [1]
- It's causing issues for projects attempting to hook into the
  'distutils.commands' entry point on Python 2.7, which it seems no else
  must have attempted yet [2].
- distutils2 is dead and advanced features like this that we don't
  explicitly need should not be retained

We could attempt to fix this but why bother? Good riddance, I say.

[1] http://codesearch.openstack.org/?q=pre_hook%5C.&i=nope&files=&repos=
[2] http://codesearch.openstack.org/?q=distutils.commands&i=nope&files=&repos=

Change-Id: I01f657034cffbf55ce830b7e8dbb6b3d94c1fd18
2017-10-09 10:48:33 +01:00
Stephen Finucane 87637bdf1d Remove dead code
The 'monkeypatch_method' function no longer has any callers and can be
removed.

Change-Id: I402eb482d2c1db7331bd872c5169db8e59c9a34f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2017-10-06 16:12:52 +01:00
Stephen Finucane cc703f4926 Deprecate support for Sphinx < 1.6
We don't want to support older versions of Sphinx forever. While
OpenStack's global requirements have been bumped to Sphinx 1.6, there
are non-OpenStack users in the wild. Give them a chance to upgrade to
the newer version before we completely remove support.

This also gives us a chance to deprecate the '[sphinx_build] builders'
setuptools option, which is no longer necessary with Sphinx 1.6+. Do
this. The documentation is updated to reflect this (and some references
to a "custom" 'source_dir' option removed, as it's not at all specific
to pbr).

Change-Id: I18bbf693bca2f6e49d822ae2940d2170a2b90ce9
Related-Bug: #1702872
2017-09-25 16:22:48 +01:00
Stephen Finucane c59fad9c88 builddoc: Use '[sphinx_build] builders' with Sphinx < 1.6
In 'c024066', we resolved an issue with pbr and Sphinx 1.6+ and
implicitly started using Sphinx 1.6's support for declaring multiple
builders as part of the setuptools plugin. However, in doing so, we
neglected to provide a migration path for folks who were using the older
option. This meant folks using the '[sphinx_build] builders' option
would see a breaking change in behavior when upgrading to a pbr release
including the above change. Resolve this issue now.

Note that we want to deprecate support for this option in the future,
but doing so is not a backportable change and will be done separately.

Change-Id: Ic2fe67f932ba26b665110ae66431a5359fc50016
Closes-Bug: #1702872
Related-Bug: #1691129
2017-09-25 16:22:42 +01: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
Rajath Agasthya 87514e3e10 Trivial: Fix docstring
Why not?

Change-Id: Ibe98c901b788a2629e1ba794484a02096f54d0b1
2017-06-25 11:36:55 -07: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
Doug Hellmann 3c059cb701 allow user to override the output location of api docs
Allow the user to specify 'api_doc_dir' in the build_sphinx section of
their setup.cfg to control where the auto-generated API documentation is
written.

Change-Id: I2bd5652bb59cbd9c939931ba2e7db1b37d2b30bb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-15 12:41:49 -04:00
Doug Hellmann d3b2b79f23 fix tests based on API change in Sphinx
Upstream Sphinx now has some new expectations that are no longer being
met by some of our tests because we mock the constructor for the
application class. Fix the test to ensure the application instance has
the needed attributes.

Change-Id: Iad009ce74301c9ffd49ff2b2bab4afd9b7dd1388
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-13 16:52:05 -04: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
Julien Danjou c02406601a builddoc: uses the new Sphinx 1.6 code for multiple builder
As noted by stephenfin, Sphinx 1.6 provides its own code to build doc with
multiple builders. The one provided by pbr so far for Sphinx < 1.6 is not even
compatible with 1.6. This patch fixes that by running the native Sphinx code
for Sphinx > 1.6 and falling back to the old code for older Sphinx versions.

Closes-Bug: #1691129
Change-Id: I5224235b1056a248b246c54e2d99eea94d53c4eb
2017-05-17 12:11:18 +02:00