Commit Graph

144 Commits

Author SHA1 Message Date
Takashi Kajinami 8ac18a8ee1 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: Iaa1aa0022e207cceb26ed45474bc6edfbbec4faa
2024-01-12 17:44:09 +09:00
Akihiro Motoki d64c25c019 Follow-up: Move linters dependencies to tox.ini
After commit 89e2fad8ef,
pep8/bandit/bashate tox envs have different dependencies than
the default tox env. If tox envs with different dependencies share
some common envdir, tox env will be recreated every time a different
tox env is specified. (For example, "tox -e cover" after "tox -e pep8"
recreates the tox env.)

To address it, this commit introduces a new common envdir for linters
(envdir = {toxworkdir}/lint). It also moves deependencies of bashate
and bandit envs to pep8 env to ensure these three tox envs have the
same dependencies.

Cleanups are also made in test-requirements and lower-constraints.
* astroid and isort can be dropped from test-requirements.txt
  as pylint has proper version cappings for astroid and isort.
  (These cappings are available in pylint 2.5 and later.)
* reno is a document dependency, so it is unnecessary in test-requirements.
* reno, astroid and isort are dropped from lower-constraints
  as they are not installed in lower-constraints tests.

Change-Id: Iaa3168764d050875e3d08784aee2dfba809e53be
2021-01-07 04:26:07 +09:00
Bernard Cafarelli 89e2fad8ef
Move linters dependencies to tox.ini
Another item noted with the new pip resolver [1], linters dependencies
in test-requirements.txt may cause resolver issues (trying to pull in
enum34), conflicting requirements and cause them to be installed for all
test jobs. Move them to tox.ini as was done for some projects already
(this may be backported/squashed with pip resolver fix in stable
branches depending on how fixing these will go).

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019362.html

Change-Id: I0111c41bea6a6caf5ffba1f5c34489854d9c9747
2020-12-17 11:32:03 +01:00
Bernard Cafarelli 8d6c301301
Update requirements for recent pip failures
Bump astroid test requirement to 2.4.0
Older versions trigger an error on wrapt dependency:
https://github.com/PyCQA/astroid/issues/755

Bump pylint accordingly to new astroid

Fix some new PEP8 warnings appearing with new versions, and filter out
the larget I202 "Additional newline in a group of imports" one for now

Drop psutil from functional requirements, it indicated an old version
and we have it in common requirements now

Bump a series of lower-constraints and requirements to work with new pip
resolver, testing with steps outlined at:
http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019285.html
This includes eventlet 0.22.1, previous versions triggered a hard to
track error on enum34
Cap cryptography in lower-constraints to prevent discovery failure in
relevant job (other jobs have it capped via upper-constraints)

Change-Id: Ie74ea517a403e6e2a7a4e0a245dd20e5281339e8
Closes-Bug: #1907242
2020-12-09 13:17:51 +01:00
Bernard Cafarelli cebdd77af8
Bump pylint version to support python 3.8
As spotted in Focal testing patch [0], pep8 test fails with many
C0321 false-positives, reported in pylint as current version does not
support python 3.8 [1]

Use a newer version of pylint and astroid, fixing or disabling some of
the new checks: no-else-*, unnecessary-comprehension, import-outside-toplevel

[0] https://review.opendev.org/#/c/738163/
[1] https://github.com/PyCQA/pylint/issues/2737

Change-Id: Ie646b7093aa8634fd950c136a0eba9adcf56591c
2020-08-06 16:00:30 +02:00
Lucas Alvares Gomes 75970c4cda Fix pep8 job
New versions of isort broke pylint. This patch fixes it at 4.3.21.

Depends-On: https://review.opendev.org/739469
Change-Id: Ic6858b60ae6b7cd031843ea594b8fe1c8a67bb54
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
2020-07-07 10:23:15 +00:00
Andreas Jaeger d46228b0b3 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: I780eea00c9c47f52dcc7928546fd22dec5d145b4
2020-05-20 22:06:45 +02:00
Akihiro Motoki 52e3fee5ef Switch to hacking 3.0.1
In hacking 2.0 or later, 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]. neutron-lib provided a factory to register common hacking
rules, but it no longer works with hacking 2, so we need to define rules
defined in neutron-lib as flake8 local check plugin [2] explicitly.
This needs to be done in each neutron related project, so it is the
downside of the migration to hacking 2.x (I explored a way to continue
to use the factory but failed to find a good way to achieve this) but
I believe it is good to migrate the newer libraries.

