Commit Graph

69 Commits

Author SHA1 Message Date
Takashi Kajinami 323dad3e67 tox: Drop envdir
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~

According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293

Change-Id: I0321ceed864ccdb8fb78d6fb119b09640bb97896
2024-02-03 00:03:36 +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 343b2db574 Remove unmaintained API report tooling
This tool has not get any meaningful update for 7 years and looks
unmaintained.

Change-Id: I80ed6035f5a54cd97d2af574138a35893ddac65d
2023-11-14 17:38:20 +00:00
Brian Haley 4ac49dbcc0 Update envlist for tox4
tox4 even when running specific env with -e option tries
to find python version for all envs defined in envlist[1]
when running with --skip-missing-interpreters=false and
fails if interpreter missing for any of the env.

With py38 in envlist it tries to find python3.8
which is not available in ubuntu-jammy by default
and fails, hence use generic version instead i.e py3
to handle it.

Even though [1] is fixed we are still seeing this failure.

[1] https://github.com/tox-dev/tox/issues/2811

Also updated basepython to use TOX_PYTHON if set.

Change-Id: I18765db9682fced05e8441a1e2122f9f814cd31b
2023-01-13 09:56:43 -05:00
Brian Haley 39908d1735 Support tox4
Change-Id: If3a7005dc896ddf7c2556507f402c75a989551e2
2023-01-03 18:32:12 -05:00
Ghanshyam Mann daaa1e79b5 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I67453b5a0e6d41d5cb4ef0cbb47f955a448005eb
2022-04-30 20:09:08 -05:00
Takashi Natsume cb23644f52 Change minversion of tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace whitelist_externals with allowlist_externals option.
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Change-Id: Ie214cbc11b37dd95a3f020c5dca725cbb531bf9c
2021-05-18 23:49:41 +09:00
wangzihao 67d24c6e95 Update TOX_CONSTRAINTS_FILE for master
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

  -https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: Idac38dc3b55d4eda6e3e8347722abfc9d6782183
2021-01-07 10:18:31 +08: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
Brian Haley 891d0f08d6 Update to victoria jobs template
This will add a py38 job as default and remove the
py37 one.

Change-Id: Id783351392640aa76a3c8edf263fdde935f05963
2020-05-12 17:27:55 -04: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
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
Daniel Bengtsson c099a22789 Update the minversion parameter.
Update the minversion parameter to use the python -m pip to install
python packages:

https://tox.readthedocs.io/en/latest/changelog.html#id185

It's recommend to use this.

Change-Id: I120c2aae877362c78d8dbf5cce253b668fdfcd9a
2020-02-12 16:51:10 +01:00
Zuul 84498a4730 Merge "Stop testing Python 2" 2020-01-09 20:07:28 +00:00
zhanghao d9a0ce5d72 Stop testing Python 2
This change removes the requirement for python 2 and removes testing for
it, but tries to leave the code compatible with python2 where possible.

Co-Authored-By: Nate Johnston <nate.johnston@redhat.com>
Change-Id: I711ae939b5eaa1816af15b22527c38858507127f
2020-01-09 11:12:06 -05:00
Daniel Bengtsson 43f6759ab5 Stop configuring install_command in tox.
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value.

Change-Id: I5d1cbb2bc2c092bebe06987d6e39491c621a0653
2019-11-15 15:36:56 +01:00
Akihiro Motoki 2f08f1203b PDF documentation build
Change-Id: Ic4d3fe2f5feef6e78b84831683f1826af16eec9e
Story: 2006099
Task: 35132
2019-09-04 13:12:33 +00:00
Corey Bryant 806763b86c Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I4311a9541b33653c396fa4bae9d39633f14e809f
Story: #2005924
Task: #34225
2019-07-05 13:53:59 -04:00
Brian Haley bf810d24ed Update flake8 style enforcement
Added enforcement of H106, H203, H204 and H205 extensions to
match neutron repo, fixing a few failures in the process.

Also updated to support hacking 1.1.0, bringing in flake8
2.6.2 and pycodestyle 2.4.0 in the process.  This ensures
future python3 compatibility and a bit better code styling.

Change-Id: Ibd9cff863eaff940755ccb9c20f39e29e2001cde
2019-06-26 16:30:35 -04:00
ZhongShengping 57d7d3baa1 Update Python 3 test runtimes for Train
This goal is to implement the process set out in the 2018-10-24 Python
Update Process TC resolution[1], for the Train cycle to ensure unit
testing is in place for all of the Tested Runtimes for Train[2].
In practice, this generally means adding unit tests for Python 3.7 and
dropping unit tests for Python 3.5. Using the Zuul template for Train
will ensure that all projects that support Python3 will be tested
against the agreed runtime versions, and make it easier to update them
in future.

