Commit Graph

57 Commits

Author SHA1 Message Date
Tim Burke f401a59db1 Serialize tests
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
2024-01-22 09:35:43 -08:00
Stephen Finucane 491ce1ab09 Update tox.ini to work with tox 4
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>
2023-01-06 13:22:38 +00:00
Daniel Bengtsson 479a2954a1 Changed minversion in tox to 3.18.0.
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals[1] by allowlist_externals option.

[1] https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I7ee77638d44ee314cdfa6f6d9320b19d794b718c
2022-02-16 12:05:40 +01:00
Jeremy Stanley c718425299 Don't test with setuptools local distutils
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
2022-01-20 21:01:47 +00:00
Hervé Beraud 8e47cad901 Dropping lower constraints testing
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
2021-03-09 12:25:45 +01:00
Hervé Beraud f5e4c6577a Adding pre-commit
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>
2020-10-21 16:48:08 +00:00
Jeremy Stanley 175fad9af9 Add Release Notes to documentation
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
2020-08-11 21:20:17 +00:00
Jeremy Stanley 5fdbae5952 Re-add ChangeLog
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
2020-08-06 13:10:36 +00:00
Stephen Finucane 73c11c6267 Add support for virtualenv 20.x
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
2020-08-05 15:01:15 -07: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
Corey Bryant e4b89ae2cb Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: Ie9765e198e1204f56976476c8cfc9cc008c23d8f
Story: #2005924
Task: #34234
2019-07-17 10:03:07 -04:00
Stephen Finucane 79ef8d989a Resolve some issue with tox.ini, setup.cfg
- 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>
2019-06-13 15:46:30 +01:00
Ben Nemec 96b84a9014 Stop using pbr sphinx integration
Switch to sphinx-build directly and add sphinxcontrib-apidoc for
generated api docs.

Change-Id: I089a7695986892dcb47c5b5e79a6a227891a2347
2019-06-07 18:37:58 +01:00
Ben Nemec e8e9da3d90 Switch to release.o.o for constraints
This is the preferred location to get constraints now.

Change-Id: I5dc34e63f94ebf9c19ffb5caeeea24581eca658f
2019-06-07 16:17:10 +00:00
Ben Nemec ab3db59c5a Make WSGI tests listen on localhost
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
2019-06-07 16:17:10 +00:00
Corey Bryant 20d95468bc Add openstack-tox-py37 job
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
2019-05-23 10:42:30 +00:00
Stephen Finucane ed77ce858d tox: Suppress output
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>
2018-10-04 16:34:58 +01:00
Stephen Finucane 5c012fe168 tox: Re-add cover target
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>
2018-07-19 11:40:00 +01:00
Stephen Finucane 2222dbb47e Switch to stestr
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>
2018-07-18 10:12:17 +01:00
Stephen Finucane 8b727ce929 trivial: Remove 'tools/releasenotes_tox.sh'
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>
2018-07-18 10:12:04 +01:00
qingszhao 6c546bc9ab Update python3 versions in tox.ini envlist
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
2018-06-12 16:43:55 +08:00
qingszhao 0ddb7ec6dc fix tox python3 overrides
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
2018-06-12 01:47:42 +08:00
Doug Hellmann 7b0374d680 add lower-constraints job
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>
2018-03-29 16:07:24 +00:00
Andreas Jaeger 0f3f25590d Avoid tox_install.sh for constraints support
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
2017-12-02 20:32:49 +00:00
Gaetan Semet dbc30e6980 Test on Python 3.6
Change-Id: Ifbea05bd0c3ee014d97fb1633cabed348f9ce9ec
Signed-off-by: Gaetan Semet <gaetan@xeberon.net>
2017-12-01 04:46:04 +00:00
Stephen Finucane f450cd26a2 Add reno for release notes management
Change-Id: I36b8193b22123a409b729c7b9f4309507379f1ad
2017-10-10 09:36:59 +01:00
zhangyangyang 558980151a Remove py26 support
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
2017-09-20 09:57:15 +08:00
Jenkins f377238903 Merge "Remove testr entry point" 2017-03-27 23:12:29 +00:00
Stephen Finucane 882875a66e tox: Don't set skipsdist=True
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
2017-02-27 14:23:50 +00:00
Ian Wienand e3ad98ca19 Remove testr entry point
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
2017-02-24 11:30:09 +11:00
Dirk Mueller 1070ae649e Add Constraints support
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
2017-01-03 19:27:57 +01:00
ChangBo Guo(gcb) 4480b9e099 Add Python 3.5 classifier and venv
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
2016-07-12 17:28:54 +08:00
Ondřej Nový fb0e9de4c3 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I7c9cb6abe68639309db268076a4d021af09cdcc9
2015-12-11 22:28:39 +01:00
Jenkins 097dce7f9b Merge "passenv integration environment variables re-enabling integration tests" 2015-12-11 02:14:54 +00:00
Sachi King 4afcabe646 passenv integration environment variables re-enabling integration tests
Change-Id: I87e0c7765df1fa9ae336d8e9052c3947c9fc8392
2015-12-11 10:40:51 +13: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
Robert Collins d67f22fc3f Finish removing invocations of pip.
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
2015-05-12 09:31:20 +12:00
Monty Taylor c01b8dae1e Port in git sha changes from 0.10 line
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>
2014-12-21 22:20:49 +00:00
Jeremy Stanley f817818bfa Work toward Python 3.4 support and testing
Change-Id: Ie49b56c0fd67f36d251aa4690d915c05225d49d1
2014-09-03 19:02:56 +00:00
Steve Martinelli b561ef2e14 cleanup tox.ini
remove unnecessary dependency declarations

