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: I0c9ca1f9310820c83667bffa2d1287d3daffccbc
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commithooks.
- 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: Iba1e2ce707051ea393ac559fc51b1f07da1f6ee8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.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: I3f23bf09ef24fe34e128102c34382da98e10f5c1
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: I7d39be84c5c8bd730119220720d2d33cb9e4ef62
Thorough replacement of git.openstack.org URLs with their opendev.org counterparts.
Change-Id: I90c0338f37fb6c8ed3b555b2d9d6b76aff6dad76
Closes-Bug: #1825935
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: Ica0262653e8c18681d049acca6d5920ac38f97e6
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: Iba35cef6449b9c40a820114d59c1c45f56946b8d
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: I931fc5b5c5bd0b746e1600c93897a7551b3f559e
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: I6dae26f75d10c070c3d32460fb4cf47bc41a0896
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: I0acb957501680b85919ca1672a5d8ad751eac5da
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: I275c60c1d5154ee7f2e7637a0cee15a83a7d077f
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.utils.
Change-Id: I612b881da465c96ee8200118f8f2b90ef2f02225
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: I96bd1ee7501905cc6a9cf9299b007dadaeac0d28
Now that the bandit linter runs without a bandit.yaml specified,
it should exclude the tests directory similar to how it did before
in the bandit.yaml.
The reason this has not caused a problem yet is because bandit is
still finding a config bandit.yaml in .tox/pep8/etc/bandit/bandit.yaml.
But in a newer version of bandit this will not be the case.
Change-Id: Ic2d6d5da7083936eb364f56fb23e09b5dbccebae
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 short-running job to enable it.
Change-Id: Id05b3d06fa25e8cf436d67f8aac400e96c7f75cd
With latest bandit version, The bandit.yaml is only necessary
for advanced tweaking. We can just use the defaults.
Change-Id: Ie635370474f5e86d0d6188a52b581f04b14bd484
For now revert this, at a later date we can reapply
this but we need to order this a little differently to
make it work out.
This reverts commit 2abbe1c3b1.
Change-Id: I20f3c5804caf1af698aa0f6397a9953eb9aba829
netifaces is a very heavy requirement especially for
python clients, the code that uses netifaces is called
only in exception paths at least now. So let us move
this requirement to extras to reduce the time taken
to install oslo.utils.
Closes-Bug: #1517069
Change-Id: If3430364e49c1c0b1d9f4937bb67900380662728
Some parts of the code have been annoted with "# nosec" as they made bandit
raise false positives.
Change-Id: I9d8a8ab79e8b5de98e7d291ac132f8971a44216d
* 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: I8fa1a3db7e156d5ee9b62490a63e2ccf0ffdd7f9
Move the public API out of oslo.utils to oslo_utils. Retain the ability
to import from the old namespace package for backwards compatibility for
this release cycle.
bp/drop-namespace-packages
Change-Id: Ic6dd62097399bf75e3d11b4d8a6400971069c415
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: I7b7f96cbece2192432a9b7b6a4355ebf0c868926
Add auto-generated documentation for the public modules in the library
and clean up a bit of the docstrings used.
Change-Id: Id5efa5c413b82e13f1a7ac78c92e39c193f12214