Commit Graph

54 Commits

Author SHA1 Message Date
Takashi Kajinami 8a42e5ae40 Use consistent commands for coverage
This updates the command executed in the cover target to make these
more consistent with the other repos. The main change is now we ensure
old data is erased before executing the steps.

Change-Id: I2c2b8a60ddfda9b8184e61113d11a7bdafe113c7
2024-02-07 12:18:52 +09:00
yangyawei fa5f76e559 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: I28abab34878d3c62a88be8894107f994d02c1c4f
2021-06-07 16:41:34 +08:00
Hervé Beraud 7b649af0c1 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.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html

Change-Id: Ifcaf6993517d02bf54cd144efd247832947a009f
2021-04-16 14:40:05 +01:00
Zuul 092e638310 Merge "Use py3 as the default runtime for tox" 2021-04-16 13:20:19 +00:00
Zuul 195ddc3023 Merge "Use TOX_CONSTRAINTS_FILE" 2021-01-30 16:32:07 +00:00
Stephen Finucane e103baa002 pre-commit: Resolve dependency conflicts
hacking 3.1.0 depended on 'flake8<3.8.0,>=3.6.0', while we were
specifying flake 3.8.3. This resulted in an error when using the
dependency resolver introduced in pip 20.3. Resolve this by bumping to
hacking 3.2.0.

We also remove bandit and pre-commit from test-requirements, since these
are linters which are not managed by upper-constraints and are not
necessary to run tests. oslo.context is also specified in both
requirements.txt and test-requirements.txt, so we remove it from the
latter.

Change-Id: I829870c327b73b583877b9b969ee38f0bcaa1495
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-01-18 15:48:28 +00:00
Hervé Beraud 9b26732ee6 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: I4a244fc6f2d0d614d579fb944255be728fee1d61
2020-11-04 10:03:26 +01:00
likui 61e930f5f8 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
-https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/

Change-Id: I5d023d0c1e74b01bb3743c54f4a0536085b98e93
2020-11-01 16:28:26 +08:00
Hervé Beraud 266ee36d33 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: Ia9f7040f9966f1492c590a005f55ef7f3b67f0c9
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 11:45:02 +02:00
Sean McGinnis c0a56a7483
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: I2217d3d37fa9a2c1dacc8ce2247801bc7d27ae7c
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:50 -05:00
Andreas Jaeger c483dee1f3 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Blacklist:
W503 line break before binary operator
W504 line break after binary operator

Fix:
E123 closing bracket does not match indentation of opening bracket's line
E126 continuation line over-indented for hanging indent

