Commit Graph

40 Commits

Author SHA1 Message Date
yangyawei 59c0aadb89 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 by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Id73cfadea402d211a807b7f8df4dd374a624dece
2021-06-07 16:44:38 +08:00
Zuul 4d5d360da9 Merge "Use TOX_CONSTRAINTS_FILE" 2021-04-16 12:41:44 +00:00
Luigi Toscano 117d28ee8f Dropping lower constraints references
As a follow up to Ied61e65006ad54803453776e763594e216be1353,
remove the lower-constraints.txt file and its references.

Change-Id: I2baa6d318cdbbf86da86cc94171cc7714dbdba3a
2021-02-18 14:25:23 +01:00
Hervé Beraud bdce5a0b8a Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: Ic59d8cefc410c2b9bfc451c721106db921787433
2020-12-16 11:16:06 +01:00
Hervé Beraud 7ce947c8fe Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Ib41e75006acf4dd72968ab1896034f75899e8c34
2020-11-04 10:05:34 +01:00
Hervé Beraud e8b3a90978 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: I60e74ffcc7a4cc5bb80b19c3aae1b317442d93bd
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:29:04 +02:00
Sean McGinnis dd3860afae
Bump default tox env from py37 to py38
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.

This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.

Change-Id: I4a728b688b699a3418466854be9a99d532687615
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:52 -05:00
Stephen Finucane 298c5107eb Bump to hacking 2.x
This allows us to use a new version of flake8 that supports Python
3-only syntax. Existing issues are resolved.

Change-Id: I5de7e5cde6a5260f4e7e57586952256b59d3756d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-02-07 10:35:08 -08:00
Hervé Beraud 1327088489 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ic8653cdf5a3d9c36ea608a0cd91d72e0a5921a26
Sem-Ver: api-break
2020-02-07 07:56:16 -08:00
caoyuan e63e75e938 tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Ifa4706d1191d56899e06ff77ea7b12936aac0328
2019-10-24 14:24:56 +08:00
Corey Bryant 14ee7e056f 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: I6de529d6082cad61d81025ba7df6cebd27048dd2
Story: #2005924
Task: #34234
2019-07-05 15:11:48 -04:00
Stephen Finucane 99dc6e0198 Resolve some issue with tox.ini, setup.cfg
- Use constraints for documentation targets
- Indicate support for Python 3.7

Change-Id: I5f068d199e70cb7c2f0f71972bb0f81e025795fe
Signed-off-by: Stephen Finucane <sfinucan@sfinucan.users.ipa.redhat.com>
2019-05-31 18:23:28 +01:00
Ghanshyam Mann 40007e84db Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I896a0640e7fb0a12d50c89e1964641a9e9e37976
2019-05-31 18:22:33 +01:00
jacky06 a022fbe382 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Id0d2722822207f499a4980e4bc149e8b25e243c8
2019-05-27 03:10:28 +00:00
Vu Cong Tuan 538bc761ce 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.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I5c4d37afdc438cc978bff37e4d0c56c7ad60fb19
2018-07-04 08:12:19 +07:00
Doug Hellmann 8f3213f8c6 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: I1a478fc7568d350e77773edbf7ac3b4c3e50cff2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Kenneth Giusti 337cd36459 Remove stale pip-missing-reqs tox test
pip_missing_reqs tool is no longer maintained and has broken with
release 10 of pip

Refer to:
 http://lists.openstack.org/pipermail/openstack-dev/2018-April/130027.html

Change-Id: Ie3482611889cb9194c123fdcfd1a12d56e068244
2018-05-07 12:59:23 -04:00
Doug Hellmann 151296d66b set default python to python3
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.

Because flake8 runs under python 3, where the type "long" has been
merged into int(), we have to ignore the error from the undefined name
in one of the tests.

Change-Id: I86ae7f83d17724d74bae7102dd1775eceb82599d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-16 14:49:20 -04:00
Zuul c51a45babf Merge "pypy is not checked at gate" 2018-03-29 17:37:15 +00:00
Doug Hellmann 31fd94679a 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: I7ccf66c212c3a885b4f5ed13dfcf6ba70f7733e8
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:59 -04:00
Anusree a512c909e5 pypy is not checked at gate
Change-Id: I8dba481d7a13d7a08ce1a0326d233cb735ce1253
2018-03-21 21:51:35 +05:30
Sean McGinnis 3eefca693e Treat doc warnings as errors
With the switch to build-sphinx, the setting to treat warnings
as errors was missed. This adds the -W flag to bring back this
setting.

Also cleaning out doc related settings from setup.cfg as they
are no longer being used.

Change-Id: Ic45deb8acdebc53f7cad98eb5c9fd9388929eee9
2018-01-08 11:59:49 -06:00
ChangBo Guo(gcb) 16a6db4e9e Add bandit to pep8 job
Add the bandit security scanner to the pep8 job.
* convert assert statement to raise AssertionError
* skip B303

Change-Id: I0eb83dd6de80090562dd43bca4e5eb4e88e27bf9
2017-12-26 18:56:35 +08:00
ChangBo Guo(gcb) bd7090a108 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:

