Commit Graph

57 Commits

Author SHA1 Message Date
Zuul a5d8a6fd7c Merge "Remove unused reno from test requirements" 2024-01-29 07:40:00 +00:00
Takashi Kajinami 035463b49b Remove unused reno from test requirements
This library is used only when generating release notes.

Change-Id: Ibca0cb324df8abfddf5bdb3478708dce0f764709
2024-01-28 01:50:24 +09:00
Takashi Kajinami c69701eb73 Bump hacking
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
2024-01-16 16:56:54 +00:00
Takashi Kajinami 27689c9ce5 Cleanup setup.py and requirements
- 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
2024-01-12 17:46:28 +09:00
Rodolfo Alonso Hernandez 08b8c6d33b Add the "cancellable" flag to the ``CallbacksManager`` events
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
2023-09-12 04:32:26 +00:00
Brian Haley e92e98f8c6 Start running pylint for pep8 tests
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
2020-09-17 09:53:01 -04:00
Andreas Jaeger 0836afb94b Switch to newer openstackdocstheme and reno versions
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
2020-05-21 10:22:57 +02:00
Brian Haley 37f0d12ba6 Fix errors found by new pycodestyle
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
2020-05-12 17:24:48 -04:00
Andreas Jaeger a585ca069b Update to hacking 3.0
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
2020-05-06 12:00:23 +02:00
Akihiro Motoki f4f5f1c719 Switch to hacking 2.0
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
2020-03-17 15:31:31 +09:00
Brian Haley b04ea0d031 Blacklist bandit 1.6.0 due to directory exclusion bug
Bandit 1.6.0 introduces a regression[0] with the -x option,
a fix is expected to be included in 1.6.1 soon.

[0] https://github.com/PyCQA/bandit/issues/488
[1] https://github.com/PyCQA/bandit/pull/489

Change-Id: Id29f06b68a95f53ad62bdc597bbb0f12bc4d6a60
2019-05-09 23:10:10 -04:00
zhulingjie 975d6641f4 Update hacking version
Change-Id: I0f018fe963256658682676fcd86520ceae590c75
2019-04-23 01:13:21 +00:00
Brian Haley 7ce2f557c6 Add bandit to pep8 gate
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
2018-06-14 11:38:33 -04:00
Slawek Kaplonski 9ef5e88005 Remove os-testr from test-requirements
As neutron-lib is now switched to use stestr to run tests,
os-testr package is not needed in requirements anymore.

Change-Id: Ie424b61233943ce58ccc0ea97610921751c71866
2018-05-30 21:48:36 +02:00
Slawek Kaplonski e17b6555ac Switch to stestr
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
2018-05-24 11:09:18 -07:00
Boden R 93fb08870f rehome get_deployment_physnet_mtu into plugin utils
While [1] rehomed a build of the neutron.plugin.common.utils into lib,
as per [2] get_deployment_physnet_mtu is intended for public
consumption. This patch rehomes it.

[1] https://review.openstack.org/#/c/532329/
[2] https://review.openstack.org/#/c/549313/5/neutron/plugins/common/_utils.py@23

Change-Id: I73f5e8ad7a1a83392094db846d18964d811b8bb2
2018-04-12 09:48:06 -06:00
melissaml bc16522329 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I2f6d52e61fe9a036a6565883626673d37cd89070
2018-03-27 11:19:28 +08:00
OpenStack Proposal Bot d5b3f2d69a Updated from global requirements
Change-Id: I12458fa7acf18d35a5138219052c871245070976
2018-03-15 07:23:41 +00:00
OpenStack Proposal Bot 48e2c05929 Updated from global requirements
Change-Id: I61c18fb1ddb87ee3ad9792cfaf7114dba867b57d
2018-03-13 07:07:13 +00:00
OpenStack Proposal Bot ec9e38de5a Updated from global requirements
Change-Id: Iabb9d18010153bc7a942514cd1388b3cb26b4c8d
2018-03-10 13:28:37 +00:00
OpenStack Proposal Bot 099696240e Updated from global requirements
Change-Id: Ic4caab6b31a36d9c1f8703544744d1b3a2e675cd
2018-01-24 01:09:24 +00:00
OpenStack Proposal Bot a2ac1e7151 Updated from global requirements
Change-Id: I3c058d2eb77a5e150039cb6e6e554b96fe79a5c1
2018-01-18 03:10:01 +00:00
OpenStack Proposal Bot 772a62e604 Updated from global requirements
Change-Id: I9807166fb3af666d555b42045da10f064ce2402c
2018-01-16 12:38:22 +00:00
OpenStack Proposal Bot 8be9765850 Updated from global requirements
Change-Id: Ibd979dcfc3050036ee3cb170809a0f014350165e
2017-11-16 11:14:42 +00:00
Dirk Mueller 5dabcd614f Remove pep8 from test-requirements
I don't see it used anywhere, and it certainly is old-fashioned
anyway (pycodestyle is the new name for it)

