Commit Graph

46 Commits

Author SHA1 Message Date
Stephen Finucane 842e5d047c pre-commit: Integrate bandit
We also remove these unnecessary linter dependencies from
test-requirements.txt.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Icf2296c1ad1548ffe8be0610800f1c6c5d33c473
2024-03-29 10:34:19 +09:00
Takashi Kajinami 207541f93c Use upper-constraint in doc generation
Currently doc jobs are broken because the latest sphinx 7.2.0 is not
compatible with the latest release of openstackdocstheme.

This updates the docs/releasenotes target to use the global upper
constraints to avoid that issue.

Change-Id: I8aeae9a380c4560c52bc13abd1745d69845071a0
2023-08-21 09:41:36 +09:00
Hervé Beraud 7725ac941f Fix issues related to tox4
Change-Id: I303f753e47eade9d5de9dad0b3d9cc303f6a0540
2023-02-17 16:31:41 +01:00
Zuul a2e7f5496e Merge "Use py3 as the default runtime for tox" 2021-04-16 14:26:43 +00:00
Daniel Bengtsson 5c806d492b Fix requirements issues
This patch is the merge of 2 current fixes that need to be solved in the
same time. Indeed each issue lock our gates independently.

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

Move flake8 as a pre-commit local target.

The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Co-authored-by: Hervé Beraud <hberaud@redhat.com>
Change-Id: I2f41e05df1cc978821bf7cb6d9a95bf543c7fba3
2021-03-25 11:53:12 +01:00
Hervé Beraud 672919216b 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: I086b5173b45ef5f4ce6691ad33af7903b0fd78e0
2020-11-04 10:49:23 +01:00
Hervé Beraud ea0d1ab10f 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: Ife0711d33bba3fcde65a98be57da462cf8b06625
2020-11-04 10:03:06 +01:00
Hervé Beraud d023c60c74 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: Ifc5ee35d399c628604ec1644eb447936803c45f5
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 11:17:45 +02:00
Sean McGinnis e17e036bab
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: I436529f8db217e9ad899ece05cc3af291198a081
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:50 -05:00
Andreas Jaeger d9718805c1 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove obsolete sections from setup.cfg
- Update classifiers
- Use newer openstackdocstheme version
- Switch to hacking 3.0, fix problems found

