setuptools is pretty opinionated about using a build/ directory in the
source tree, and concurrent invocations have a habit of stomping on
each other.
Change-Id: I9f7108ea1a77b9333c0fdf51d94b105fcd5a9e06
Resolve the following warnings:
tox.tox_env.errors.Fail: pass_env values cannot contain whitespace,
use comma to have multiple values in a single line, invalid values
found 'PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR
WHEELHOUSE PROJECTS'
Also, reduce down the envlist as tox 4 when run in OpenStack CI is
also attempting to validate interpreters utilizing the
--skip-missing-interpreters=false setting [1].
Finally, fix up the integration job so that it passes on Ubuntu 22.04.
This necessitates removing any Python 2-based dependencies used in the
these jobs (since these are no longer available on Ubuntu 22.04) and
removing tests for pip versions that are not compatible with Python 3.10
(the Python version found on Ubuntu 22.04).
[1] https://github.com/tox-dev/tox/issues/2811
Change-Id: Ib4dbe4e09e269219c08a87f6fb64ad9628b5864a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
We noticed some aberrations in log level/threshold handling as of
Setuptools 60.0.0, and the only substantive change for that release
toggles the default selection for its internal ("local") distutils
replacement vs the "stdlib" one. For now, toggle the
SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old
value. This should be revisited once logging is handled better in
Setuptools. https://github.com/pypa/setuptools/issues/3038
Change-Id: If372a33607fff884cd7bf888ee5a23a2fbb351b2
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
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: I730018e2bf788be5ac4e993af1746296206edfc1
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
We're building the sdist to be able to add PBR's changelog in its
docs, so may as well publish the Release Notes document it builds
too.
Change-Id: Icd1b4ae04de8034bc15db87be457751e70e26f6d
One of PBR's features is ChangeLog generation, so it only makes
sense that we would include PBR's ChangeLog in published
documentation too. (Also publishing a ChangeLog is helpful.)
Change-Id: Ie1561c0852dfc6731c29e9202f74f0e4c4b08786
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
- Use constraints for documentation targets
- Indicate support for Python 3.6, 3.7
- Fix indentation
Change-Id: I486b6f645fa71f0fa519464465bf26411ca4faf4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
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
Enables py37 testing while also being more friendly with developer
environments where not all python versions may be available.
Runs the docs jobs last as that one is the least likely to be needed.
Tox min version is needed for the new options used inside.
Change-Id: Icc6cb4979b2523a0edfc6375c5c032bb8be76b9f
Story: #2004073
Task: #27440
Since the switch to stestr in commit 2222dbb47, the tests have taken to
spewing a load of noise. This seems to be because we dropped the
configuration for OS_STDOUT_CAPTURE and OS_STDERR_CAPTURE, which was
previously configured in '.testr.conf'. This is fixed. However, it seems
it's also necessary to explicitly pass the '--suppress-attachments'
option to 'stestr' to properly silence things. This seems to be
necessary because many pbr commands output to stdout by default, while
other projects (nova, etc.) use 'logging'. Use of this option requires
stestr 2.1.0 [1] so we bump the lower-constraint.
As an aside, finding out what caused this output was easier said than
done. I tried stestr, testr and fixtures, before finally finding it in
subunit.
[1] https://github.com/mtreinish/stestr/commit/1316ebd7
Change-Id: I1678bcd26b41fdf09f98c36fc095d6d4c1826deb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This was removed in an earlier patch but should not have been. Re-add it
now.
Change-Id: I68b785498a1a00f2301f610bbb8cb2e024416515
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
According to Openstack summit session [1], stestr is maintained project
to which all Openstack projects should migrate. Let's switch to stestr
as other projects have already moved to it.
While we're at it, we also fix the docs requirements and removed the
unused 'pypy' and 'cover' tox targets.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I424068adc9092be2cf40d117c9dc4e92bb51e804
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This is not needed since reno 2.1.0 (commit f8fc8f97) [1].
[1] https://github.com/openstack/reno/commit/f8fc8f97
Change-Id: I335bba8c8bf4f2d73aba32ae762607e67ee3814c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This updates the envlist to include modern versions of python. It
doesn't really mean anything except for you run tox without specifying
an environment it will now run py35 and py36 instead of py34 (which
isn't used anywhere anymore)
Change-Id: I935cf6d104fa5b516332cbb587d327dc587d0c32
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I70b4fb58c7800158907d80f83018e39d1b785668
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.
Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.
Add openstack-tox-lower-constraints job to the zuul configuration.
See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.
Change-Id: Ic5a53fede983d15b8873708f213a87ce0f182277
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.
This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.
Change-Id: I0a80865a8a18c49b4d883850488cc0c73fe1bfcd
as of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.
Change-Id: I628f5a1463a893bfc16f795ef7144cd2376130de
Closes-Bug: #1519510
skipsdist is used to "avoid expensive sdist" but prevents the software
package from being installed in the virtualenv. We currently have this
enabled, but then skip the step by including the current package in the
requirements section, which mitigates the entire thing.
Stop setting skipsdist to True, allowing us to remove '.' from
requirements and use tox the way it's meant to be used.
Change-Id: I543f0c6679c39c7ae438fd1e5fca7175b92ed193
A "testr" entry-point was added to PBR in
I2227adf3643ffe6bcece0c7d2127d23e20d52f7a in Jun 2013. However,
testrepository had already started providing this same
disutils.commands entry-point in Jan 2013 [1].
I am not sure if it is deterministic who wins when two packages
declare the same entry-point, but at least for me, running "python
setup.py testr ..." was not calling into any of the pbr hooks. I
discovered this because I wanted to use the --coverage-package-name
argument provided by the pbr testr wrapper because to s/-/_ in dib.
The original change (I8e4bc9bb78be37b4d13f8d6c2edfe2d67554ad78)
overrides the setuptools provided "test" [2] to call testrepository
when it sees a .testr.conf file (falling back to nose for
compatability). So it seems the intention was not to add a "testr"
command, but that "test" is overridden to run testr automatically when
available.
Therefore I think that testrepository owns the distutils.command
entry-point for "testr". To avoid confusion we should remove the
duplicate entry-point here and just leave the "test" command
overrides.
I've added documentation on the test command. The testr/test split is
quite confusing, being only one letter different, so that is called
out explicitly. Comments in testr_command are updated to reflect
what's happening better. This also converts the calls in tox.ini to
use the PBR wrapper "test".
[1] 2a36806c69 (diff-2eeaed663bd0d25b7e608891384b7298R96)
[2] https://github.com/pypa/setuptools/blob/master/setuptools/command/test.py
Change-Id: I5b68f03e782fef5c45424c04cc851be5988f9019
Adding constraints support to clients is slightly more complex than
services as the clients themselves are listed in
upper-constraints.txt which leads to errors that you can't install
a specific version and a constrained version.
This change adds constraints support by also adding a helper script
to edit the constraints to remove pbr.
Change-Id: I80a10f80e2c5efafb099a6c1dcebe8f0935ace09
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.
Change-Id: I38213e5ade2e9b1329262c9b28b87ce1cabc279a
Enabled H405 multi line docstring summary not separated with an empty
line in tox testing.
Change-Id: I1a4bfbd2bad6eb2c132843ca21451807737121df
Closes-Bug:#1524176
We don't depend on recursive installations via pip - and pip certainly
doesn't support that. We removed part of it recently, finish removing
it all.
Change-Id: I29bc4070b355e52124ceae459ea20403d134b60a
Stop including git sha in version strings
We include it in pbr.json now. Including it is contentious in the world
of python, and it's up for debate as to whether or not it provides value.
Write and read more complex git sha info
Instead of encoding the git sha into the version string, add it to
a metadata file. This will allow us to get out of the business of
arguing with pip and setuptools about version info. In order to make
this really nice, provide a command line utility called "pbr" that has
subcommands to print out the metadata that we're now including in the
egg-info dir.
Only import sphinx during hook processing
When pbr is imported to handle writing the egg_info file because of
the entry point, it's causing sphinx to get imported. This has a
cascading effect once docutils is trying to be installed on a system
with pbr installed. If some of the imports fail along the way, allow
pbr to continue usefully but without the Sphinx extensions
available. Eventually, when everything is installed, those
extensions will work again when the commands for build_sphinx, etc.
are run separately.
Also slip in a change to reorder the default list of environments
run by tox so the testr database is created using a dbm format
available to all python versions.
Integration test PBR commits
Make sure that if a PBR commit is being tested then we install and
use that source rather than the latest PBR release.
Change-Id: Ie121e795be2eef30822daaa5fe8ab1c2315577ae
(cherry picked from commit 65f4fafd90)
(cherry picked from commit cd7da23937)
Closes-Bug: #1403510
Co-Authored-By: Clark Boylan <clark.boylan@gmail.com>
Co-Authored-By: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Jeremy Stanley <fungi@yuggoth.org>
Ignore H904 because it's a deprecated hacking check.
Ignore H405 because it should be fixed with a separate patch.
Change-Id: I2e3bf41474cead1a860810886791e025139cca3b
Remove flake8 from pbr's requirements file, we should be requiring
hacking instead, and let hacking pull in flake8.
Change-Id: I6e7135a07e3ca6b9e26fcc9623b1434ecba1444f
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.
Change-Id: Ic09e1f7f90216064d550bc06c6301d5e1779b5aa
Closes-Bug: #1277495
This breaks various peoples fingers and there was no overwhelming
community support, nor historical evidence, for enforcing the proposed
rule in either direction.
Change-Id: Id2a5af9bb8a49af0a2f94b38a8e7d5ef1208e627
We can go back to using the official release of
testrepository for testing under python 3, so
do.
Make python 3.3 part of the default environment
set for anyone running all of the tests.
Change-Id: I0c56f9cde643ef8580ab305080bc62b87809bf7e