Commit Graph

80 Commits

Author SHA1 Message Date
Stephen Finucane be8e6ba4fa tox: Use pre-commit for style checks
Change-Id: Ibe29f450c67c2297b659bd3c0b3b3b0d4d5e13a8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 10:06:18 +00:00
Stephen Finucane ab7cdb4c25 Blacken code
Another library down.

Change-Id: Id29f29331ba994a1f09376763702fcca82ec6f1c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 10:05:52 +00:00
Stephen Finucane 12900da15b tox 4 compatibility
Remove 'usedevelop = true' and 'skipsdist = true', the combination of
which now means we don't install dependencies. Also remove the
basepython setting, which is no longer needed since we don't have any
Python 2-first distros to worry about. Finally, remove the
lower-constraints job and we no longer test for these.

Change-Id: I5b4b8cc1facb6e18cf12d33ea8113d47a0a76235
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-02-16 10:26:15 +00:00
Stephen Finucane e47109370e tox: Ignore .venv files for flake8
Commonly used for testing virtual environments (at least by me).

Change-Id: I3b711bd3464a2ca2a8dced37d9d6ec328b8bf827
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-10-13 12:39:15 +01:00
Jeremy Stanley e3f58c1f99 Correct the tox option for skipping sdist generation
The tox option to skip source distribution building is skipsdist,
but this seems to be often misspelled skipdist instead, which gets
silently ignored and so does not take effect. Correct it
everywhere, in hopes that new projects will finally stop copying
this mistake around.

See https://tox.readthedocs.io/en/latest/config.html#conf-skipsdist
and https://github.com/tox-dev/tox/issues/1388 for details.

Change-Id: I639066169913072b992c0e1073f9398d6ac8cdd2
2021-06-17 17:04:29 +00:00
Stephen Finucane 2b7a679a42 Fix lower-constraints job
pip 20.3 finally includes a proper dependency resolver. Its use is
causing the following error messages on the lower-constraints job:

  ERROR: Could not find a version that satisfies the requirement
  hacking<3.1.0,>=3.0.1
  ERROR: No matching distribution found for hacking<3.1.0,>=3.0.1

Resolve this by moving the 'hacking' and 'flake8-import-order'
dependencies from 'test-requirements.txt' to 'tox.ini' since we don't
need to use our constraints machinery for linters.

