Commit Graph

57 Commits

Author SHA1 Message Date
Zuul f425dd1222 Merge "pre-commit: Integrate doc8 and bandit" 2024-02-21 06:00:36 +00:00
Takashi Kajinami bc00121af4 Switch to coverage command
... to follow the current standard.

Change-Id: Iff63e7a53739df512272d40d17aa52ca96b695b6
2024-02-07 12:41:10 +09:00
Takashi Kajinami cf27f03c79 pre-commit: Integrate doc8 and bandit
We also remove these unnecessary linter dependencies from
test-requirements.txt.

The independent bandit target was removed because it's integrated to
the pep8 target.

Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I094897e6de223753a5a497ec42348e4449132b17
2024-01-30 16:00:04 +09:00
Hervé Beraud b3ba591402 Fix issues related to tox4
Related to https://lists.openstack.org/pipermail/openstack-discuss/2023-February/032247.html

Change-Id: Icf10da4f425ca3ea514eac132f7527165afe31a2
2023-02-17 13:15:45 +00:00
wu.shiming 304ab7f3d6 Remove lower-constraints remnants
These were missed in change: Ia531606ec2526ce1c6169296a8f254342870416d

Change-Id: Ibe9e1aa7501e80844ef4b4e05866c0c3cf310c86
2021-02-19 14:47:37 +08:00
Zuul 7d1b3a88cd Merge "Use py3 as the default runtime for tox" 2021-01-21 18:11:36 +00:00
Hervé Beraud b2cdfef453 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: I5c0161f3c0f75f516678b7e30b9231ce80deb3ee
2020-11-04 10:51:11 +01:00
Hervé Beraud 8b8e0717bf 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: If79bec3c1ae3df62d2af057e748d6110952f9dcc
2020-11-04 10:04:59 +01:00
Hervé Beraud 10ce88ed2b 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: Ib18f38dbec90c62e870307bf22a8b4f193237bce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:26:37 +02:00
Sean McGinnis bdb2de8653
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: I416cb6db21410a2a341d3372357ffbf4fe2de96f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:51 -05:00
Andreas Jaeger b7dc0d72c9 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: I0564dc6c961a55387a430f095ed83b392a81c119
2020-04-02 15:07:51 +02:00
Daniel Bengtsson ad1d88f895 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. Remove the useless install_command
parameter.

