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: I593196cf0d099fe1dcc3a6298fd6cc6b7a883ea2
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: Ie160ee9faca27890e5fdcd21b1212d6c93cde735
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:
F601 dictionary key 'cr_to_rp' repeated with different values
F841 local variable 'excep' is assigned to but never used
F821 undefined name 'excep'
E305 expected 2 blank lines after class or function definition, found 1
E731 do not assign a lambda expression, use a def
Blacklist:
W504 line break after binary operator
Update hacking extension for newer flake8 version.
Change-Id: I9f0d7b166e285091111c42fe978d29d7dd3bf5db
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: I17588a5702fa1f9429dd6bc2d1a8c4ad9e90c539
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: I390f8f7add7530f1442f66816389202e3ed21f05
As it was announced [1] global bindep-fallback.txt was removed and now
projects need to have a local bindep.txt to be able to install binary
dependencies for testing.
We use lxml which requires a number of underlying packages.
[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html
Change-Id: Ie635fa5d613cb89f8de8c8c8d5b119621acb926d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
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: Iea425a8583f7396cc4e9d6964f3efa9875dc59ac
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: I1c8016a76062f21c7413da9fc3d422677a40712e
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.
Because flake8 now runs under python 3 there is no built-in name
'file'. Instead we can use the same symbols from the io module to
build the spec for mocking out the open() call. The old version of
that code that used to only run under python 3 used a private version
of the io module, so that is also corrected.
Change-Id: I2491e65736d2c79f1134eec6371967c39873891b
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
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: Ie6b0b270193f4e8eb20fd2d98f315a9dc2abe05b
Depends-On: https://review.openstack.org/555034
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: I2b4bf1e1c970afea899521e3cab08a817a186782
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: I0e3485e2cab064db3f8faf85c406c83720fb0242
Since we have removed log translations completely, we should also add
hacking rule to prevent future mistakes
Change-Id: I8df524e23ab072d198cbc256e8018671e5f32764
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: I067d84b89167c5e84373cb0656348d3e7a573a45
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.vmware.
Change-Id: I6d20d90191f5b0e9dce17affd7aca40081cf7cc7
Soon the gate jobs will support Python 3.5. This patch adds the tox
virtualenv in preparation for the move from 3.4 to 3.5.
Change-Id: I8eb0289b4ce4cfbc47ad79affa7af6ea3dac73d0
Run security linter bandit as part of pep8. Pep8 is the usual linter
target and thus let's use it there instead of starting another node
for this short-running job.
Also reduced the lines of context from 5 to 3 since it shouldn't
matter to most.
Change-Id: I54a4fccebb375517f9cd129f62f8f0c795b6edcc
The bandit.yaml is only necessary for advanced tweaking. None of
which is necessary for oslo_vmware.
Change-Id: If06c64e0b5278a000d02c34fe10288a67182357b
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.
Change-Id: I9dd91b4b58e84c9f73b1e662aa24a779629a8a37
Closes-bug: #1489059
* Remove support for python 2.6
* 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: Iff527b5e96cd2f2f1b3fc56f65bb984c37d8b276
The existing bandit.yaml was based on 0.10.1 version of bandit.
Commit I9504c44ac575b47b256496e833dd53a9dce113d2 adopts version
0.13.2 of bandit. As a result, the bandit.yaml needs to be synced
with the standard version.
Also, with the newest bandit, some #nosec tags can be removed.
Change-Id: I503cd33d401b104aa502e7909f949c438a6248e6
These changes were necessary:
- Move bandit dependency from test-requirements-bandit.txt to
test-requirements.txt
- Only print high and medium severity errors (-ll)
- Rename blacklist_functions to proper plugin name of
blacklist_calls
Change-Id: Ibf2a16e3fc62aadc995c70b5dfe2258f1cf23f85
Replace suds dependency with suds-jurko on Python 2. It was already used
on Python 3.
suds-jurko is actively maintained (latest commit in december 2014) and
supports Python 3, whereas suds doesn't seem to be maintained anymore
(last release in 2010).
suds-jurko is a drop-in replacement for suds, both packages provide the
same Python module.
This change removes requirements-py3.txt because they are no more Python
3 specific dependencies.
It also fixes a bug in packaging: currently, oslo.vmware provides a
single wheel package for Python 2 and Python 3 whereas dependencies are
different. suds is incompatible with Python 3 and so the oslo.vmware
wheel package cannot be installed on Python 3.
requirements-py3.txt contained oslo.serialization and httplib2
dependencies. These dependencies were removed from requirements.txt by
the commit 6d8594ae519e2dfa116f84fb126e40a058473754,
requirements-py3.txt wasn't updated.
Update py33 and py34 test environments in tox.ini to use
requirements.txt instead of requirements-py3.txt.
Change-Id: I699c65e4abd607ea6f377d86c45fd609569f3c2b
We do not run a gate job against oslo.vmware using pylint, so move the
dependency out of the synced requirements and into the tox environment
settings instead. If that's no longer useful, we can remove the tox
environment completely.
Change-Id: Ice3527b8d92137d04fd77e7e800a5875fa7fdaf2
Move the public API out of oslo.vmware to oslo_vmware. Retain the ability
to import from the old namespace package for backwards compatibility
for this release cycle.
bp/drop-namespace-packages
Change-Id: I11cf038c3832a7357ed53363d8ccf143daddd2a2