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: I382aa79f7357a86af11783f59e0f1680d5bed8d0
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')
Change-Id: I9042c3d9ed48e26b541e22bb4c0dd272d48e3965
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: Ie84d18b0bcc2a33587bd72204c0eb3dad687be7e
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: I10eafa030e4ab97f55d17b2497fa87492a18336e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
We no longer need to support 3.4 and 3.5 is covered by the default
debug environment.
Change-Id: I1ca069ea14c619bf64101c1c84bd1b4c3a2d2691
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: I07f2186cb7771b3a83ccc4ce9ba3b79253c4757c
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: Ib7f87445039e8e71edbe52b985c632bc4da29174
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
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: Ie77e688e08aba4df73d127fab024de3879766840
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 debtcollector.
Change-Id: Ie1e79f7bd0cb2a6b20d0485e12cd05522c2a0f9f
The release management team have indicated this is their preferred way
to collect release notes in future.
Closes-Bug: #1634356
Change-Id: Ia8a357ce4a42176b9bc46a715aef7158310c2cf0
There is not this directory in debtcollector,so we should drop it
for improving searching efficiency.
Change-Id: Icbdd997b525708896c88a0a207f92ff958bae3ab
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 and removes py33 venv.
Change-Id: I849e9df878b18f89424c846511bc131644ccae48
Once we add debug testenv, we can use "tox -e debug -- --debug"
to debug test cases when tox is running.
Change-Id: Id4372ca37664735af54d8c78b70a8668008df4d6
Python 3.3/2.6 support would be dropped by
Infra team from mitaka,CI would no longer be testing it,
so projects should drop it also.
Change-Id: I69d9f971deb8cd124a96f7c85d007c61d953b6c5
* 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: I7e45a5aba221e9b2204264f5e88b8ef1f6bd04e3
Also moves doc8 to test-requirements.txt which should
be its more official home instead of being in tox.ini
Change-Id: If3836b211dbb47fa6bec36ac43367139bb939243
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: Ib302d7386e0b55d869e528b95fb7bb6b27db3b97
To make it possible for easy usage of the message generating
formats that debtcollector uses, allow users to call into a
helper function that can be used to deprecate arbitrary things.
Closes-Bug: 1478676
Change-Id: I4d5b8fe44150ce2d6d5418a9f4e13812e6b558ce
This ensures that sphinx doc tests are ran and validated
and also runs doc8 to ensure style checks are done and adjusts
some of the current examples and code to fix found issues.
Change-Id: I618d44df1e153dd0156110a2657e2540908e9225