Change-Id: Idfc08651ce699fbf5800c8a427aeb4c607dd39d7
2020-03-03 10:19:45 +01:00
Hervé Beraud 65e2aa81b8 [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: I3ea32bcc39d887d296d70b080a90c536debd91b3
2020-02-03 18:35:41 +01:00
Hervé Beraud 9895587136 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: I255de2a755b7783f20925d8ca4de6e34e5aee36b
2020-01-08 20:11:27 +01:00
caoyuan 4a78c31863 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: I7b4cc4b171e5605f2967378e9949d31ac0e1290c
2019-10-25 23:26:01 +08:00
pengyuesheng 0c323b4f0a Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I380f1828932078620dd7f78ccf9ab9c50b67e2e1
2019-09-26 14:00:21 +08:00
caoyuan d9ffc59031 Move doc related modules to doc/requirements.txt
Change-Id: I995f7c4e0152a19d2ae2890d6940419f30638444
2019-08-24 09:49:33 +08:00
Corey Bryant d349cb974a 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: I6b399a382e18905aca344791bda18bd9ac98c049
Story: #2005924
Task: #34234
2019-07-05 15:02:28 -04:00
Zuul e99a2639eb Merge "Dropping the py35 testing" 2019-05-29 13:56:08 +00:00
Ben Nemec b85818a418 Stop using pbr to build docs
We should be calling sphinx-build directly now.

Change-Id: I030d79a9fb7639553a9f469b54e1888aa62bcef5
2019-05-22 15:31:35 +00:00
jacky06 539885155a Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I4e964925d5a024545fc99f7fddbea3d9605b30d3
2019-04-30 13:48:51 +08:00
Ghanshyam Mann f16329aa62 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: I578831a20138ecb2746bf61d6dce85e6f7c4b47a
2019-04-15 18:28:57 +00:00
ZhijunWei 671cbd6024 Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I8bb814f8db8c87ba6b757be482d79d40548a137d
2019-02-13 17:08:38 +08:00
Vu Cong Tuan 274aac47b7 Remove unnecessary pyNN testenv
The pyNN factors automatically set basepython
unless explicitly requested otherwise.
Therefore, "testenv:py35" and "testenv:py27" sections
are unnecessary and should be removed.

Change-Id: I8ffed1b55324ebcec12a3f612a85de76ef362d1d
2018-07-04 08:40:36 +07:00
Vu Cong Tuan ebad161c89 Convert oslo.service to using stestr
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.service. Let's switch to using stestr, too!
Everyone's doing it...
This patch follows [2] in oslo.policy

[0] d5a3c58f71
[1] 897823fbd6
[2] https://review.openstack.org/#/c/579295/

Change-Id: Ia82a17fe26b41730c8c323819591523d66a8cb36
2018-07-04 08:39:21 +07:00
Doug Hellmann 8ba8b0335a 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: Ia93332b451988a9f84a38a5decbb019781ec0351
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Zane Bitter 61fad310f6 tox.ini: Use python3.5 in py35 environment
When stuff fails it tends to fail in different ways on different
versions of python. It's very unhelpful if 'tox -epy35' means a
different thing on every developer's machine, which is what tends to
happen if you use python3 as the basepython.

Change-Id: I4f92cd6bb22e36b1c49436eca1849712682aec68
2018-05-07 20:38:01 -04:00
Zuul ccbc263e2e Merge "Remove stale pip-missing-reqs tox test" 2018-05-05 13:21:16 +00:00
Kenneth Giusti 44bd20b8ab 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: Ifbbc926ca9412340c2179446a99a79c6acb1f675
2018-05-02 11:08:42 -04:00
Doug Hellmann 9f79e869c9 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: Ie3cf59a181b8ccd2ccbaf88c70a56cc35de178d2
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-18 11:47:47 -04:00
Doug Hellmann b3a42f0aa2 move doc8 test to pep8 job
Run the doc8 style checks with the pep8 job instead of the unit test job.

Change-Id: I094ccae8b76a1268b288812bd478797cfb9d0f4d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:07:16 -04:00
Doug Hellmann bd96a33f79 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: Ica596235831a51cb02afb46c5e1a167a32cf6bf5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:07:10 -04:00
Andreas Jaeger 5c9253bb42 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: Icce796df1020ba040d5531fe2ccacd00bfd4cf66
2017-12-02 19:29:33 +01:00
Andreas Jaeger 101622c7b2 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: I3a687abd2255f0f3a4e3cd362bf5249ab6908621
2017-12-01 09:53:06 +01:00
Pavlo Shchelokovskyy de7615e768 Fix bandit scan and make it voting
This patch removes legacy bandit.yaml configuration file
and makes the full bandit scan voting as part of pep8 job.

A single low severity bandit scan violation was found in the
process and corresponding line is now skipped as false positive.

Change-Id: I0d432e4621bd89b1e6e74fc2005971d9dea794f9
Closes-Bug: #1729308
2017-11-01 15:01:25 +02:00
Eric Brown 087d0c76b5 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: I0f71ce22b44cdb59340f4101c60c507367842603
2017-01-17 10:37:12 -08:00
Jenkins 7076774bb2 Merge "Add Constraints support" 2016-12-21 08:51:55 +00:00
Tony Breeds c113cfb139 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.service.

Change-Id: I3cad0b8c3d4909b424358cf2f0bc20f80882cb33
2016-12-20 14:23:59 +11:00
gecong1973 5077f4006f Delete python bytecode file
This patch delete python bytecode including pyo
before every test run

Change-Id: I17056d291980e0b249bfcc82d64af733948fc983
2016-10-18 08:43:51 +08:00
Kirill Bespalov 39760084ae Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: I0250a698b789568a86705be585fc1b01c831aed0
2016-06-30 10:02:49 +00:00
ChangBo Guo(gcb) 43343b4445 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: Ia66d614e14fbda77df022be339eb9efb12d7af59
2016-05-11 20:46:45 +08:00
Elena Ezhova e36843c2be Run sslutils and wsgi tests for python3
This change allows to execute all tests on python 3.
TestWSGIServerWithSSL were skipped on python 3 due to bug 1482633.

Change-Id: I5ae9e50c8160da2cd6f1c3bed6600867845bbe23
Related-Bug: #1482633
2015-12-22 13:26:40 +03:00
sonu.kumar 4204fe0d15 Delete python bytecode before every test run
Closes-Bug: #1368661

Change-Id: Ibba56701f91094d68e03459784ec6596ab22ee9c
2015-12-09 12:10:39 +05:30
Elena Ezhova 1c763f2285 Add Bandit to tox for security static analysis
Bandit is a tool designed to find common security issues in
Python code. This change adds a bandit target to tox.ini.

The config file bandit.yaml was generated using bandit-config-generator

Run bandit:
    tox -e bandit

Change-Id: I3bd64e1e58d4dc460ce869c50818e9913fe1b9b8
2015-12-01 16:10:15 +03:00
Davanum Srinivas 7da61b9862 cleanup tox.ini
* 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: I334c8db354f212f3f990f3ba59f2aa46355dae74
2015-11-16 00:43:28 +00:00
Marian Horban af808b49c5 Remove py26 env from test list
Change-Id: Ic1aa10405eadaee73d05e2d3ea4263882f5f0b70
2015-10-26 11:20:05 -04:00
Joshua Harlow 91a92f0db1 Add doc8 to py27 tox env and fix raised issues
Fixes a bunch of long lines and ensures that doc8
will not complain about any future issues by adding it
to the commands performed during running the py27 tox
environment.

Change-Id: I9ae2f2a05a408dbfe105bf38ea0ae235701fbe0e
2015-10-15 16:54:33 -07:00
Ronald Bradford fddca3b272 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: I966bf06550c20d6977fff659264a5a7d021b260f
2015-10-01 19:48:34 +00:00
Marian Horban 6dd3ad50b6 Added wsgi functionality
Because of copy-pasted wsgi functionality in projects(nova, cinder,
glance, etc.) it is added to oslo.service with perspective to remove
it from other projects.
DocImpact

Change-Id: If8840168f10cc3561f4f01e6d456d6b4fd1de8b5
2015-08-19 12:01:40 +00:00
Marian Horban e2a6183bcd Added newline at end of file
Newline character added to the end of tox.ini file

Change-Id: Ia82dfc92a7b66e7194f1d8946ed642970cd3c000
2015-07-30 07:59:51 -04:00