Change-Id: I39003496a3f4be5a4cb05cdbae53a9c097e34e14
2020-03-30 14:41:48 +02:00
Hervé Beraud 5fb2045c7a [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: If6a07eee86a2aaf65bdf9fbb338809ad47e02a46
2020-02-06 07:21:40 +00:00
Hervé Beraud ee55593f66 Move away from python setup.py test who is deprecated in pbr
https://docs.openstack.org/pbr/latest/user/features.html#test

Change-Id: Ie5f7cf0d8eefed2ee756114ef5a145fe151b11b2
2020-01-15 09:58:31 +01:00
Hervé Beraud 00d376edfb tox: Trivial cleanup
Move 'basepython' to the top-level 'testenv'.
Use the default 'install_command'

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

Change-Id: Ie53c073d62d0adf3627b165f1ad11c02b1927904
2020-01-08 20:04:02 +01:00
ZhongShengping 498dd44b71 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: I1c10b87297a23e010613e951f65913bb54baf6b9
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
2019-12-16 22:09:55 +00:00
caoyuan e6fe8b29ec 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: I9af0e8323b85d47983274b4d45b27f6c036ea5a8
2019-10-24 14:54:15 +08:00
pengyuesheng 2ba49903b4 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Ic8a10192e3971bbda6be45518ffe9c472369d353
2019-09-29 10:12:28 +08:00
Zuul 65ca33adb9 Merge "Move doc related modules to doc/requirements.txt" 2019-08-12 14:41:58 +00:00
caoyuan 530bbea2ee Move doc related modules to doc/requirements.txt
Change-Id: I2f12fb5058984c1fc6beda4d13f934dd9b218218
2019-07-06 18:38:54 +08:00
Corey Bryant b7da7a92ad 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: I64676b14b8a69d07e1b5fdc85e2a29523d4cf31d
Story: #2005924
Task: #34234
2019-07-05 14:55:57 -04:00
Zuul ae84284880 Merge "Replace git.openstack.org URLs with opendev.org URLs" 2019-05-20 09:35:49 +00:00
jacky06 f2e642a180 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I06b5f84891c7d90837cfbbdbb532f8479620c6c7
Closes-Bug: #1827761
2019-05-14 13:14:16 +00:00
Ghanshyam Mann bf400ddf34 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: Ic757ff7963f1dabd70610a884a4c61e747cd3961
2019-04-15 01:17:27 +00:00
Colleen Murphy 362e04c4c9 Add py36 and py37 tox envs
With python3.6 and python3.7 jobs added to the Zuul jobs, it makes sense
to add this to the tox config too so that developers can run those
tests as well.

Change-Id: Iccc84a4336302b49a2d5e9a82518c06914f4794a
2019-02-25 12:11:46 +01:00
Lance Bragstad 8f74e2ba28 Fix requirements and convert to stestr
This commit fixes two issues that are currently blocking the gate.

The first is that it bumps the Sphinx requirement to be within
acceptable constraints. The second is that it converts oslo.policy to
use stestr instead of testr. This is all being done in one patch
because proposing them individually causes deadlock (the patch to
bump the sphinx requirement fails because we're still using testr and
the patch to convert to stestr fails the requirements-check job).

The following explains the reasoning behind the stestr change.

With the upgrade to oslotest 3.6.0 [0], testr no longer works [1].
This is because oslotest no longer requires testr and we don't depend
on it directly in oslo.policy.

[0] d5a3c58f71
[1] 897823fbd6

Change-Id: I6dac4c8e7b39c9b80cc8f3728763e8d783c9e940
2018-07-02 17:30:07 +00:00
Doug Hellmann 161a8cb327 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: Ifeed5b9c1357cbb00502c8c7d2932a5e2ad2e2a6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Kenneth Giusti 5187fe533f 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: Ifdc94e6cd8f39007577f1825ad6a65e5bc505911
2018-05-02 11:29:50 -04:00
Doug Hellmann 544d220b9c 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: I55118c8c80884d6f71d2730dfc26b28e5b1fdf28
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:03:06 -04:00
Doug Hellmann 509cf0839a 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: Iea9bdd9bfe535b8a25dbef18dac52323df9af9ac
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:41 -04:00
Zuul 5f473195b2 Merge "add bandit to pep8 job" 2017-12-07 22:23:03 +00:00
Andreas Jaeger 670f32ee53 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: Idfc9d3a731a98f5cd7cc654c8134136f286d74c5
2017-12-02 19:28:42 +01:00
Andreas Jaeger 9bb9f26ca6 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: I1d75513dfc90d23b92f19d1020c4eb9303424ce3
2017-12-01 09:47:51 +01:00
ChangBo Guo(gcb) 839b34080b add bandit to pep8 job
Add the bandit security scanner to the pep8 job.

Change-Id: I3cf1630c8d69515700e98a9274f42aa3f3b05303
2017-11-30 11:30:17 +08:00
Eric Brown b0621b439c Remove references to Python 3.4
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.

Change-Id: I1459093004581ea89c95e38a90f199ab4930d4ea
2017-01-09 10:17:01 -08:00
Tony Breeds 6db6274f80 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.policy.

Change-Id: If11bb645e9722762ae18c55c7b2808a238d6c3f1
2016-12-20 14:34:04 +11:00
Wei Li b82bfe041c Delete H803 in flake8 ignore
In hacking >= 0.10.0,do not have H803.So we should delete
it in flake8 ignore list.

Change-Id: Ife2b05586211b574eb87412f922e1a5d0ef75b0b
2016-08-02 19:34:19 +08:00
ChangBo Guo(gcb) 72043117a0 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: I712c4e32e4db3e5ef826c69a11b8c3338753906f
2016-07-12 16:40:47 +08:00
Kirill Bespalov fd785d2bb6 Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: If7aeb47ca244cfe03a34b8b8a80f0075de5f4b02
2016-05-20 18:08:13 +03:00
ChangBo Guo(gcb) 5a8969c97b Trivial: ignore openstack/common in flake8 exclude list
The directory openstack/common doesn't exist any more.
So remove it from flake8 exclude list.

Change-Id: Ib6b1714ab24aae952081e519609e5e99cf4babc2
2016-05-11 20:38:13 +08:00
Jenkins fd3c2157e9 Merge "Revert "Pass environment variables of proxy to tox"" 2016-01-16 20:26:30 +00:00
Doug Hellmann 3a54beeb6f Revert "Pass environment variables of proxy to tox"
It looks like you can work around this problem by setting an environment variable on your dev system. See https://tox.readthedocs.org/en/latest/config.html#confval-passenv=SPACE-SEPARATED-GLOBNAMES

 This reverts commit c699d7b401.

Change-Id: Ib704504594fb4c5fbaadd7497002c05ae1eefba9
2016-01-14 17:59:04 +00:00
Ian Cordasco 23d3138746 Run docs testenv by default with tox
Change-Id: Ib4e5ff86d61982d60829dce402767415cd2bf49f
2016-01-12 16:03:15 -06:00
sonu.kumar c699d7b401 Pass environment variables of proxy to tox
Change-Id: I082bcb4643fc0fa625a8ee1b64cd80f3ea1018ac
Related-Bug: #1465086
2015-12-14 10:52:51 +05:30
Davanum Srinivas 8e06226682 Remove python 2.6 and cleanup tox.ini
* Remove support for python 2.6
* 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
* Remove requirements.txt from deps, as this is
  already added automatically

Change-Id: Iaeec42e9cf4fb01841e048f265f44772b6615050
2015-11-16 00:32:56 +00:00
Ronald Bradford e3e8f15580 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: Ib0a14b9a05c61ce154f8e24178fc3574e422ccc8
2015-10-01 15:39:58 +00:00
Davanum Srinivas 6cd6516353 Add tox target to find missing requirements
Change-Id: If9ce04ac555ffd10221739e1582e01ac3d924d2a
2015-06-26 15:03:01 +00:00
Doug Hellmann b475cd53da Update comments about tox configuration
Explain the real reason for not using skipdist and develop in this
library, which does not have the namespace package.

Change-Id: Iaa91ab87ccacae8c26efc473e17b378eec50c31a
2015-02-17 18:25:58 -05:00
Doug Hellmann 0e744e4891 Change default set of tox environments
Remove py33, since we don't test on 3.3 any more.

Remove pypy, since we don't need to test that locally by default (it may
still be tested in the gate).

Change-Id: If714935c975de73000b5b94f9fdb1f62c3e05c55
2015-02-17 18:25:58 -05:00
Steve Martinelli c7425da06f Upgrade hacking to >=0.10.0
The current version of hacking is very old; upgrade hacking
and fix any minor errors that were uncovered.

Change-Id: Iabf38881b6030dce903c8e74670bfd6e5eabbc20
2015-02-06 06:54:57 +00:00
Steve Martinelli c91842de47 Remove oslo.concurrency from requirements
This was only being used in a test, which has since been refactored
to not need lockutils, as such we can remove oslo.concurrency
from this requirements list. Also remove a reference of it from
tox.ini

Change-Id: I3da48a5a99db126637d78a5eadfa44da594b82c2
2015-02-06 01:53:50 -05:00