hacking 3.0.x is really old. Let's bump it to the latest version
available.
This also fixes some errors detected but some rules are excluded now.
See the comments in tox.ini for further details.
Change-Id: I2565e5f5e791dfdd9bbc1890b35c413965d83626
- Python 2 is no longer supported
- setup.py is no longer managed by the global tooling
- Recent pip does not require appropriate order in requirement files
Change-Id: I29e2375b68dc01f6e042717a6da3861cc0bd8f88
The ``CallbacksManager`` class considers, by default, that the events
starting with "before_" and "precommit_" can raise an Exception
(``CallbackFailure``) in case that the callbacks associated to these
methods exit with an error.
However there are some other events (those started with "after_") that
won't generate an exception in case of error. The error will be logged
but the process will continue.
This new functionality adds the possibility of adding any kind of event
and mark is as "cancellable". The ``CallbacksManager`` instance will check
the errors returned by the callback methods and if any of them is marked
as "cancellable", the manager will raise a ``CallbackFailure`` exception,
terminating the process.
In case of being a Neutron worker, for example, the
``oslo_service.service.Services`` class will restart the process again.
Related-Bug: #2036607
Change-Id: Ie1e7be6d70cca957c1b1b6c15b402e8bc6523865
When 'tox -e pep8' was run it didn't run any pylint
checks, let's start doing it.
Fixed issues pylint found, 2.6.0 added two new checkers
[1] that make pep8 validation fail:
- raise-missing-from (W0707)
- super-with-arguments (R1725)
[1] http://pylint.pycqa.org/en/latest/technical_reference/features.html
Change-Id: Ib83f30696269c968f41f9c1131596268a4412658
Switch to openstackdocstheme 2.2.1 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 problems
Update Sphinx version as well.
Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.
Set openstackdocs_auto_name to use 'project' as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
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.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: I477de339e7a2851311a712ff28689ad354ef0229
pycodestyle 2.6.0 has some new errors, fix them.
Also bumped minimum hacking to 3.0.1 so it pulls in
the correct flake8, etc, libraries.
Added basepython directive in tox.ini since local
'tox -e pep8' runs were using python2 otherwise.
Change-Id: I3a9f7c2df5b68a3bad036121c9b10b1c184d261c
Update to newest hacking version, it has only minimal changes and full
support for Python 3.
Python modules related to coding style checks (listed in blacklist.txt in
openstack/requirements repo) are dropped from lower-constraints.txt
as they are not actually used in tests (other than pep8).
Change-Id: Ia005547d7a8353b629f2262f424d7761c45b185f
In hacking 2.0, local-check-factory was removed as it is not compatible
with flake8 3.x and it is advised to use flake8's local plugins [1].
Checks specific to neutron-lib registered via local-check-factory are
converted into flake8's local plugins [2].
Note that neutron_lib.hacking.checks.factory is kept not to break hacking
checks in neutron-lib consumers. They need to be converted into the style
in hacking 2.x in each repository and then we can drop the factory here.
[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-2-0-0
[2] https://flake8.pycqa.org/en/3.7.0/user/configuration.html#using-local-plugins
Change-Id: I90419fe0b385e7bee216a52c1169aba6d6975d56
Neutron uses bandit to detect security issues. This patch adds
bandit to the pep8 gate to automatically lint for security issues
in neutron-lib.
Fixed two B101 errors it spotted.
Change-Id: I39d713d0d230b5ae759daa6bc1be9794e6fe2a32
As neutron-lib is now switched to use stestr to run tests,
os-testr package is not needed in requirements anymore.
Change-Id: Ie424b61233943ce58ccc0ea97610921751c71866
According to Openstack summit session [1] stestr is
maintained project to which all Openstack projects
should migrate.
Let's switch it then.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I430dc5268fb9ef8fcd6e1009f50fb64e32089c37
I don't see it used anywhere, and it certainly is old-fashioned
anyway (pycodestyle is the new name for it)
Change-Id: Ifac041ec765638c3e13f9c031cedfc9b15f1d85d
As part of the docs migration work[0] for Pike we need to switch to use
the openstackdocstheme.
[0]https://review.openstack.org/#/c/472275/
Change-Id: I4ce5550362441f98fc0c399add30a0c7a0b65757
Neutron recently updated their usage of hacking to use
version 0.12 [1] that now contains the hacking check
check_delayed_string_interpolation who's off_by_default
value is initially True (i.e. disabled). This hacking check
is defined in neutron_lib, but hasn't been registered in our
factory and isn't being consumed directly [2].
This patch takes a simple approach to reusing openstack-dev
hacking checks:
- Removes all traces of neutron-lib's version of the check; no one is
using it [2].
- Bumps our version of hacking to use 0.12 so we can use the checks
in that release.
- Enables the check via enabled extensions in tox.ini as neutron did [1].
- Updates our hacking check usage, noting that adopters should
enable the same extensions we do (via tox.ini).
[1] https://review.openstack.org/#/c/394817/
[2] http://codesearch.openstack.org/?q=check_delayed_string_interpolation&i=nope&files=&repos=
Change-Id: Ie9448317855b9cba6092cd0f63b77d26a562a5c9
Release notes for neutron-lib are meant to address neutron
developers and help them identify changes from one release
to another.
Change-Id: I51d2049643d3b35484d07f2f4aad7765f6dac958
This change 'rehomes' model_base.py from neutron.
This is not quite a verbatim copy due to the following differences:
- The field sizes for columns are replaced with the new constants
from neutron_lib/db/constants.py
- The tenant_id deprecation message is adjusted slightly.
- The StandardAttribute table is not included.
We also add some base classes and fixtures for DB unit tests.
Partially Implements: Blueprint neutron-lib
Change-Id: I2087c6f5f66154cdaa4d8fa3d86f5e493f1d24d9
This patch updates our hacking checks as follows:
- Hacking checks are now registered via entry points so
they can be used via flake8 CLI. By default they are disabled.
Hacking check doc string is also updated to support pep8
parsing of check code.
- The existing hacking.checks.factory() is moved to a more
meaningful name; marking as deprecated.
- A private neutron-lib specific hacking check factory is provided
and used in tox.ini.
- A flake8 plugin is provided that supports the ability to use our
hacking check factory functions to enable a pre-existing check
by default.
- Our usage of hacking checks is updated to reflect our consumption
model for adopters.
- Unit tests are provided.
Change-Id: I88dad7f7cce4d4f5af679272f067c3bb4a73803a