Commit Graph

46 Commits

Author SHA1 Message Date
Takashi Kajinami 194dc107a0 tox: Drop envdir
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~

According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293

Change-Id: I704c467d08ecd2ba22e9ac52263d1108a28d5e96
2024-02-02 23:33:19 +09:00
Stephen Finucane eaca4281d0 pre-commit: Integrate bandit, mypy
Lets us centralise all linters.

Change-Id: I27f03a92377897faad589ae84a315ed1b90d1fca
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-12 08:34:11 +00:00
Hervé Beraud 7696282cb5 Fix the docs job
Related to https://lists.openstack.org/pipermail/openstack-discuss/2023-February/032247.html

Change-Id: I2981285fe29790737431b1083979388c02938a67
2023-02-17 13:14:52 +00:00
Stephen Finucane 3400cc2871 Integrate mypy
oslo.context is pretty small and therefore easy to introduce mypy for.
Minimal type hints are added, along with tox targets to validate things.
We can build on these in the future if we'd like to.

Change-Id: Ie5ab9eedfc89654ac3aa635f4a3ad24409ad23b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-01-25 15:00:32 +01:00
Daniel Bengtsson 8d44224e52 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[1]
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.

[1] https://github.com/pypa/setuptools/issues/3038

Change-Id: I2eacb9756d9eb9c5d606599f16cdb412007f5854
2022-01-21 14:54:48 +01:00
Zuul 0efc6a0c94 Merge "Use py3 as the default runtime for tox" 2021-04-16 13:26:01 +00:00
Zuul 7c9f430657 Merge "Use TOX_CONSTRAINTS_FILE" 2021-04-16 12:42:23 +00:00
wu.shiming a24a5a0676 Remove lower-constraints remnants
These were missed in change: If2a9cf05f382ae28846b95e5bb29669ee57f9bcd

Change-Id: I364eea549d42e75471288c597bd9dd8094d87c64
2021-02-19 15:06:26 +08:00
Hervé Beraud d4a4b6d133 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: I6e159fccb36d1c68beb2b20357311b618106bc3e
2020-11-04 10:47:22 +01:00
Hervé Beraud f0da2bb0df 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: Iebd65c5ae0b3478d7e313e6cf947c746f50dd4a0
2020-11-04 10:01:32 +01:00
Hervé Beraud 3b6da997d6 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: I4473e5e96419e4da9c8922d5832249da23c61acd
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:01:06 +02:00
Sean McGinnis 0fa8cb9ee3
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: I0dff5f597bd431159b868d210d1c199d373bb318
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:48 -05:00
Hervé Beraud 12fcb067c4 trivial: Cleanup tox.ini
Update the minversion parameter to use the python -m pip to install
python packages:

https://tox.readthedocs.io/en/latest/changelog.html#id185

Also Inherit the jobs requirements to simplify maintainance.

Change-Id: Ib6e94fa9f822830242a99f6690349569626f1931
2020-02-11 15:40:53 +01:00
pengyuesheng 3017e180f0 Drop python 2.7 support and testing
Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ie875138bd1b773f460698e1eacc9dab542318e30
Sem-Ver: api-break
2020-01-30 11:43:11 +00:00
caoyuan b53efb7fcb tox: Trivial cleanup
move 'basepython' to the top-level 'testenv'

Change-Id: Icd5c18a2eb0d75f015e7ea7ee3c6554055a24798
2019-12-19 22:47:29 +08:00
Stephen Finucane ca925b108c tox: Stop using 'python setup.py test'
pbr has deprecated this. Call stestr directly instead.

Change-Id: I26628e4734c6d7a911fbe16ad753173a36fd8dab
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-12-06 15:06:18 +00:00
caoyuan 5c5df03d0b 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: I07690fb61001eb282d895fbbac4cd856defe6581
2019-10-24 14:30:47 +08:00
pengyuesheng cc59dba4cd Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: If1620c39aea38df6bc5cec4e6d574fb372d8ec8a
2019-09-29 10:22:18 +08:00
Corey Bryant 07f068d8a2 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: Ie166f1623c15891f381fc367b8dd854386efa90a
Story: #2005924
Task: #34234
2019-07-05 14:43:39 -04:00
Zuul e86ad44a50 Merge "Replace git.openstack.org URLs with opendev.org URLs" 2019-05-04 22:26:39 +00:00
jacky06 dd33e2a2c8 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Iaf18cea9ee9f1edfd1ef1a96a36de1569e399886
2019-04-30 13:30:33 +08:00
Ghanshyam Mann bb31794553 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: I1f6f2f930ee55e2d7491858018eaab4058174484
2019-04-15 18:59:18 +00:00
Vu Cong Tuan 4abd5377e4 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: Ic863da849df2a728ce6b26bfd946262a5439fcad
2018-07-04 08:30:19 +07:00
Doug Hellmann f0ad977c13 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: Ib73cac0235c6213645187ec52c719c8403eede5c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Kenneth Giusti bcf546548a 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: Icedc01f3caf3891d5941604dcf88ad753c6ae0ec
2018-05-01 09:30:51 -04:00
Ben Nemec 84ebaf9f14 Switch pep8 job to python 3
pep8 under python 3 is more strict than under python 2, so to make
sure our projects meet the more strict standards we want to run the
pep8 jobs using python 3 by default.