Change-Id: Ifac041ec765638c3e13f9c031cedfc9b15f1d85d
2017-10-25 16:19:26 +02:00
OpenStack Proposal Bot e499b08c01 Updated from global requirements
Change-Id: I4370383f662a5c70f26fab02b201773c2c70c01c
2017-10-05 18:54:58 +00:00
Armando Migliaccio b3de3b6e69 Fix unit test failures due to switch to testr changes
Change-Id: Idae1413a769371cb7c76d4689f6dab67c72b22be
2017-09-14 08:17:35 -07:00
OpenStack Proposal Bot 58048416ba Updated from global requirements
Change-Id: Ia0cecdac93f7cfca1afbe02610038bf85e96418e
2017-08-23 12:15:07 +00:00
OpenStack Proposal Bot 611d7b6643 Updated from global requirements
Change-Id: I19a8e6db9b31632cc0d8729d242385c7dfd7f1dd
2017-07-28 21:41:42 +00:00
Gary Kotton fafb101538 Use flake8-import-order plugin
This enables the process to be automated and not rely on
review inputs.

Change-Id: Ie829b9c53dd1b251785802ecbf364e97b1437ff5
2017-07-05 00:53:13 -07:00
Van Hung Pham 8efbfa6ea6 Switch from oslosphinx to openstackdocstheme
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
2017-06-30 17:38:08 +07:00
OpenStack Proposal Bot ecdf8785c9 Updated from global requirements
Change-Id: I6b8fcb73d76a067340af1a5919e913c14cd02202
2017-06-27 12:15:15 +00:00
OpenStack Proposal Bot d082e626b1 Updated from global requirements
Change-Id: I117294aabac060bae8f6d79038c8dab1602c3b87
2017-06-03 13:08:46 +00:00
OpenStack Proposal Bot 5c60203f60 Updated from global requirements
Change-Id: I81c3db834079123684d49aa528b63a6a3f638365
2017-05-17 03:52:23 +00:00
OpenStack Proposal Bot 247956f271 Updated from global requirements
Change-Id: I6324e4bf0823eba1ecd96a203d372467dc25a365
2017-02-10 09:44:28 +00:00
Jenkins 1165f2dadb Merge "Remove discover from test-requirements" 2017-01-12 00:08:59 +00:00
OpenStack Proposal Bot 82eddcd826 Updated from global requirements
Change-Id: Ic1ddefddac656b58b00b5cb63c2711a837be785e
2017-01-09 23:03:50 +00:00
Tony Breeds 0931c5ce9e Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I908f4facc0a1ca0bb52f1fdd0f0b30b0a6195e22
2017-01-03 13:58:00 +11:00
Boden R c61976b66d Use new checks in hacking 0.12
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
2016-12-15 07:03:58 -07:00
OpenStack Proposal Bot 6f944bfee0 Updated from global requirements
Change-Id: I821dac3f252c674a1bc7edb29729625adb68860d
2016-11-02 15:35:22 +00:00
OpenStack Proposal Bot 69443d616e Updated from global requirements
Change-Id: Ib331a335692df3f845649b77039cc47c1743d201
2016-10-22 01:22:37 +00:00
Armando Migliaccio 4fbf12151c Add release notes target
Release notes for neutron-lib are meant to address neutron
developers and help them identify changes from one release
to another.

Change-Id: I51d2049643d3b35484d07f2f4aad7765f6dac958
2016-10-20 11:22:32 -07:00
OpenStack Proposal Bot 2b99facb43 Updated from global requirements
Change-Id: I2a0fc15dd18a47eb89c4bd4af9bb07622b58a404
2016-09-30 20:01:58 +00:00
OpenStack Proposal Bot 090dee53b2 Updated from global requirements
Change-Id: I32535d4da7e2ee4b09528337d306200c353afe8f
2016-09-27 10:02:56 +00:00
OpenStack Proposal Bot 9a81fde8d1 Updated from global requirements
Change-Id: Iefa537576bdd0113a1ab2e8b4a1f7b4111561600
2016-08-26 09:13:47 +00:00
Henry Gessau 8be88da5c1 Base DB: rehome model_base
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
2016-08-19 08:47:37 -04:00
OpenStack Proposal Bot fcc8ad21ee Updated from global requirements
Change-Id: I961dd22eb5c472f27d5a0978ae72a8951c54b528
2016-08-08 10:44:15 +00:00
OpenStack Proposal Bot e7132af51c Updated from global requirements
Change-Id: Ic4d08754a06f12c161cb8ecd9bd5c266e6e0ce73
2016-08-04 02:38:00 +00:00
Boden R 4f318bc253 Update hacking check consumption
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
2016-08-02 08:57:18 -06:00
Swapnil Kulkarni (coolsvap) 1d44493169 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I31c24caf3a2bfa804631a941c6244dd6dcf2e35b
2016-07-22 06:36:07 +00:00