Commit Graph

41 Commits

Author SHA1 Message Date
Stephen Finucane 629a2b20ac tox: Bump minimum to tox 4.x
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Iecab3e0d0f088e2433916970f27797cf0cd0a8e9
2023-12-19 17:39:32 +00:00
songwenping a814032763 Remove usage of six
Change-Id: Ifce6c18e1da1bb3eb0cff9f03a91cdd1a84dea4c
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-19 17:38:48 +00:00
wu.shiming 0d208eb0aa Remove lower-constraints remnants
These were missed in change: I63153d3258e10d232f86f7a8b652eb7028aab4c6

Change-Id: I47388f13483d2938208ba385be4c94731e79e3ae
2021-02-20 09:28:34 +08:00
Zuul 3539da4479 Merge "Use py3 as the default runtime for tox" 2021-01-21 15:05:26 +00:00
Hervé Beraud 333b7375fd 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: I9b345814296b5c6269d2634fc42b947f95cad389
2020-11-04 10:52:45 +01:00
Hervé Beraud b591174f3b 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: I06b805afb6c3c936b55a9e322cf406e424aeb8bc
2020-11-04 10:06:12 +01:00
Hervé Beraud 2f4cb354f7 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: Icd2a9bded756b2bcba1fb7da6abe48503fd9b2d6
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 17:10:31 +02:00
Andreas Jaeger 58b40e7f2a Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering

Update Sphinx version as well.

Create doc/requirements.txt file and use it, remove docs requirements
from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

Set openstackdocs_auto_name to use 'project' as name.