While we're here, also drop 'bandit' from 'test-requirements.txt'. This
was introduced in change I691829c1224557d1d239c9f665ac539d0f13c4d3 but
commit f78173f0e1 (there's no change ID)
removed the 'bandit' testenv from 'tox.ini' meaning we no longer use
this anywhere.

Change-Id: I744efd75c4cbf8c630c5f95dc254acff581be959
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-01-11 10:35:42 +00:00
Stephen Finucane ce3e3783f1 tox: Set 'ignore_basepython_conflict'
Resolves the following warning:

  /usr/lib/python3.7/site-packages/tox/config/__init__.py:578:
  UserWarning: conflicting basepython version (set 37, should be 36) for
  env 'py36'; resolve conflict or set ignore_basepython_conflict

While here, also fix indentation of this file.

Change-Id: I48bf44cf7237554a48180c8bd3537425f0401f30
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-11-04 15:30:20 +00:00
Zuul c710e0cc5b Merge "bump py37 to py38 in tox.ini" 2020-10-31 05:09:14 +00:00
maaoyu 8781f6669a bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.

ref:
  https://governance.openstack.org/tc/reference/runtimes/victoria.html

Change-Id: I1d49679f78a5fdd46fc8ecc96bd66ee149cf8779
2020-10-12 13:58:40 +08:00
maaoyu a12c7e9dc5 Remove install unnecessary packages
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I4bcafc7c7d6905f5478fd4ed106795f21e51012e
2020-09-23 14:40:24 +08:00
Zuul 72df22dfb6 Merge "Update the constraints url" 2020-09-07 14:08:12 +00:00
Daniel Bengtsson 213d201fcc Stop configuring install_command in tox and stop use pip.
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. Use the
right way when it's necessary.

Depends-on: https://review.opendev.org/#/c/695022/
Change-Id: I2f18df5d26847b6545af99e969ebbe04d3326e30
2020-06-09 10:50:00 +02:00
Riccardo Pittau 20b922357e Add pep8 import order check
Set flake8-import-order version to 0.17.1
Full py3 compatible version.
Add all Python3 modules to stdlib list.

Change-Id: I787202eee18c99aaa659e0267235f4c413a389e9
2020-05-01 23:11:56 +02:00
Andreas Jaeger 592d80ac1c Update hacking for Python3
The repo is Python 3 now, so update hacking to version 2.0 which
supports Python 3.

Blacklist:
W504 line break after binary operator

Fix:
E305 expected 2 blank lines after class or function definition, found 1

Change-Id: I713186061d5484ee2cd5317eb9192646fd3a1099
2020-03-28 08:08:20 +01:00
pengyuesheng a120a9df81 Drop python 2.7 support and testing
Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Iff873ae15f865aa8740760a3e904a96d22e553e8
2019-12-27 16:07:06 +08:00
pengyuesheng 9c760d0d21 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I87ca452b30fef638c78c68835a072a0a820419f6
2019-09-23 16:15:40 +08:00
Corey Bryant e78db3b892 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: I05ab27593d55881b7d477afd7fc7f1b3d8b32f53
Story: #2005924
Task: #34232
2019-07-05 14:19:59 -04:00
Zuul fa42d45b12 Merge "Dropping the py35 testing" 2019-05-23 08:37:15 +00:00
Dean Troyer b788f24be6 Final switch to stestr
The change from ostestr had not been completed.

Change-Id: I8f8dc96554e211b3877a2cc7cdfa53c97be8b2c9
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-05-22 14:42:29 -05:00
Ghanshyam Mann 8c1418a2d4 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: I3ba319c17b3133d3c48106a2e509c04363a8839a
2019-04-22 23:40:46 +00:00
Dean Troyer 5a9501be4f Updates for OpenDev transition
Change-Id: I3e79081881b4d298a1abcc6ef1bdc327ce197487
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-04-20 13:22:25 -05:00
qingszhao 982c13bbf6 switch documentation job to new PTI
This is a mechanically generated patch to switch the documentation
jobs to use the new PTI versions of the jobs as part of the
python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Update docs tox environment to build ChangeLog file when using tox -e
docs.

Change-Id: If68bdb33bbf0727d699268d9de511790c8a048be
Story: #2002586
Task: #24320
2018-09-06 21:32:15 +02:00
Dean Troyer b8e166bb37 Replace autodoc with sphinxcontrib-apidoc
Fix local docs builds back to the new docs PTI.

http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Also clean up after the removal of osc_lib.session

Change-Id: Iaef7b91d4b72b654a10a9f3d9de40157799932ad
2018-07-11 00:19:48 -05:00
Monty Taylor ee79f6166e
Use openstack.config for config and Session objects
The TimingSession functionality has been merged into keystoneauth. This
allows us to use the CloudRegion object to get the Session directly.

Change-Id: Ib4c9210e681a2d2d9c5fc40de2c3ede1a5003154
2018-07-05 08:30:32 -05:00
Doug Hellmann 1716e9fd0d 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: I01e8cf1b70d7a1501dccd26bf30db52e36dedb38
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Zuul 5edbb64419 Merge "add lower-constraints job" 2018-03-29 01:15:41 +00:00
Monty Taylor 60b6624385
Rename python-openstacksdk to openstacksdk
Change-Id: If0032cc89e68408bd08f77d7700b204479cd5b23
2018-03-23 08:58:19 -05:00
Doug Hellmann 892b073220 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: Ieafa2beff7b8d26726765e9044dc0b5824e9339c
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 17:31:55 -04:00
Dean Troyer 86129e6f88 Use converged SDK insead of os-client-config
Sanity-check the o-c-c move to OpenStackSDK

Depends-on: I8d035cfd1afc1cad01ceac7cd643568e94897e27
Change-Id: Ia111f127fbdceac2afe20fd9d1fe032145cdd72c
2017-12-06 15:26:39 -06:00
Andreas Jaeger c7781817ca Remove -U from pip install
'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: I39d00ea09cc1f83ecf9caaa41365e9f550000c2a
2017-12-02 19:20:30 +01:00
Andreas Jaeger f1e84b4032 Avoid tox_install.sh for constraints support
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: I0b91ce60a0c315d0d2f5594f7feb2a56755d8625
2017-12-01 14:46:13 +01:00
Dean Troyer b42a26e981 Updates for stestr
Change-Id: Id20fb7add0ce4c4e37c7d38e6afeb00aedb93e84
2017-09-14 16:53:57 -05:00
kavithahr b5acd95c12 The python 3.5 is added
In setup.cfg the python 3.4 support is removed.
In tox.ini the python 3.5 version is added.

Change-Id: I5e1996c2e35996fa471fa394d58a1764b01e855e
2017-03-08 11:45:33 +05:30
Tony Breeds c6a3990f1f Add Constraints support
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 osc-lib.

Change-Id: Ie6b8f7a7c46becc80d6cf9251fbd5eb5c9c707b1
2016-12-21 12:46:56 +11:00
Luong Anh Tuan 25953aac5d Don't include openstack/common in flake8 exclude list
There is no this directory openstack/common which was used to keep codes from
oslo-incubator, we have retired oslo-incubator. Removing openstack/commonfrom
all OpenStack code in favor of the Oslo libraries is a project wide goal
for the Ocata release. So don't use this directory any more. We should drop it
for improving searching efficiency.

Change-Id: Ibbd158ff0c18a27e6208c98b5765dd22676c2f72
2016-11-09 14:11:39 -06:00
qtang 40e1536043 Add reno for osc-lib release notes management
Change-Id: I95e2df49503e1bce6cf1a329e86a428ddf5db426
2016-07-29 13:04:25 +08:00
Andreas Jaeger 63b84519f2 Remove unused releasenotes infrastructure
There is no releasenotes directory, so the tox releasenotes environment
always fails.

Remove the environment and the reno dependency since both are completely
unused.

Change-Id: I721797f7a53965243ab1d4650c994336e36804dc
2016-07-13 09:44:15 +02:00
Dean Troyer 2bcf7396d8 Begin moving bits to osc_lib
* command
* commandmanager
* exceptions
* logs
* parseractions
* session
* timing
* utils
* test fakes, utils
2016-05-12 16:07:24 -05:00
Dean Troyer f78173f0e1 Rename to osc-lib
* add fresh README and doc tree
* remove references to OSC and commands
2016-05-12 16:06:15 -05:00
Michael McCune fdb2d16236 add a bandit environment to tox
This change is being proposed as part of the OpenStack Security Project
working session at the Austin 2016 summit. It adds support for running
the bandit[1] security linting tool against the python-openstackclient
codebase. This change adds a targetted environment for bandit and also
adds bandit as part of the pep8 job.

The bandit configuration has been tailored to exclude tests that are
currently producing warning against the codebase. These issues will be
followed up with bug reports and patches.

[1]: https://wiki.openstack.org/wiki/Security/Projects/Bandit

Depends-On: Iccd81c17e84df03d249c1012277dad9cb68c5845
Change-Id: I691829c1224557d1d239c9f665ac539d0f13c4d3
2016-04-28 14:52:33 -04:00
Jenkins d3cbfd423a Merge "Defaults are ignored with flake8" 2016-02-26 01:59:47 +00:00
ting.wang 04e9391ceb Improve tox to show coverage report on same window
With this patch coverage report will be shown with the results when
tox -e cover will be run.

Change-Id: I96713a8dd5d82019631c9e48c1abd7a94e201569
2016-02-24 10:44:06 +08:00
Tom Cocozzello 0df25d549f Defaults are ignored with flake8
If “ignore” is not set under flake8 in the tox.ini
file there there are defaults set to be ignored.

The depended patch fixes many of the problems.

Change-Id: Ieed2fe1c4654e201d3fe6d40ef93e247ee736f8b
Doc: http://flake8.readthedocs.org/en/latest/config.html#default
Depends-On: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
Closes-Bug: #1548910
2016-02-23 11:08:36 -06:00
Ondřej Nový 29134b7972 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I521b7cb11374f0600d1f6d4c6529e95aa29654b0
2015-12-11 23:30:31 +01:00
Dean Troyer 3468db9f75 Add reno for release notes management
Change-Id: Iaaf3f9ca7cb431e41adfb2a052e01e2240a63a07
2015-12-02 14:32:07 -06:00
Steve Martinelli 7b921904cf Remove py26 support
as of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.

Change-Id: I66d168ecc755a3ea0e01d5b6344d06d9e0d1378b
Closes-Bug: 1519510
2015-11-24 17:08:04 -05:00
TerryHowe 3f292dceb7 Remove requirements.txt from tox.ini
From lifeless: pbr reflects the package dependencies from
requirements.txt into the sdist that tox builds.

Change-Id: I63548ec321b9c59cc935ba8179b1da5b9c90e09b
2015-07-17 11:21:02 -06:00
TerryHowe 4242004727 Drop py33 support for Liberty
Less is more:
https://wiki.openstack.org/wiki/Python3

Change-Id: I8a98b72f85bb29a3663c654613ac0d70fddbc1b1
2015-07-13 14:50:47 -06:00
Matthew Treinish 1effca8e6f Use ostestr for test runs
This commit switches to use ostestr for running tests. ostestr
integrates the subunit-trace output that other projects use for test
output. (in addition to some other ui niceties)

Change-Id: Ib5b5225b2a7bfb7897e1efe55181389d1ae095cb
2015-05-29 11:31:15 -04:00
TerryHowe fbceb1fc41 Fix functional test gate
The functional test gate seems to be broken.  The environment
variables are not being passed through.

Change-Id: Ied1f56877e4793c5e88e59d2afb7f1a5b3868560
2015-05-15 13:25:37 -06:00