Change-Id: I7b2a817147a0f1d1c7aabe09161a4df2ebec503f
2018-04-12 16:55:25 +00:00
Doug Hellmann fd3b5f1ceb 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: Ib0948bfba3be14f0068bb3b49d2d356bd36f96b9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:23 -04:00
Anusree c025b07130 pypy not checked at gate
Change-Id: I0cb3208aa193bc75a77a6e192e947eb6cc4f8cfd
2018-03-21 18:19:33 +05:30
ZhongShengping 92b96644eb Add -W for document build
For more detials information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I16c100d98b63526a9d2fb1497763c1670954b3d6
2018-03-02 10:29:49 +08:00
ChangBo Guo(gcb) f0dd124daa 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: I9d23ea7b5731fb677b2b1a09cdec74a1101dcd2c
2017-12-19 19:00:49 +08:00
Zuul f9970a94e5 Merge "add bandit to pep8 job" 2017-12-13 07:55:23 +00:00
Andreas Jaeger 83d00012b4 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: Id41c1ef58fdf8f1c15dc4be4a74faf3d6296cf5c
2017-12-02 19:29:24 +01:00
Andreas Jaeger dba909fd35 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: I2310cc11d5d0b53b42d2deb34111dfaaac34e911
2017-12-01 09:41:49 +01:00
ChangBo Guo(gcb) c7a2b56c4f add bandit to pep8 job
Add the bandit security scanner to the pep8 job.

Change-Id: Ie418ecadcff9351a776ff790492c73225efddb6f
2017-11-30 11:12:43 +08:00
Eric Brown de75dd0b84 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: I451e64acc01b843c5c7e637fddcbeeb2fe2e98d5
2017-01-09 10:13:16 -08:00
Tony Breeds 153a3c02b6 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.context.

Change-Id: I6c9bead1bbafd13e6639574955081edca93211f6
2016-12-20 14:36:12 +11:00
Wei Li 765eaa6a5d Delete H803 in flake8 ignore list
In hacking >=0.10.0,there is not H803.So we should drop it
in flake8 ignore list.

Change-Id: I27fc7c095e9cbbb29dddb06c3675038d595e1711
2016-08-02 19:44:31 +08:00
ChangBo Guo(gcb) 932b495077 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: I800ad84596d1ff25686516fcf84184ce185cc77a
2016-07-12 15:36:50 +08:00
Kirill Bespalov 061741287a Add reno for releasenotes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: I8a18a2f2550ff82954d28a6e897a9ce9b1f8f1ba
2016-05-20 17:58:52 +03:00
ChangBo Guo(gcb) cf33c028e9 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: I3de6bac0c10f194108e0e77db1bb21a7421c6cf6
2016-05-11 19:26:50 +08:00
Davanum Srinivas 2530b7f847 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: Ibceadc1d9f315044121e904f97e53aafec3b7cfa
2015-11-16 00:46:18 +00:00
Ronald Bradford 5e677dc232 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: I74d2af73a57ba72631e5eea3ace3275c0b349352
2015-10-09 16:11:45 -04:00
Davanum Srinivas 480c910d44 Add tox target to find missing requirements
Change-Id: Iaa35e2ec6365d08a5c5272e19a836b40dc7c792c
2015-06-26 07:20:31 -04:00
Davanum Srinivas 23f81eaa0c Remove support for Python 3.3
Change-Id: Ib695f4dc43f10663b910ca5c1fce15f3f4865ca0
2015-05-10 19:16:37 -04:00
James Carey 205479f254 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.

Change-Id: Iad8357364ad88961c280096480e8521d873f7c7f
2014-12-11 22:52:12 +00:00
Davanum Srinivas 885f545d81 exported from oslo-incubator by graduate.sh 2014-11-05 15:03:32 +01:00