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: Icd2a9bded756b2bcba1fb7da6abe48503fd9b2d6
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering
Update Sphinx version as well.
Create doc/requirements.txt file and use it, remove docs requirements
from lower-constraints, they are not needed
during install or test but only for docs building.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
Set openstackdocs_auto_name to use 'project' as name.
Depends-On: https://review.opendev.org/728938
Change-Id: Ic3503a8b38e67e50669428b36f6581cb980d687f
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: I0675da8241f60e8699f2aa80b13773d9284cc3ae
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Remove some noise and move 'basepython' to the top-level 'testenv'. Also
use the new-style URL for upper constraints.
Change-Id: I1a5f9bbcad2ef9e4551739900a7e688bfffa0a6c
Signed-off-by: Stephen Finucane <stephenfin@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: Ifae9724565efd8716d8d8d5698edf4a3ff71f3f9
Use openstack-tox-cover template, this runs the cover job
in the check queue only.
Use openstack-lower-constraints-jobs template
Remove jobs that are part of the templates.
Sort list of templates alphabetically.
Fix tox.ini for cover to work.
Change-Id: Id46f74ab4a8f64f7159effc8fa4d552f8217c498
When the TC merged I2637dd714cbb6d38ef8b8dc1083e359207118284 we're
supposed to invoke stestr rather than testr so lets do that
Change-Id: Iba54c6540644d3d4942686b9f1c33fce6d19d431
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: I6cb85818f107513a91a891eb8905f0a9a54dc716
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: I6751b74c5dee149972695258672db0f82787d646
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: Idf28fdf830bf9524df8fbeb684658719bccf4f0a
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: I4b5269fe56c6eba07d4d9044ca8ec3c53758d952
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: Iafae5f3111c968a4ec2adf63e447459f3ccc41ae
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: Idc263504b68bc909fe7c6cd983c27c1fcc384c16
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 oslotest.
Change-Id: I21e2d0555334a1bd7ad8aa37796f599292b30ed0
The release management team have indicated this is their preferred way
to collect release notes in future.
Closes-Bug: #1634356
Change-Id: I3d2e96603238d58ee02ca9b37b3d9dd8f750306d
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: Ifd6a17b8e250f7ff8e36e972e175099044d7146e
* Remove support for python 2.6
* 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: I4f650eaa07624b889a52570e628a21e905f2bd46
This patches remove the six.move call as it's does not move anything
since it relies always on mox3.
Change-Id: Ic59c73abb9b09cb594bf7df4173d7f99f81d526c
Currently translatable messages are not used, so there are no uses
of _.
This will ensure if _ is used in the future pep8 won't assume
it is provided as a builtin, and to be consistent with the rest of
oslo.
Change-Id: I5b840eaf1a55d3df40ed56af19ea7349f167b5a9
tox (lovingly) uses the --pre option with pip. We don't want that, so
override the install_command with a version that doesn't include it.
Change-Id: I0b8e48488d5c138c0aac85df2336b2340d7c59c4
Closes-Bug: #1379998
We had these differences in requirements:
- mox in 2.x vs mox3 in 3.x: mox3 works for 2.x as well, so use it
everywhere, mox3 version bumped to match global-requirements;
- mock in 2.x, absent in 3.x (in stdlib): it's installable on 3.x, so we
can leave it in requirements;
- six in 2.x, absent in 3.x: is directly required by this lib, has been
installed indirectly through hacking.
test-requirements files were identical.
This change allows us to build universal wheels and avoid confusion, see ML:
http://lists.openstack.org/pipermail/openstack-dev/2014-September/044663.html
Change-Id: I8bd2d561bf966c6dc1394a7d29d26f056d162fa9
Add docstrings and sphinx structure to expose them through the developer
docs for the library.
Also add a 'docs' target in tox.ini to make building the documentation
locally easier.
Remove the nearly useless usage.rst file.
Turn on the pbr flag to treat doc build warnings as errors.
Closes-bug: #1329952
Change-Id: I274a4144edf4efe9ed786e220e40003fda6f99e0
Add a test for moxstubout and update all of the python3-related
bits needed so the tests will pass there. Those changes are
based on Julien's work in https://review.openstack.org/#/c/55606
Change-Id: Ie7c41dbfbabfb3bcbd4e181b095aa2cf09345f5c
testr uses anydbm, which defaults to a different type under
python 2.7 and 3.3. The default under 2.7 is no longer available
under 3.3, so without this change running "tox" results in
an error from testr about loading its database. With this
change, the 3.3 tests run first and then 2.7 can read the
database created.
Change-Id: I1a51d228c06af0ea7d3579fcec53d35922292e2d
Need to move the tests back outside of the oslo.test package
because testr complains about importing them from the
wrong place if we don't.
Change-Id: If8e0521dc345f8941f9c7116477549291cf600d2