https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Ib02738563f5ae3712e1074a3b08c693ea7cdea79
2017-12-21 17:18:16 +08:00
Andreas Jaeger f999996ed1 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: Ie2bf2618c8e202653a45cde195bd395ab7058dc1
2017-12-19 12:58:40 +01:00
gengchc2 f1aca64625 Remove support for py34
The gating on python 3.4 is restricted to <= Mitaka. This is due
to the change from Ubuntu Trusty to Xenial, where only python3.5
is available. There is no need to continue to keep these settings.

Change-Id: Ic93146804d55e98c80733b2f14cde36908a42bc2
2017-02-08 17:37:05 +08:00
Tony Breeds 542e5b592a Add Constraints support
Adding constraints support to libraries is slightly more complex than
services as the libraries 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 oslo.versionedobjects.

Change-Id: I003cdce359e5d79a73f0c3f274765ad1f50bf3a4
2016-12-13 15:40:09 +11:00
ChangBo Guo(gcb) 71de5fd023 Add reno for release notes management
The release management team have indicated this is their preferred way
to collect release notes in future.

Closes-Bug: #1634356

Change-Id: Iac926d87064af92ea7e2e8eb24c72effca2641bc
2016-11-03 14:43:46 +08:00
ChangBo Guo(gcb) def295f482 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: I846a4e8cd80e4330203120e782c9071070abb0cb
2016-07-12 17:02:51 +08:00
ChangBo Guo(gcb) 4cdab4b3a0 Clean up directory openstack/common
We don't use anyhting from directory openstack/common any more,
so clean up related stuff.

Change-Id: I103477135a848107c70a222f28e842026b50313c
2015-12-09 17:59:31 +08:00
Davanum Srinivas 8116ef9376 cleanup tox.ini
* Remove skipsdist : Needs to be set only if 
  sdist is expensive
* Remove usedevelop : only needed when skipsdist 
  is set to True
* Remove install_command : We can just use the 
  default, we don't need to override
* Remove setenv : We can just use the default as
  we don't need any extra environment variables

Change-Id: Idb0a475054743fa716c7948e974a7268862c74c7
2015-11-16 00:41:17 +00:00
Ronald Bradford 9393cd451c Fix coverage configuration and execution
A number of configuration errors prevent the successful creation of code
coverage. This corrects the .coveragerc source/omit setup and the tox
package name generation.

Change-Id: Ie55159304b8633acd6b06ba94d0cb8507a337504
2015-10-01 19:54:59 +00:00
Doug Hellmann 3f9f2e1199 Move fixture dependencies to extras
Rather than always installing dependencies for the test tools included
in the library, define an extras called "test" and include the
dependencies there.

Add API documentation for the fixture module, and include notes about
installing the extra dependencies in the module documentation and
installation instructions.

Closes-Bug: #1440350
Depends-On: I78838dcd4da43b3c1d2610ac87a3ec55b9535646
Depends-On: Ibd2410e0153053b5121155474e99752256c7e4b8
Change-Id: I4e45c1bb4f08c9da510939514c5358e1575d3e0a
2015-07-12 18:08:01 +00:00
Davanum Srinivas 3eea063f61 Manual update the requirements
According to the disscussion[1] we have to remove the requirements-PYN.txt

Took the opportunity to remove py33 and py26 from the tox targets as we
don't need them

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-July/068469.html

Depends-On: I0f07858e96ea3baf46f8a453e253b9ed29c7f7e2
Depends-On: I33bd2d9dff9cb7dc1a50177db7286b7317966784
Change-Id: I9cebc3d4e3a8eb73acb30c397e3ee20b5e91b1ac
2015-07-04 03:15:01 +00:00
Davanum Srinivas c17ea373ec Add tox target to find missing requirements
Change-Id: Ie171c0c7c4cba305092570fcf20b40c1735d1279
2015-06-26 07:35:38 -04:00
Doug Hellmann 29ac0fcaae Update to the latest version of hacking
Update the version of hacking to the one released for kilo, and fix
issues with code formatting that cause the new hacking checks to fail.

Change-Id: I4c9906df3e71f33b5a13e1f68584d445d79daceb
2015-04-03 14:08:13 +00:00
Davanum Srinivas ea50a5b411 Cleanup comment and H803 hacking
H803 is no longer in hacking. It was removed in:
Ic758c30eec15cdd6b20a326095d6e8557199daa1

Remove unnecessary comment about PYTHONHASHSEED

Change-Id: I8e3f1c60752edf31e00ae43d241860cf2feca339
2015-02-18 14:25:03 -05:00
Grzegorz Grasza 1b8336fbe8 Compatibility with Python 3
Make the tests run under Python 3.4.
Tests now work with random hash seed.

Change-Id: I5f9f57e0bef2c015ab2ff4b5732ccdade5d3bfbe
Closes-Bug: 1417279
Closes-Bug: 1417285
2015-02-12 09:46:28 -08:00
Doug Hellmann 1e146a916e clean up and get most test running
Remove extraneous utility code and tests.

Skip tests related to remote object verification until we can rewrite
them (see the adopt-oslo-versionedobjects spec for details).

Fix pep8 errors.

Update requirements.

Set python's hash seed in tox.ini for tests that compare things that
might come out in a different order.
2015-02-02 16:24:14 -05:00
Doug Hellmann 2e6d52b475 apply oslo-cookiecutter template 2015-02-02 15:08:43 -05:00