Depends-On: https://review.opendev.org/728938
Change-Id: Ic3503a8b38e67e50669428b36f6581cb980d687f
2020-05-18 20:59:21 +02:00
Sean McGinnis aed3f5eab5
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: I0675da8241f60e8699f2aa80b13773d9284cc3ae
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:52 -05:00
Andreas Jaeger 4d45f96942 [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

Update docs building to use modern sphinx-build.
Update to use apidoc for newer sphinx.
Remove cruft from setup.cfg and doc/source.conf.py

Change-Id: I6a0643fcf8e28e09b1c69cda98dc53c71e6c508d
2020-02-03 20:37:28 +01:00
Stephen Finucane e177e5db21 tox: Trivial cleanup
Remove some noise and move 'basepython' to the top-level 'testenv'. Also
use the new-style URL for upper constraints.

Change-Id: I1a5f9bbcad2ef9e4551739900a7e688bfffa0a6c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-12-19 09:38:43 +00:00
Corey Bryant 7ad16dea56 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: Iab320e15df4d9922ad96780dcfc16c7045325cfc
Story: #2005924
Task: #34234
2019-07-05 15:03:03 -04:00
jacky06 c36485c7ce Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Ife085fd9a36d96b00c43ced290c1d761a782d03f
2019-06-10 14:36:33 +00:00
Ghanshyam Mann d10fe40064 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: Id9a516dc3e748f66278875f22c606a9f7acf41d9
2019-04-16 04:05:57 +00:00
Vieri 31764711f7 Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: Ifae9724565efd8716d8d8d5698edf4a3ff71f3f9
2018-10-09 13:38:28 +00:00
Andreas Jaeger 99bf2bd40f Use templates for cover and lower-constraints
Use openstack-tox-cover template, this runs the cover job
in the check queue only.

Use openstack-lower-constraints-jobs template

Remove jobs that are part of the templates.

Sort list of templates alphabetically.

Fix tox.ini for cover to work.

Change-Id: Id46f74ab4a8f64f7159effc8fa4d552f8217c498
2018-09-07 12:38:00 +02:00
wangqi 897823fbd6 Switch to using stestr
When the TC merged I2637dd714cbb6d38ef8b8dc1083e359207118284 we're
supposed to invoke stestr rather than testr so lets do that

Change-Id: Iba54c6540644d3d4942686b9f1c33fce6d19d431
2018-06-14 18:51:15 +00:00
Doug Hellmann 258f8945ba 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: I6cb85818f107513a91a891eb8905f0a9a54dc716
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Doug Hellmann 9837c5ef98 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.

Change-Id: I6751b74c5dee149972695258672db0f82787d646
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:10:00 -04:00
Doug Hellmann 9460095d7d 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: Idf28fdf830bf9524df8fbeb684658719bccf4f0a
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:03:05 -04:00
Andreas Jaeger d17e3d220d Remove -U from pip install
'pip install -U' ugrades specified packages, this is not necessary
since we use constraints, remove the parameter '-U' from the line.

With tools/tox_install.sh - which a previous change of mine removed -
the -U was not harmful, but with the current set up, it might cause
upgrades, so remove it.

Change-Id: I4b5269fe56c6eba07d4d9044ca8ec3c53758d952
2017-12-02 19:31:06 +01:00
Andreas Jaeger 88dc78c494 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: Iafae5f3111c968a4ec2adf63e447459f3ccc41ae
2017-12-01 09:54:17 +01:00
kavithahr 30c4c81b34 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: Idc263504b68bc909fe7c6cd983c27c1fcc384c16
2017-03-09 05:52:01 +00:00
Tony Breeds 4fbb2c86e3 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 oslotest.

Change-Id: I21e2d0555334a1bd7ad8aa37796f599292b30ed0
2016-12-20 14:37:57 +11:00
ChangBo Guo(gcb) e2bf33243c 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: I3d2e96603238d58ee02ca9b37b3d9dd8f750306d
2016-11-03 15:08:00 +08:00
ChangBo Guo(gcb) 7bff0fc012 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: Ifd6a17b8e250f7ff8e36e972e175099044d7146e
2016-07-12 16:59:39 +08:00
Davanum Srinivas cf73555607 Remove python 2.6 and cleanup tox.ini
* Remove support for python 2.6
* 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
* Remove requirements.txt from deps, as this is
  already added automatically

Change-Id: I4f650eaa07624b889a52570e628a21e905f2bd46
2015-11-16 00:54:40 +00:00
Ronald Bradford b5e355fcec 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.

http://lists.openstack.org/pipermail/openstack-dev/2015-October/076193.html

Change-Id: Ia337cd014d4130f60a88fc988eabcc85d9142834
2015-10-06 09:14:07 -04:00
Jenkins 1654fffeb2 Merge "Remove six.moves call" 2015-05-21 22:13:36 +00:00
Davanum Srinivas f8a5a3c935 Advertise support for Python3.4 / Remove support for Python 3.3
Change-Id: Ib2e132a2d74c2f2e8a2f6ef4da38bfd1f1ea21f8
2015-05-10 19:24:38 -04:00
Julien Danjou 9e0c8ad2c2 Remove six.moves call
This patches remove the six.move call as it's does not move anything
since it relies always on mox3.

Change-Id: Ic59c73abb9b09cb594bf7df4173d7f99f81d526c
2015-01-15 11:24:07 +01:00
James Carey 28f55cb1d0 Activate pep8 check that _ is imported
Currently translatable messages are not used, so there are no uses
of _.

This will ensure if _ is used in the future pep8 won't assume
it is provided as a builtin, and to be consistent with the rest of
oslo.

Change-Id: I5b840eaf1a55d3df40ed56af19ea7349f167b5a9
2014-12-11 23:04:10 +00:00
Doug Hellmann 118885e4b0 Set install_command in tox to avoid pre-releases
tox (lovingly) uses the --pre option with pip. We don't want that, so
override the install_command with a version that doesn't include it.

Change-Id: I0b8e48488d5c138c0aac85df2336b2340d7c59c4
Closes-Bug: #1379998
2014-10-11 10:44:20 -04:00
Jeremy Stanley 2793ad9c57 Work toward Python 3.4 support and testing
Change-Id: I111d9d6478d4119209dff06aa712aa4cdd61eaa4
2014-09-22 13:31:49 +00:00
Yuriy Taraday 0e07c5e293 Remove differences between Python 2.x and 3.x versions
We had these differences in requirements:
- mox in 2.x vs mox3 in 3.x: mox3 works for 2.x as well, so use it
  everywhere, mox3 version bumped to match global-requirements;
- mock in 2.x, absent in 3.x (in stdlib): it's installable on 3.x, so we
  can leave it in requirements;
- six in 2.x, absent in 3.x: is directly required by this lib, has been
  installed indirectly through hacking.

test-requirements files were identical.

This change allows us to build universal wheels and avoid confusion, see ML:
http://lists.openstack.org/pipermail/openstack-dev/2014-September/044663.html

Change-Id: I8bd2d561bf966c6dc1394a7d29d26f056d162fa9
2014-09-03 13:32:36 +04:00
Jenkins 1fa6ddf6a2 Merge "Moving to use the mock module found in Python3" 2014-07-11 19:39:42 +00:00
Doug Hellmann aec9e529fd Add API documentation
Add docstrings and sphinx structure to expose them through the developer
docs for the library.

Also add a 'docs' target in tox.ini to make building the documentation
locally easier.

Remove the nearly useless usage.rst file.

Turn on the pbr flag to treat doc build warnings as errors.

Closes-bug: #1329952

Change-Id: I274a4144edf4efe9ed786e220e40003fda6f99e0
2014-06-23 08:18:21 -07:00
George Peristerakis 4fc793fce5 Moving to use the mock module found in Python3
Change-Id: I6a2af0405b8628d4589ce7edb56f10935d5112ea
2014-06-20 11:12:17 -04:00
Doug Hellmann 5f92f04e50 Add test for moxstubout
Add a test for moxstubout and update all of the python3-related
bits needed so the tests will pass there. Those changes are
based on Julien's work in https://review.openstack.org/#/c/55606

Change-Id: Ie7c41dbfbabfb3bcbd4e181b095aa2cf09345f5c
2014-02-18 05:49:53 -08:00
Doug Hellmann fbace0104e Run python 3.3 tests first to set testr db type
testr uses anydbm, which defaults to a different type under
python 2.7 and 3.3. The default under 2.7 is no longer available
under 3.3, so without this change running "tox" results in
an error from testr about loading its database. With this
change, the 3.3 tests run first and then 2.7 can read the
database created.

Change-Id: I1a51d228c06af0ea7d3579fcec53d35922292e2d
2014-01-30 14:04:08 -08:00
Doug Hellmann 05dc2d8695 Add packaging and test control files
Need to move the tests back outside of the oslo.test package
because testr complains about importing them from the
wrong place if we don't.

Change-Id: If8e0521dc345f8941f9c7116477549291cf600d2
2014-01-30 13:59:42 -08:00