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
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>
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>
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
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
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
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
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
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>
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
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>
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>
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>
'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
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
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
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
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
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
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
* 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
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
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
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