Commit Graph

45 Commits

Author SHA1 Message Date
Takashi Kajinami 4ceb5931aa Display coverage report
... for easy reference. Also make sure old data is purged.

Change-Id: Ifc487ea4b45ee898066ac9c66820c3f14e5d37da
2024-02-07 12:17:26 +09:00
Stephen Finucane 7f90f0cabd pre-commit: Integrate bandit
We also remove these unnecessary linter dependencies from
test-requirements.txt.

Change-Id: I6c3c5fcc329c46054a144557a79c4b3c6ca383b5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2024-01-03 12:12:19 +00:00
Takashi Kajinami 712ec48ab4 bandit: Disable B411
Bandit 1.7.6 now always raises B411 error when xmlrpc is imported.
The error can't be resolved even if we make the suggested change in
code. Let's disable the check for now to unblock gate.

Change-Id: I515af75af2b790eaee52692abebae2fa8387aed1
2023-12-21 22:23:22 +09:00
Joel Capitao a0ba2d777c Remove extra spaces in tox.ini
'setenv' and 'commands' should be at the same level of indentation
otherwise it breaks some build tooling as we are hitting in
RDO.

Change-Id: Ib6ac2e4b62aa26dc9d5c5ff97844f0e7b61386e5
2023-06-28 09:50:34 +02:00
Hervé Beraud b4be3a4603 Fix issues related to tox4
Related to https://lists.openstack.org/pipermail/openstack-discuss/2023-February/032247.html

Change-Id: Ie97378271aeb3f98195fbe8433723ea556e9cf9e
2023-02-17 13:15:12 +00:00
Zuul 5f2798e645 Merge "Remove lower-constraints remnants" 2021-04-16 12:24:59 +00:00
Zuul 66333c01a1 Merge "Use TOX_CONSTRAINTS_FILE" 2021-04-16 12:07:08 +00:00
wu.shiming a1f90ab1dc Remove lower-constraints remnants
These were missed in change: Ie53b809ab031525958b58730a12cb37d0bdf5c82

Change-Id: I2c9051126b4a42706bdce025b07706e4689a09ae
2021-02-19 15:05:19 +08:00
Hervé Beraud d20434cf3a 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: If7d6b78ce39b9d629095ed461f0cb154ed6ed9bf
2021-01-14 10:56:36 +01:00
Hervé Beraud 523fa45f64 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: Iaa02d12b545597a3b064f320ee33253300a5de1b
2020-11-04 10:04:41 +01:00
Hervé Beraud b828910188 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: I8c993d6ffaf869f67713bbbde8632a0143ed0c72
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 12:33:14 +02:00
Sean McGinnis e5e55b378f
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: I72444ae863915b98182a6badeef94ea9109036ab
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:51 -05:00
Andreas Jaeger 5ee9b7bf54 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: I94aabb5b1ef43e8f0a5850620afce91ae0755e97
2020-04-02 15:06:39 +02:00
Daniel Bengtsson c49994358a Update the minversion parameter.
Update the minversion parameter to use the python -m pip to install
python packages:

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

It's recommend to use this.