Specifically this patch:
- Uses the openstack-python3-train-jobs zuul template rather than
templates for python 36/37.
- Adds Python 3.7 to the setup.cfg classifier.
- Adds py37 to the envlist of tox.ini.

[1]https://governance.openstack.org/tc/resolutions/20181024-python-update-process.html
[2]https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I92e07412e06d5e0bcd4a3ef63643d140243f8205
Depends-On: https://review.opendev.org/#/c/641878/
2019-05-15 14:20:36 -06:00
ZhongShengping d825414677 Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org
counterparts.

Change-Id: I18b8181e29b1d81245df3534e75f13bde3c80ef3
2019-04-22 11:23:33 +08:00
ZhongShengping c104e82169 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: Iaef50bda2e67e114cec3fe6e147a61283c8c1003
2019-04-15 09:24:03 +08:00
Nguyen Hai Truong 0a6dcc55aa Update min tox version to 2.3.2
After latest changes on tox.ini, the minimum
version of tox need to be changed to 2.3.2.

https://bugs.launchpad.net/neutron/+bug/1695888

Change-Id: I006274862f9d66af86db47f29f3b5bf7ac3fc103
2018-11-09 00:54:46 +07:00
Bence Romsics ebbad5b995 Update list of skipped bandit plugins
This is the same fix as https://review.openstack.org/592884
but for neutron-lib.

Change-Id: Ia20ac59289df5e44b8a7e99df9371c4c381a40be
2018-08-21 09:28:09 +02:00
Boden R a37d43018b rehome rpc and related plumbing
As shown in the history of this patch, along with the work in [1], we've
discussed rehoming neutron.common.rpc into lib a number of times before.
One of the main reasons we've decided not to rehome in the past is that
we'd hoped the neutron.common.rcp.BackingOffClient and related plumbing
could be put into oslo.messaging. However, it's 2 years later and that
still hasn't happened [2][3].

This patch proposes we just move forward with the rehome so that we can
begin to untangle the consumers [4]. There's no reason we can't
reiterate on this code in lib; it's no more difficult than in neutron.

This patch includes rehoming of:
- neutron.common.rpc, the only difference in the lib version is that
we dynamically add all neutron_lib.exceptions by default (_DFT_EXMODS).
- neutron.common.exceptions, but exceptions are broken out into their
respective exception modules rather than lumping all together in a
generic single module.
- The fake notifier and RPC fixture, without any real changes.
- A new runtime util method to dynamically load all modules for a
package.

For a sample neutron consumption patch see [5] that was tested with
PS10 herein.

[1] https://review.openstack.org/#/q/project:openstack/neutron-lib+message:rpc
[2] https://review.openstack.org/#/c/407722/
[3] https://bugs.launchpad.net/oslo.messaging/+bug/1667445
[4] http://codesearch.openstack.org/?q=from%20neutron.common%20import%20rpc
[5] https://review.openstack.org/#/c/579989/

