Commit Graph

38 Commits

Author SHA1 Message Date
Zuul 62e416b295 Merge "pre-commit: Integrate bandit" 2024-02-08 13:39:33 +00:00
Takashi Kajinami eeb14fb6ff Update coverage commands
... to use the ones consistent with the other repos.

Change-Id: I808820b1921f4e362ec656693bcd387067af0b72
2024-02-07 03:12:08 +00:00
Takashi Kajinami cfdbc26529 pre-commit: Integrate bandit
We also remove these unnecessary linter dependencies from
test-requirements.txt.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I36a6469231a8ce78f06c9b858d35c161f4d22799
2024-02-07 12:03:18 +09:00
yangyawei 6da7341050 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: I7482b0cfa02e0ac5dfb9813e1eb7c4e4d032b8ac
2021-06-07 16:51:48 +08:00
wu.shiming c083fe9790 Remove lower-constraints remnants
These were missed in change: Ice8c48ed23626538c9a9311a4392d18a3a795b07

Change-Id: Ie0396e889cd9ae37f1330adb7e6906f128b3270a
2021-02-19 14:57:06 +08:00
Zuul e56daeda1a Merge "Use TOX_CONSTRAINTS_FILE" 2021-01-14 13:07:03 +00:00
Hervé Beraud 57cc918a06 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: Ia5b237aa59f1c07165698b0d5edb73287d990305
2020-11-04 10:50:14 +01:00
Hervé Beraud f67c3bad2f 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: Ie0678a020707e1d906f487c709d64447d1eee905
2020-11-04 10:04:05 +01:00
Hervé Beraud f8cd4689e9 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: I5190044fed75d4c68e9d2686d9ab67b2afa0f9e0
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 10:42:28 +02:00
Sean McGinnis 3a818cd152
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: I49122f9d82688c557424a1c62d4fc207872f6436
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:50 -05:00
Andreas Jaeger 4838541e98 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: I76369aad2778418182eab7c3eaf331b8d6b8fb1d
2020-04-02 14:59:15 +02:00
Hervé Beraud 57cfce71db [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: I700fe8837312c5c9d88dcdd073389f81a1d874bd
Sem-Ver: api-break
2020-02-06 10:25:49 +01:00
Zuul 8769b65571 Merge "tox: Trivial cleanup" 2020-01-28 15:20:42 +00:00
caoyuan edcb44e957 tox: Trivial cleanup
move 'basepython' to the top-level 'testenv'

Change-Id: I5bf3334da567eb480d573ccc1cfe62ae13bdc2a2
2019-12-23 13:52:08 +00:00
Stephen Finucane d18eb6c44a tox: Add missing deps for 'releasenotes' job
This was missed in change Ice407c712b5438b06c4f439c73946640a0c5a86c.

Change-Id: I9bf7f11dc2779d94c63e5d311072a6fecfb4093d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-12-17 16:29:28 +00:00
caoyuan 8a37087388 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: Ied545a35429a87dc32b746ed54595311d903fea2
2019-10-24 14:52:46 +08:00
pengyuesheng 0c8facb24b Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I3b54f4034c1fa24c016d381d6a48f2d85a0c290d
2019-09-26 14:05:39 +08:00
Zuul cf35fec00a Merge "Move doc related modules to doc/requirements.txt" 2019-07-11 13:41:22 +00:00
Corey Bryant 6c234d498c 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: I07f16ead91bc6f8192d8631fe6eec7240b8d09a1
Story: #2005924
Task: #34234
2019-07-05 15:00:15 -04:00
caoyuan f35e099910 Move doc related modules to doc/requirements.txt
Change-Id: Ice407c712b5438b06c4f439c73946640a0c5a86c
2019-07-06 00:52:54 +08:00
jacky06 8425d85fd8 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with
their opendev.org counterparts.

Change-Id: I64347cfbd447605609dbe8d3628672776136d3ef
Closes-Bug: #1825934
2019-04-23 05:34:29 +00:00
Vu Cong Tuan 8d49f91349 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: Id762418616487dfb0955675b7c50085b48307879
2018-07-03 16:05:38 +07:00
Doug Hellmann 055d347c0f 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: I98b578898a34f94bbe8de7bb02cd2c94626eaac7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Kenneth Giusti 05f2456cff Remove stale pip-missing-reqs and pypy tox tests
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: I38501c409d46a9ad400d55c51934660992e586d8
2018-05-02 11:33:20 -04:00
Doug Hellmann fa444a8bd7 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: I2ac4c36cf0d3786da9bb35abf28c039da7b8aa1e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:04:30 -04:00
Doug Hellmann a3ee768864 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: I161c55335b8fa6a57164bfadbc7be0adb6fed33b
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:48 -04:00
ChangBo Guo(gcb) 4dde5f3cb2 Add bandit to pep8 job
Add the bandit security scanner to the pep8 job.
* skip B314,B405
* Don't use '/temp/file'

Change-Id: I5ae66767178d037d312eb2ab0374dd6f137ecc7b
2017-12-12 14:42:13 +08:00
Andreas Jaeger 80ec3ef091 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: I49dfbdcf72f0322b9b20ac2294e57556a4ef6441
2017-12-02 19:27:48 +01:00
Andreas Jaeger 84e7ef93d4 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: I81d832dfde5178ebc0f7a6faafe7427854cbaed4
2017-12-01 09:50:05 +01:00
Eric Brown 56f52d7943 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: If1d1c71752a21026ed04bfb9f598a80fe8ce4405
2017-01-17 10:32:53 -08:00
Dirk Mueller 5321b53c89 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 oslo.reports.

Change-Id: I7124fd1b8fbb58b80c2ee9ae9d323afc0137e230
2016-12-20 14:39:01 +11:00
ChangBo Guo(gcb) 0976c28108 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: I224fe780872604085e543dd94e6e161cc227acc7
2016-11-05 20:15:18 +08:00
ChangBo Guo(gcb) 0565210f33 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: If96e1465ce2c00140a52fe28b65c34c7fa0f16e3
2016-07-12 16:46:12 +08:00
ChangBo Guo(gcb) 71ce8f5f30 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: I0ee8441d1253028b1dcd7bcb9389e92577dc5224
2016-05-11 20:41:54 +08:00
Davanum Srinivas bce5907704 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: I12435cf9688866a78b368c17ef5cfb9fcae86a79
2015-11-16 00:37:39 +00:00
Ronald Bradford 0ea635df69 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: I5329955ee1e5101fe62012c6cae91e39f0fc96e4
2015-10-01 15:33:18 +00:00
Davanum Srinivas 2238ebef32 Add tox target to find missing requirements
Change-Id: I3d56e5940c0198ec7b93aff064119f471dc18481
2015-06-26 07:31:06 -04:00
Solly Ross 01d69037e0 exported from oslo-incubator by graduate.sh 2015-06-03 12:49:50 -04:00