Change-Id: I1560635d3d76edf5ca4c426e7e13b228ac4f8c63
2020-02-13 11:04:35 +01:00
Hervé Beraud 9e4adf56b2 [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: Icc43428c885853007a6ee9fc4acaf079f6349619
2020-02-03 18:34:40 +01:00
Hervé Beraud 350bc40cb4 tox: Trivial cleanup
Use the default 'install_command'

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

Change-Id: Ib753a86e3d8edbe2fe4ecea83adba173f2613ca1
2019-12-20 11:10:47 +01:00
caoyuan fa87c3cdec 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: Iace9acb9bcbc29760de5b5c12b0a92353edde80e
2019-10-24 15:06:57 +08:00
Corey Bryant fa399b6d45 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: Id16ecd5b183c8058e1e8f34d881e523f5dc1d7ee
Story: #2005924
Task: #34234
2019-07-05 15:01:51 -04:00
Stephen Finucane 5dff1692a0 Resolve some issue with tox.ini, setup.cfg
- Use constraints for documentation targets
- Indicate support for Python 3.7
- Remove remnants of the usage of 'build_sphinx'

Change-Id: I176384504dc5491abb7b4d417763df125cc398f1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-05-21 09:45:21 +01:00
Ghanshyam Mann 36bcfc7116 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: I150c9bd560d0a297830737b993cc5e76bb1af8f5
2019-05-21 08:26:45 +00:00
jacky06 28da3afa68 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Ic30ef00d39126d5a6f00a29893ed760bf4e753c6
Closes-Bug: #1825936
2019-05-03 20:33:13 +00:00
Vu Cong Tuan dc592c68e3 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: I78a93c29f2c9033bba1859c79d826578d72257f5
2018-07-04 08:23:05 +07:00
Doug Hellmann 988a758be6 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: I671e0108b2cafd14e10184f68d38172519075f22
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Kenneth Giusti 65d92ce07e Remove stale pip-missing-reqs tox test
pip_missing_reqs tool is no longer maintained and has broken with
release 10 of pip.

Also removes unused pypy environment.

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

Change-Id: I9dab01964acf41c1da5e748f81ab69ef932fcdf4
2018-05-02 10:53:27 -04:00
Doug Hellmann 3df92be20c 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: I19923d160901a96ee175192d23d09ad9800bcc57
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:05:56 -04:00
Doug Hellmann 7d03e2d7e4 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: I1a851389a2bb2f445dac922fab2d151ec23b8c6d
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:54 -04:00
ZhongShengping 1b1abbedc3 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: I84da413225e9410be890abf32a22e4409100d7fa
2018-03-02 10:29:49 +08:00
ChangBo Guo(gcb) 019c7d5744 Add bandit to pep8 job
Add the bandit security scanner to the pep8 job.

Change-Id: I1bd306757a04e6c81b2717c656f71a9e6c9d0d32
2017-12-07 13:55:56 +08:00
Andreas Jaeger 50af68754a 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: If154b4806e4f7d45718713663da1c37a0bc315e0
2017-12-02 19:29:58 +01:00
Andreas Jaeger 029a8e7fe8 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: Ife9af5f7e68f5f7b25ff1b210e457cd4283146d2
2017-12-01 09:51:57 +01:00
Eric Brown 4fdec1b120 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: Iac4c303d3d064758c918f38f77f7a45cc51691a6
2017-01-17 10:34:52 -08:00
Tony Breeds 6aa05a3c36 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.serialization.

Change-Id: If02798738dd0293ede4e3d6939e6d5cf6b0182ec
2016-12-20 14:36:50 +11:00
ChangBo Guo(gcb) ba8abbada8 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: Ia8a357ce4a42176b9bc46a715aef7158310c2cf0
2016-11-03 20:44:36 +08:00
xianming.mao d8e6057b31 Drop H803 in flake8 ignore list
In hacking >=0.10.0,there is not H803.We should remove it.

Change-Id: I4738aba1d02ad1404944a326f1ce5538dd1edc7a
2016-08-03 14:08:31 +08:00
ChangBo Guo(gcb) aa0e48021a 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: I6f67834cc0f6f204aba2457f71e788d1fafd2640
2016-07-12 16:53:18 +08:00
ChangBo Guo(gcb) 0dcd927163 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: Id3c23fb9f05c50943e1c83be0f0ae577cf762e18
2016-05-11 20:43:42 +08:00
Davanum Srinivas 4f647c7780 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: I741b7cae51555bc5f8d79a018598d1dccbba4459
2015-11-16 00:47:09 +00:00
Ronald Bradford cef5b11996 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: If0f21e37a5d9b43c0f9491d306167d2656c137f9
2015-10-08 17:22:20 -04:00
Davanum Srinivas 17bb701f3f Add tox target to find missing requirements
Change-Id: If1bdbe08091e72a2fc15a5867a7ba6358bfd2e66
2015-06-27 16:24:55 -04:00
Davanum Srinivas 42b355f10d Advertise support for Python3.4 / Remove support for Python 3.3
Change-Id: Ic41849eacc99e407a461dbe46b180bee52f7fab7
2015-05-10 19:21:50 -04:00
James Carey 437eaf8db5 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: Ia182d834cf3156f16f851ee7524e1713dd47425d
2014-12-11 22:59:54 +00:00
Jeremy Stanley 9cf6294fdf Work toward Python 3.4 support and testing
Change-Id: I8cc372429540dd5bbe65d57ac7e8764823c268a9
2014-09-03 19:04:59 +00:00
Davanum Srinivas 94bff36bdf Fix docs build to run properly
Change-Id: I7f684bc48c5ce913a5799f78c80bda459cf35f65
2014-08-21 11:47:00 +00:00
Ben Nemec af8fafcf34 Get unit tests passing 2014-07-14 21:36:11 +00:00
Ben Nemec 7e806ce1fe exported from oslo-incubator by graduate.sh 2014-07-14 17:54:12 +00:00