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: I045fa1cd7932d960e1cf49b2c335c7acdeba0b46
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
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.
In documentation zuul job graphviz package ('dot' command) is needed.
Without that the job fails with:
dot command 'dot' cannot be run (needed for graphviz output),
check the graphviz_dot setting
[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html
Change-Id: I5efddfc72e9dc0dd1b8b9e1e37708e1d30ef3c39
The pyNN factors automatically set basepython unless explicitly requested otherwise.
Therefore, "testenv:py27" section are unnecessary and should be removed
as the recommendation from Stephen in [1]
[1] https://review.openstack.org/#/c/580250/3/tox.ini@15
Change-Id: I07428041f70c68520c451589fc65cb586741b69b
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: I1b5bd8a53d0f93b99dd60fd5711a60f1135bcc4c
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.
Decode subprocess output so it has the right type under python 3.
Change-Id: Id2df5439fa6e788199bec4ac7c98c56347053621
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: Ia540b70e648d585aa0de017f72ceb96214b67e27
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: Id469e90d53d52f13b596b71904604ec073289e88
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: Idf400c13258ecbe0e986a31fd747ab9ba42d25ed
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: Iabc08e643c5978b486d966b824b70ac92b45b4cc
Add the bandit security scanner to the pep8 job.
Change-Id: I4fa14f3c42f064b6ec58e1f3a3cde22ad031ac7a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
The documentation jobs now look for requirements in
doc/requirements.txt and do not use tox for release notes. Move the
dependency list from setup.cfg to the new file and update tox.ini so
the developer experience is consistent with what the CI system does.
Change-Id: I739c9eba21d1b9a680d6b0e9cc6a4cbaca56e543
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
stevedore is a library that is used outside of OpenStack, too. Having
a build requirement that needs something OpenStack specific makes
life in cases (eg. for downstream packagers) more difficult.
So let's make openstackdocstheme an optional requirement.
Change-Id: Ic8cc577e617e5da699f9dc43830183005bd2ee66
The gating on python 3.4 is restricted to <= Mitaka. This is due
to the change from Ubuntu Trusty to Xenial, where only python3.5
is available. There is no need to continue to keep these settings.
Change-Id: I8899429c4bdbc723c448624be49cc27343798f25
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 stevedore.
Change-Id: I7a1285a2c3882b02987bfa95950689f5282aa407
The release management team have indicated this is their preferred way
to collect release notes in future.
Closes-Bug: #1634356
Change-Id: Idce0284b62602bfd51e64784e29739092ca13df3
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: I13d2453d9bd15ca3320968aa30f0fe9db13d717d
* Remove install_command : We can just use the
default, we don't need to override
* Remove requirements.txt from deps, as this is
already added automatically
Change-Id: I29b011a5dd3c64433b4a09ef1cf27b52f09e7d54
Reduce the number of environments run by default when no environments
are specified on the command line. This does not remove support for
these versions of python or alternate interpreters.
Change-Id: I07f7e972da6f928920beea555c7b7d2201d7e8a8
We have CI for 2.6, 2.7, 3.4. So make sure
all references to other versions are removed and
all 3 versions above are correctly mentioned where
required.
Make sure we specify 3.4 everywhere needed
Change-Id: I2c90bccfc7495bf8197319196a12b2a8bd0519f1
This patch moves all unit tests to use
testr as the test runner. This means all
tests need to be subclassed from unittest
to be discovered by testr
Change-Id: I9b0e782be87ea2b5db72b56ddad1d239a83e9ee3
Closes-Bug: #1330204
Move all test dependencies to test-requirements.txt and update
tox.ini to use that and the main requirements file to build the
virtualenv for testing. Remove redundant references to the different
requirements lists in other tox environment stanzas.
Change-Id: I1ff094778369ebfed567ebbb433ef487066f042a
Update URLs in the documentation for the source and
bug tracker.
Add a .gitreview file to make reviews work.
Change the "style" tox env to "pep8" to be consistent with
the check job expectations.
Change-Id: I5dd1e157e11ef597dd22ab2e3f5d1219f0489a7e
Tox passes --pre to pip, which means we get pre-release
versions of stuff. That breaks the docs build, but is
just a bad idea anyway, so override the setting so we
don't do it.
Change-Id: Iec89b12a969f34486005e8dc41cb189438b38959
Re-enable the line limit checking in pep8 and then fix the
issues with modules that had long lines.
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>