Change-Id: If2f3c7fcabe474902cdb18cd6890a49144266690
2014-08-12 12:03:35 -04:00
Doug Hellmann efd78c21d2 add docs env to tox
Change-Id: I2d987e15ce7c61ed32a5f5178130f3654d71a938
2014-08-12 09:56:30 -04:00
Christian Berendt b077c056e3 Bump hacking to 0.9.x series
Ignore H904 because it's a deprecated hacking check.
Ignore H405 because it should be fixed with a separate patch.

Change-Id: I2e3bf41474cead1a860810886791e025139cca3b
2014-07-22 14:22:57 +02:00
Sean Dague 8494418e71 make pbr use hacking directly
Remove flake8 from pbr's requirements file, we should be requiring
hacking instead, and let hacking pull in flake8.

Change-Id: I6e7135a07e3ca6b9e26fcc9623b1434ecba1444f
2014-04-08 19:37:20 -04:00
Jeremy Stanley ca67985ff3 Remove tox locale overrides
* 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
2014-02-10 02:59:04 +00:00
Monty Taylor 9f04dba0ec Update tox config to use latest upgrades
Change-Id: I3b9e627eecc5b805db3fed2ae9571ccfc3dbd6fc
2013-09-21 20:03:39 -04:00
Julien Danjou 3fbf36ef47 Add pypy to tox.ini
Change-Id: I590af708465e8a8a3d5d5f64cc4ad1a9d640abc7
2013-08-27 10:33:41 +02:00
Robert Collins 00f878c557 Stop checking periods in commit messages
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
2013-08-14 12:51:18 +12:00
Doug Hellmann 6aeee95e2a Fix python 3.3 tests
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
2013-07-21 15:51:14 -04:00
Jenkins 09d9af4ad0 Merge "Add Python 3.3 checking" 2013-07-16 22:58:29 +00:00
Julien Danjou 5f94c7ee4a Add Python 3.3 checking
This adds support for a working py33 tox target.

Change-Id: Icfe1ed7dd256568f33487d03ba9c9be9a454c84a
2013-07-15 19:28:16 +02:00