Change-Id: I0052ba65973a993e088943056879bc6e982bd0b5
2018-07-12 13:13:21 -06: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
Doug Hellmann ac7a2019e1 fix tox python3 overrides
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: I922ca42cb37a72be1bfe0765c17b075d6e08e1fa
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 17:15:04 -04: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
Zuul 4cd1d65a22 Merge "fix docs/links for 1.14.0 release" 2018-04-24 16:39:10 +00:00
Boden R 2dc98bf4af fix docs/links for 1.14.0 release
This patch addresses the following issues in prep for the neutron-lib
1.14.0 release:
- Updates the tox linkcheck target to get it working.
- Removes the glob for modules/* in doc/source/reference/index.rst as
this causes local build errors when not finding anything with the glob.
- Fixes any issues found by running the linkcheck tox target.

Change-Id: I0e96068cd7b6733adc35503b40500b80692cfd6d
2018-04-23 11:24:08 -06:00
Andreas Jaeger f03d049f58 Fix requirements for api-ref
To build api-ref, we need doc/requirements - set up dependency
correctly.

Change-Id: I9f42477d438933bbe17f1015b18a56e52fb7985d
2018-04-23 14:57:08 +02:00
Zuul 5627a2391a Merge "Follow the new PTI for document build" 2018-04-06 18:25:32 +00: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
Doug Hellmann 0cd466dac3 add lower-constraints job
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: I296a3efad5ec71a3520f79100082b947719108e8
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 16:36:02 -04:00
Andreas Jaeger e8f2616574 Remove tools/tox_install.sh
This repo does not need tools/tox_install.sh at all, instead call pip
install directly and add constraints to dependencies.

Change-Id: Id6b1afde54d3dc26c1e95e85ec7e6a7100ff671b
2018-03-07 20:31:12 +01:00
Boden R 695b73a08b fix linkcheck tox target
The current linkcheck tox target fails on a fresh neutron-lib clone
due to the /modules not existing under doc/source/reference. This patch
fixes the issue by ensuring the modules are generated before running
the linkcheck target.

Change-Id: Ie55b855c9469435b6f8ef4b3459c3082860f93c0
2018-01-03 09:14:45 -07:00
Boden R b4ec3d0ebd add api ref and doc link validation to release
This patch adds a linkcheck target to our tox.ini that validates URLs
in both our doc and api-ref html. In addition the release checklist is
updated to suggest this should be done prior to releasing.

Partial-Bug: #1716005

Change-Id: I48b4dde3ffd1902a31bf6f352b7143d4c15f3443
2017-09-21 15:20:10 -06:00
Jenkins 4e100d90c4 Merge "Use flake8-import-order plugin" 2017-07-06 17:54:16 +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
Akihiro Motoki 94d7e681ee Enable warning-is-error in doc build
The command to build docs is updated to match that run in the gate.
The previous command is to ensure no warning, but sphinx 1.5 or later
has warning-is-error option and there is no need to run a different
command in tox docs target.

Change-Id: Ieac8afd096a158aff6403326104ced31adcb77e1
2017-07-05 06:49:58 +09:00
Luong Anh Tuan 0b2bcf9ed6 Indicating the location tests directory in oslo_debug_helper
According to [1], we can passing a "-t" argument to
oslo_debug_helper to indicate the directory where tests
are located. This will solves ImportError exception.

[1] https://docs.openstack.org/developer/oslotest/features.html

Change-Id: Ifb290b00e79f9d5236d84163c13571dc74cea4e0
Closes-Bug: #1666560
2017-03-14 15:44:32 +00:00
Jenkins a37658896f Merge "Validate API sample JSON files" 2017-02-14 16:09:34 +00:00
YAMAMOTO Takashi 2ce2b2ccbb Validate API sample JSON files
Change-Id: I0428e54c4eada67a967a5df36ce9d35a84335c97
2017-02-10 11:15:01 +09:00
Cao Xuan Hoang 12c3a82756 Remove support for py34
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: I9701f7ac1551dc60f0f75f64a322a6841108dfe2
2017-02-09 08:28:56 +07:00
Jenkins d8a75430c0 Merge "Use new checks in hacking 0.12" 2016-12-19 17:21:04 +00:00
Jenkins 0a620458b9 Merge "Separate hacking check factories" 2016-12-16 11:29:04 +00: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
YAMAMOTO Takashi 322ae30246 Use constranits for api-ref target
It should be ok to use zuul-cloner these days. [1]
This would avoid docutils 0.13.1, which seems to cause the following
TypeError.

    Exception occurred:
      File "/home/jenkins/workspace/gate-neutron-lib-api-ref/.tox/api-ref/local/lib/python2.7/site-packages/docutils/writers/html4css1/__init__.py", line 288, in write_colspecs
        width += node['colwidth']
    TypeError: unsupported operand type(s) for +=: 'int' and 'str'

[1] I8f45a53429b9fcbf3689a268f096afdf5f32f461

Closes-Bug: #1649079
Change-Id: Id75e88f5031aeab21b2158c721881bf2da4a0d28
2016-12-11 21:35:05 +09:00
Boden R d1a5ea03c2 Separate hacking check factories
Neutron-lib adopters should be using neutron-lib's hacking
checks (factory) to validate compliance, but are susceptible
to breakage when new checks are released in neutron-lib (see
partial bug). What we need is a way to roll-out adopter hacking
checks in a controlled manner, giving consumers the opportunity
and tools to comply with new checks.

This patch begins to address this need by:
- Separating neutron-lib hacking checks into 3 separate factories;
adopter, incubating and neutron-lib internal (private).
- Moving any existing checks into their respective factory.
- Updating the usage docs on how to adopt our hacking checks.
- Trusty ole unit test; for obvious reasons.

This patch plays a part in a longer term hacking check strategy:
- Adopters must run neutron-lib's hacking check factory() or its
equivalent via their pep8 checks. This is part of their pep8 gate job
once they update their tox.ini to use neutron's factory().
- Adopters must run a non-voting neutron-lib-pep8-incubating gate job
that runs pep8 with neutron-lib's incubating_factory(). This is means
to warn adopters of upcoming checks without failing their gates.
This job will be created (by me) assuming reviewers agree to this approach.
- We'll communicate hacking checks via the standard means (see usage
docs herein).

Closure of Bug #1609478 will follow completion of the strategy above.

Partial-Bug: #1609478
Change-Id: I5b8d5c41f1bf463109baf9c26ae9d9db5719097d
2016-12-07 14:38:39 -07: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