As with PEP-517 support, this is simply a shim over the setuptools
implementation added in setuptools v64.0.0 [1].
[1] https://github.com/pypa/setuptools/pull/3488
Change-Id: I32f974db37e364cf634b050b40bf0820dce0a3a3
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The imp was removed in Python 3.12 [1]. This commit replaces
get_suffixes() method call with _SUFFIXES array from
importlib.machinery.
This was imported from https://github.com/openstack/pbr/pull/22
on behalf of the Gentoo maintainer who proposed it.
Co-Authored-By: Petr Vaněk <arkamar@atlas.cz>
Change-Id: Icf00beee255aba3da2b81d9dc5b1f8130bbcd869
Setuptools deprecated -'s at some point and they result in a bunch of
warnings in failed tests. This is distracting and eventually is likely
to create real errors. Go ahead and fix them now.
Change-Id: If3594269495ae1f3cefffd4c4f38d87af5c7fdfe
* 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
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
Add a check in pbr.core.pbr() to make sure it hasn't already run,
and return immediately if it has. This replaces the earlier attempt
at loop-busting by setting the entrypoint to None in the dist, in
order to support PEP 517 builds without setup_requires.
Also test that pbr.json is now included in the dist tree, in order
to avoid future regressions.
Change-Id: I407ae88ab8de4b61f94034b3d79a2ca7f7d79d16
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
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
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
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
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
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
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
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
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
Wheel 0.32.0 removed the 'wheel install' command [1] and, subsequently,
the 'wheel.install' module [2]. It also made 'WheelFile' a subclass of
'zipfile.ZipFile' rather than a wrapper [2] and deprecated the '[wheel]'
section of 'setup.cfg' in favour of '[bdist_wheel]'. Handle these
changes.
[1] https://github.com/pypa/wheel/commit/353217fb4
[2] https://github.com/pypa/wheel/commit/89492505b
Change-Id: I2903089a07bdd2dc96437b9f65f2d2bba2741707
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
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
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
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
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
This change adds new handling when building a Changelog file
for specific characters that cause documentation building
warnings/errors to be emitted when sphinx tries to generate
a Changelog html page. The changes include:
- Escaping any '*' in a commit, which sphinx will interpret as the
start of a new line and throw a warning.
- Escaping any '_' in a commit, which in certain cases, sphinx will
interpret as an invalid link and create an error.
- Escaping any '`' in a commit, which in certain cases will
cause sphinx to interpet as a literal, and throw a warning.
After this change, any entries in the changelog that contain
the above "invalid" syntax no longer generate sphinx
warnings/errors and the offending entries now generate correctly.
Change-Id: I672ef4c56486e59a384849a4b182d11129726ae9
We're currently ignoring data-files, and it looks like the problem
would sometimes be present starting with 2796f9, 0.5.7, and always be present
from 04984a, 0.5.15.
This normalises all config keys from - to _ as soon as we read the
config, which means future access and modification does not need to
concern itself with the possibility of the key being a '-' instead '_'.
This should make it more difficult for code accessing/modifying values
in the config to clobber user set values or be unaware of them, like
in the case of the files hook.
As well, support download-url, but properly expose it as download_url.
Co-Authored-By: Julien Danjou <julien@danjou.info>
Change-Id: I062774c706b8f7339dda46689a226b80ae6ac277
Xenial PyPy adds multiarch to the compiled c library, so if PyPy reports
multiarch we add it to the soabi string.
If the installed PyPy is not configured for multiarch, the multiarch
config variable will not exist and `arch` will be None, in which case we
should only update the string if multiarch exists.
Change-Id: Idcd3af4878d5b66c6770f96e7235a7d2f848df81
assertEqual expects that the arguments provided to it should be
(expected, observed). If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit
Tests fail. The following patch fixes this issue.
TrivialFix
Closes-Bug: #1259292
Change-Id: I03c414a763b2d51210aaec362405912f29850e36
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
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
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
Old versions of pip do not properly evaluate blank envmarkers such as
':python_version>=2.7', so as long as we are not creating a bdist_wheel
we evaluate these immediately to support these old installations
Change-Id: I94a5f9bccd658a2529a727d99f5a2b79e6b00aa8
Closes-Bug: 1502692
When processing setup.cfg strip trailing comments from lines as this is
unsupported by setuptools.
Change-Id: I7712c07552b50830549644a6ff4167b90d897125
Closes-bug: 1494330
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
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
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
If there are boolean conditions in the env marker, the existing join
causes the extra tag to only be applied to the first of them, causing
carnage.
Change-Id: I7b735befae76b330f923276e1c48ef23816774d4
In gnupg 2.1 %no-ask-passphrase is a no-op. As a result gpg attempts to
prompt for a passphrase and as the shell is not interactive it fails.
To allow gnupg 2.1 to create passphrase-less keys we enable two options
new to gnupg 2.1.
%no-protection
%transient-key
Change-Id: If687ff005cf968133fc1fa12b1259a127c464e5b
This adds support for reading extras from setup.cfg.
It also adds support for handling environment markers, both in the
extras section and in install_requires and in requirements.txt.
Change-Id: I6fd8276012e65f82934df9c374613b1ce6856b5a
We were generating versions lower than the last tag when preversioning
was in use and pre-release versions had been tagged.
Also attempt to run the script without devstack.
Change-Id: If984939003ae7c513ee76b52c6808db0c1766050
Closes-Bug: #1450210