* flake8ext decorator in neutron/hacking/checks.py is also replaced with
  hacking.core.flake8ext to avoid the copy-and-paste code.
* neutron-lib dependency is updated as neutron-lib 2.3 added hacking 3 support.
* 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).
* HackingDocTestCase is now converted into normal test cases.
  HackingDocTestCase depends on the internal of hacking and pycodestyle
  so it looks better to use normal style of writing tests.

[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: I92cf50a84bb587a0649a7cffee15cce4ce37d086
2020-05-12 16:58:41 -04:00
Brian Haley 8126f88894 Complete removal of dependency on the "mock" package
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

This completes removal of all references to "import mock",
changing to "from unittest import mock" in fullstack and
functional tests.

Added a hacking check to enforce it in future patches.

Change-Id: Ifcaf1c21bea0ec3c35278e49cecc90a101a82113
2020-05-01 12:05:34 -04:00
Brian Haley 36727e3463 Fix pep8 errors found by hacking 2.0.0
The new hacking release found some pep8 errors, fix them.
Unfortunately, moving to 2.0.0 pulled a thread with other
dependencies causing issues, so for now pin it below
1.2.0 to get the gate functioning again.

Change-Id: Ic8ee670e03dde0669231477a4209b01eb8fba7fd
2019-12-13 16:41:27 -05:00
Riccardo Pittau c6ff9c922e Use openstacksdk for ironic notifiers
This patch removes the dependency from ironicclient for the ironic
event notifiers in favor of openstacksdk.
Also, increasing minimum required versions for mock and
openstacksdk.

Change-Id: Ib76e19d29f0ae3db6d181578b638da699181f60d
2019-09-19 06:56:24 +00:00
Brian Haley bd3d85807c 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: Id944054deedd545c34fc28ccf043dd72e5f31220
2019-05-09 21:00:54 -04:00
Doug Wiegley 7e208c3014 Bump pylint version to one that supports python3.7
The listed revision no longer supports python2, but afaik, we are
always running under python3 for those tests anyway.

Change-Id: Iba94d73eeb65fb21f5d098afe0fbe4348dbea850
2019-02-21 13:22:26 +00:00
Doug Hellmann 2530ccff8f Upgrade pylint to a version that works with python3
Also fixed some six.moves errors as well.

Change-Id: I9783ee588de1ec4b91a665b9dc89fdba3e2d90df
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 18:03:25 +00:00
Matthew Edmonds 383c7b5c05 add pycodestyle to test-requirements
If we're going to import pycodestyle in unit tests, then we have
to also list it in test-requirements.txt.

Change-Id: I33be4f5d4ae48c6bd48d80e3f1185ef8307a2a0c
2018-08-15 13:19:03 -04:00
IWAMOTO Toshihiro 0f180d8e2e Adopt hacking 1.1.0
This incorporates flake8 2.6.x and pycodestyle will be used
instead of older pep8.  This ensures future python3 compatibility
and a bit better code styling.

Change-Id: Ia7c7c5a44727f615a151e1e68dd94c7ed42f974f
2018-07-05 11:31:40 +09:00
Slawek Kaplonski ec537c49e9 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: If3383707c9baf69e03bcccc50970da748a834141
2018-06-02 13:03:33 +02:00
Boden R e34104e74c fix tox release note generation
The reno package must now be specified in the test-requirements.txt,
otherwise reno is not installed and the tox venv target can't be used
to generate a release note.

[1] https://docs.openstack.org/reno/latest/user/usage.html

Change-Id: I2d246fc51498912be62e203cb8e457e9a7a0df22
2018-04-12 09:39:20 -06:00
Nguyen Hai 0556a2ab73 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
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Remove the '[build_sphinx]' as described in:
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Change-Id: Id3d7065028b4c0831e6b5c2363b19626734817a3
2018-03-24 13:23:33 +09:00
OpenStack Proposal Bot 9da92dbc52 Updated from global requirements
Change-Id: Iebf183c2196e35ed4296bdc629e080af225538e3
2018-03-13 07:06:06 +00:00
OpenStack Proposal Bot 6c50a12c3c Updated from global requirements
Change-Id: I5a68d0b181e59ecd5d8c0d1876fc962027922152
2018-03-10 13:27:26 +00:00
OpenStack Proposal Bot b8b043ada5 Updated from global requirements
Change-Id: I40151d3a87f40249b4393937631531bcec6d14eb
2018-02-01 07:17:59 +00:00
OpenStack Proposal Bot 054aa3a29b Updated from global requirements
Change-Id: I00aa2d6160206ac6ee8dc85be152b35034d08e60
2018-01-16 12:37:23 +00:00
Chandan Kumar 813295f8cf Remove the bundled intree neutron tempest plugin
The plugin has been split into its own repository[1] in accordance with
Queens Goal "Split Tempest Plugins into Separate Repos/Projects[2]".
This patch removes the local copy as well as the setuptools entry point.
We can also now remove the autodoc_tree_excludes pbr option since
there's no more plugin to exclude and it defaults to [setup.py].

The patch leaves still in-tree base classes and constants in order to
avoid breakage of projects depending on such code. In the future, we
will deprecate those and gradually move affected subprojects to the new
repo.

List of affected repositories:
 - neutron-vpnaas
 - openstack-ansible-os_neutron
 - tripleo-quickstart-extras
 - networking-midonet
 - networking-l2gw
 - neutron-dynamic-routing
 - networking-vsphere
 - networking-plumgrid
 - networking-zvm

[1] http://git.openstack.org/cgit/openstack/neutron-tempest-plugin
[2] https://governance.openstack.org/tc/goals/queens/split-tempest-plugins.html

Depends-On: I371aa4d5f043f695df04b98b0f485c8f0548f2b3

Change-Id: Ia21aad29d0bbf779583964db6f1665c9b3b83161
2017-11-22 12:54:33 -08:00
OpenStack Proposal Bot f442554bbb Updated from global requirements
Change-Id: Ib0ef9ca79e46da042ccf8a8b3a4b33d15d4805de
2017-11-16 11:13:55 +00:00
OpenStack Proposal Bot d09f2438e8 Updated from global requirements
Change-Id: I2250ce4f1aab3421452aace50b61ef0f245f4b5c
2017-09-13 12:55:07 +00:00
Ihar Hrachyshka 3e341a9941 Fix post gate hook to accommodate for new os-testr
New os-testr uses stestr under the hood, which creates .stestr but not
.testrepository directory in the current dir. Other than that, it
doesn't seem like there is any difference in the format or names of
files generated in the directory.

Change-Id: I82d52bf0ad885bd36d2f0782a7c86ac61df532f2
Closes-Bug: #1716746
2017-09-12 14:20:12 -06:00
OpenStack Proposal Bot 2ab7c23b45 Updated from global requirements
Change-Id: I7fe9d059016edbb26a8fb6f27a1a6e8b41494edd
2017-08-23 23:28:50 +00:00
OpenStack Proposal Bot 0adb29f0f0 Updated from global requirements
Change-Id: Ie8727686892488a9bc603b039d34d763b5be7b5c
2017-08-03 00:34:17 +00:00
Armando Migliaccio bd4c2c9760 Add bandit target to tox
Change-Id: I3ca2f77e026167bf6828072ccd02872e7c504c1c
2017-07-28 17:49:28 -07:00
OpenStack Proposal Bot 016e9a2bf8 Updated from global requirements
Change-Id: Ia3d2664396defe1646828baf89c66a01aa0f1b37
2017-07-28 01:15:52 +00:00
jeremy.zhang 3e4cb0817d Replace test.attr() with decorators.attr()
Function 'tempest.test.attr()' has been moved to'tempest.lib.decorators.attr()'
in Pike and will be removed in a future version [1]. This patch is to replace
'tempest.test.attr()' with 'tempest.lib.decorators.attr()'.

[1] Iaafbb112b6eee458089cc49918359a8a8d0485e2

Depends-On: I50b823b049d0e391ac517f7ec72380a12fa81176
Change-Id: I1e511166a114a79504404c88579f6cb0c4caaebe
2017-07-13 03:31:15 +00:00
Jenkins 3a894d0b9e Merge "Updated from global requirements" 2017-07-06 02:07:50 +00:00
OpenStack Proposal Bot 7108948823 Updated from global requirements
Change-Id: Ia2976638308a98fdf42218034aab296b9a0a98a3
2017-07-05 13:15:02 +00:00
Akihiro Motoki f64110f652 Use flake8-import-order plugin
In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
It enforces loose checking so it sounds good to use it.
This flake8 plugin is already used in tempest.

Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.

Setup for unit tests of hacking rules is tweaked to disable
flake8-import-order checks. This extension assumes an actual file exists
and causes hacking rule unit tests.

Change-Id: Ib51bd97dc4394ef2b46d4dbb7fb36a9aa9f8fe3d
2017-07-05 03:15:27 +00:00
OpenStack Proposal Bot 8856a761a2 Updated from global requirements
Change-Id: I218dbc85d829e96fb94cf840c910980c764ed454
2017-06-20 11:47:04 +00:00
Akihiro Motoki 2a1b0b0523 docs: switch to openstackdocstheme
The docs reorganization proposed in the docs-specs [1],
we will migrate our sphinx theme to openstackdocsthems.
This commit switches our docs theme to it,

Also ajust title levels. openstackdocstheme assume one title (first
level) per page.  Second or later first-level titles are not shown.
This changes title levels to match openstackdocsthem requirements.

Note that oslosphinx is used by releasenotes build,
so it is not dropped from test-requirements.txt.

[1] https://review.openstack.org/#/c/472275/

Change-Id: I72d55c26401ae9bfd06626d1b1584a368bbd9f86
2017-06-16 08:20:54 +09:00
OpenStack Proposal Bot 8d9fcb2d30 Updated from global requirements
Change-Id: Ie8979725f50c7d6fd8d1101bc344c7b46bfe029b
2017-06-08 06:03:54 +00:00
OpenStack Proposal Bot 7c33804ef2 Updated from global requirements
Change-Id: Ia887d89a60a96ede04460dc06135c9c016b232d8
2017-05-17 03:51:56 +00:00
OpenStack Proposal Bot a3c84de5d8 Updated from global requirements
Change-Id: I6af8fc82ff7dce731f7f7baae88160af31a214ad
2017-03-04 11:19:58 +00:00
ricolin c3dda72181 [Fix gate]Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: Ie0a2cef329e2820ffe60c512a4870c0c3053574a
2017-03-02 17:52:11 +00:00
Victor Morales a14439549f Add bashate support
Bashate is a style checker program for bash scripts.  This addition
improves the quality of the current bash scripts and ensures that
any future change will follow the same standards.

Change-Id: Ia346f77632d4ac7beb288fa3aacea221d7969c87
2017-02-25 06:29:55 +00:00
OpenStack Proposal Bot 72e9f60ca6 Updated from global requirements
Change-Id: I847eb889cae34b49130cdb2d5b1b50faf773b460
2017-02-13 15:15:21 +00:00
OpenStack Proposal Bot 8754b9c2a1 Updated from global requirements
Change-Id: Ib2c3bd4ef0d953b35e7472ef053f7004afa2cdb5
2016-12-28 09:11:12 +00:00
Ihar Hrachyshka 605df9cb94 Moving pyroute and oslo.privsep deps into requirements.txt
It is true that the code using the modules is still utilized in tests
only; but it's also true that those deps are now needed for example for
oslo-config-generator to work, so in the end, it's not only about tests.

Change-Id: I9e27aca32be03130057e00c727d29cb26532e860
Related-Bug: #1492714
2016-12-17 07:39:59 +00:00
Omer Anson 9183da7c96 Adopt privsep and read routing table with pyroute2
Make use of oslo.privsep to support namespaces. This includes all
relevant code necessary for oslo.privsep to work.

Change ip_lib's get_routing_table method to use pyroute2, rather than
parsing the output of 'ip route'.

Change-Id: I89bfa3dbf1776da973cfca389b2841019a520f75
Partial-Bug: 1492714
Co-Authored-By: Angus Lees <gus@inodes.org>
2016-12-21 17:52:58 +02:00
OpenStack Proposal Bot 427a960d68 Updated from global requirements
Change-Id: Ie4e90456ba686a8e7a74625df659bef100c7031c
2016-11-22 13:56:13 +00:00
Ihar Hrachyshka 4e25ba840a Switch to new hacking 0.12
The release includes its own check for delayed string interpolation for
log messages, so we can now remove our own check for the same thing. The
check is off-by-default, so we need to explicitly enable it. Sadly,
select= directive in tox.ini is broken [1] so we need to enable the
check with flake8 argument instead.

[1] https://github.com/PyCQA/pycodestyle/issues/390

Change-Id: Idc6b8e5b1cb594e130d4cc0cbcfffd362f9ab86a
2016-11-08 03:36:00 +00:00
OpenStack Proposal Bot ac2b7b0592 Updated from global requirements
Change-Id: I24f6b2ef22df782b24741020c77ee416f4b591f7
2016-11-04 14:10:47 +00:00
OpenStack Proposal Bot a44543ff68 Updated from global requirements
Change-Id: Ib28315e083cb7c96f78c4423246b59dae4b3d456
2016-10-22 01:22:09 +00:00