Change-Id: I539b00204279c7645ef4a3f804f64a1e7af30f05
2020-04-13 11:16:21 +02:00
Hervé Beraud 0f769d4c9f [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: I8604e1a22d7cb13251e2ef22ef86318ad2de346e
2020-02-03 18:15:43 +01:00
Hervé Beraud c93f92b611 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: I0f7296cfd8586b5b41c7a237561c4d931ee1e3d1
2020-01-08 20:02:20 +01:00
caoyuan 31abe71ff6 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: Ic68b7acf92512255d4e1e3c2e5d3b6ff795e1354
2019-10-24 14:58:33 +08:00
pengyuesheng 02ce849e91 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Iad05ec936af5a4319f82c42e721010e9d543b984
2019-09-23 16:22:59 +08:00
Corey Bryant f1a47b9e6a 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: Ib541de637ecbee664fa281b5920ece2c66055b13
Story: #2005924
Task: #34234
2019-07-05 14:48:43 -04:00
Zuul 7679e2057a Merge "Dropping the py35 testing" 2019-05-28 15:05:30 +00:00
jacky06 f0a9926b11 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I0ab27098deb48de60b4d93cbedf59c1d0aa4f318
2019-04-30 13:45:14 +08:00
Ghanshyam Mann 91e6d7ae18 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: Idfbab7fbd4f69f041dfe88801e4808e45ccde329
2019-04-15 19:00:50 +00:00
Vu Cong Tuan 48ec101f15 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: I9b230222866d41a12713f321cee88da896ba76a1
2018-07-04 08:20:45 +07:00
Doug Hellmann 6e90d28b9b 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: I16855b85149c1e0dc98f12e6380a1d20b857590f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Kenneth Giusti 522a7bfac6 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: I0900ca95d7a5988933edc451bf3b912d9a84840f
2018-05-02 11:26:16 -04:00
Doug Hellmann 2c55731251 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: I1ec3c534cdc0a4850d5873eb5ec2a70701cb4141
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:02:29 -04:00
Doug Hellmann 880f29d72e 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: I477dc48b392c20e93c69464b2b45c21ba7f4805b
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:38 -04:00
Anusree 7280af27d0 pypy is not checked at gate
Change-Id: Ife9b091d92f3fe23bd3b099185d866fc7bfc6e45
2018-03-21 18:21:04 +05:30
ZhongShengping f277b87703 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: I35fb490d34af834182522a856d6ab7e24d0ec678
2018-03-02 10:30:19 +08:00
Andreas Jaeger 87ff8d9636 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: I4f6d6420b62f5da9ca0973314ee0ba1cec9c4384
2017-12-19 11:11:49 +01:00
ChangBo Guo(gcb) e6a09f3ce7 add bandit to pep8 job
Add the bandit security scanner to the pep8 job.

Change-Id: Ib4707b55c190b117410212cef7f5afc789c91583
2017-11-30 11:22:06 +08:00
Tony Breeds fa815cfb2f 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.middleware.

Change-Id: I069e64daf9558147fdab947341411b58770d3506
2016-12-20 14:33:43 +11:00
melissaml edbb4ba465 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: I73178227e44caee792e6f7e4f4ddf4cfb07e096d
2016-11-22 23:32:26 +08:00
Kirill Bespalov 3b0bd79d85 Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: I2fa27beb5d7e2c898ce567dce2add00ccdb54afe
2016-06-30 09:58:08 +00:00
Chaozhe.Chen 332c7f98be Clean up removed hacking rule from [flake8] ignore lists
We bump hacking>=0.10.0, and hacking removed some rules, for
the full list of rules please see [1]. So don't need them any more.

Hacking related commits:
Remove H904 in commit b1fe19ebebe47a36b905d709467f5e82521bbd96
Remove H803 in commit f01ce4fd822546cbd52a0aedc49184bddbfe1b10
Remove H305 in commit 8f1fcbdb9aa4fc61349e5e879153c722195b1233

[1]https://github.com/openstack-dev/hacking/blob/master/setup.cfg#L30

Change-Id: Iac1c3097453c205e17b4894ac28a821b2ccf08b5
2016-02-24 00:36:12 +08:00
Davanum Srinivas 57356dae94 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: Iad4623157750ca3808f5b2adb712814c98d824fa
2015-11-16 00:42:19 +00:00
Ronald Bradford 1c72e1869d 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: I2ee48d5b987cc26fe2de6d538ab278821100b278
2015-10-05 17:23:48 -04:00
Davanum Srinivas e3b7d0e5be Add tox target to find missing requirements
Change-Id: Ib33343c79910e603dcb56357f50ec66a2c6202da
2015-06-26 07:27:55 -04:00
Davanum Srinivas ce1acb4ff7 Advertise support for Python3.4 / Remove support for Python 3.3
Change-Id: Ifa0354af9fa910380125e95c7a96a55b46be1a89
2015-05-10 19:19:11 -04:00
Doug Hellmann 3bc703b823 Move i18n module to a private name
The i18n module for this library is private to the library and should
never be used by outside code. Rename the module to reflect this.

Change-Id: I39149056daeeb27428b938fb9cd7278cd42f2444
2015-01-21 19:48:41 -05:00
Doug Hellmann 8e06ca5bd0 Move files out of the namespace package
Move the public API out of oslo.middleware to oslo_middleware. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.

bp/drop-namespace-packages

Change-Id: If88c65c82b64f096a02f7ec62e019aea4de2f9d3
2015-01-06 13:44:01 -05:00
gordon chung 6824065b81 switch to oslo.context
Change-Id: I348fe06441e751ad1e53cd293f098bc21a445048
2014-12-29 08:57:48 -05:00
Jeremy Stanley a3cd5739eb Work toward Python 3.4 support and testing
Change-Id: I69f453e0e32491cd37d60c978b88d4b35b839d7f
2014-09-03 19:04:52 +00:00
Jenkins fc156ec069 Merge "expose middleware through oslo.middleware" 2014-08-24 16:37:14 +00:00
gordon chung 91943462d7 expose middleware through oslo.middleware
allow middleware to be called through oslo.middleware rather than
through module.

Change-Id: Iee535002a3bed221f85e97fb10528fbb9234dcb1
2014-08-21 17:18:33 -04:00
gordon chung eb2579f8cc add doc generation support
we're missing sphinx requirements that are blocking doc tests. this
patch adds this in so we can pass check

Change-Id: Ieba4da849ce8abea10a3298df23a0b2145a0bd2e
2014-08-15 16:02:25 -04:00
gordon chung 29054411b0 fix pep8 issues 2014-07-22 11:02:16 -04:00
Christian Berendt 3ac4a86fb6 Enable hacking check H305
Hacking check H305 should not be ignored. It's used in other oslo
project.
2014-07-22 15:57:21 +02:00
Gordon Chung a41dedff40 initial oslo.middleware checkin 2014-06-24 18:14:05 -04:00
Gordon Chung 5abab9ed08 exported from oslo-incubator by graduate.sh 2014-06-24 16:49:39 -04:00