Commit Graph

106 Commits

Author SHA1 Message Date
Stephen Finucane 194f59bea3 tox: Bump min_version to 4.3.0
tox 4 is significantly faster when it comes to creating virtualenvs and
is far better and detecting e.g. changes to requirements. tox 4.3.0
includes many of the fixes for bugs introduced by tox 4.0 and is a good
default candidate.

Change-Id: I0bb7f75ed3e03965ecd4d260c1299b46dcbf4b1b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-08-25 11:35:16 +01:00
Stephen Finucane 3ba55118eb tox: Disable E501
This is more trouble than it's worth now. Black takes care of this for
us. I wish I'd decided this before the blackify series :(

Change-Id: Ifee786c96b6f0bcd96008fed2b3ed3257d02c07c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-31 17:39:59 +01:00
Stephen Finucane 6475dc58e8 Blacken openstackclient.network
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I8048746dbc2ef0cb582f68934734db4c1153d779
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane 5cb16aebcc Use pre-commit for 'pep8' tox target, bump versions
We want to bump the versions of hacking, but doing so requires changes
in two places: '.pre-commit-config.yaml' and 'tox.ini'. This is silly:
we can simply use tox to handle pre-commit and leave all other
dependencies to pre-commit. Do this, migrating bandit to pre-commit and
bumping the other dependencies in the process.

We remove the 'fast8' target and tool, since pre-commit is plenty fast
here.

Change-Id: Ifdc582ecc3b4479ea9ed9abcb16577c6e8b2f5c1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:00 +01:00
Dr. Jens Harbott 5501ac7d1d Fix tox v4 compatibility
Various changes to tox.ini to support v4

Change-Id: Iee2bceb78f5b03c559f23b99cde57fd598ce981a
2022-12-26 15:56:28 +01:00
Stephen Finucane 45bec041b2 quota: Add 'quota delete' command
We had previously indicated that people use 'quota set' for unsetting a
project's quotas, however, there was nothing that actually allowed us to
do this. Correct that oversight.

Change-Id: I04057e766b8ccf94bf219972249b68dc2bb796d4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 10:54:11 +01:00
Zuul 366e164738 Merge "Stop testing lower-constraints" 2022-07-01 18:01:08 +00:00
Zuul ed304992eb Merge "Changed minversion in tox to 3.18.0" 2022-06-01 15:54:37 +00:00
likui c677192d51 Stop testing lower-constraints
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-October/018445.html

Change-Id: I45e9a81d451c64cdd51f9b606d94161742bacdb7
2022-05-14 11:02:12 +08:00
Stephen Finucane a797c9d2a3 tox: Ignore virtualenvs for pep8 environment
Change-Id: I473d1b6c1287325566a5f5f5aadaea802c6af6f4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-10-21 17:14:45 +01:00
Zuul 30bb576d81 Merge "Fix the functional-tips tox environment" 2021-10-07 11:06:13 +00:00
Jeremy Stanley 98979cfc7f 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: I05c1cc0c2fbf77021cc1e05bc96bee03528c69f0
2021-06-17 17:07:39 +00:00
wu.shiming 1169a114e7 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Ibb77fa2afad3f09e95f0dba243d3a096daedd787
2021-06-03 07:00:29 +00:00
Jens Harbott 1f0fcbcd1d Fix the functional-tips tox environment
The egg for the keystoneauth project is actually called keystonauth1.
Seems newer pip actually complains about the difference and fails.

Change-Id: I1602832d33cd467745a03b36c9b1545cd069ba1d
2021-05-11 11:24:59 +00:00
Stephen Finucane 20769cd7b2 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: Cannot install ... because these package versions have
  conflicting dependencies.

  The conflict is caused by:
      bandit 1.1.0 depends on PyYAML>=3.1.0
      cliff 3.4.0 depends on PyYAML>=3.12
      openstacksdk 0.52.0 depends on PyYAML>=3.13

Bump our lower constraint for PyYAML to resolve this issue. With that
resolved, we see a new issue:

  ERROR: Could not find a version that satisfies the requirement
  cryptography>=2.7 (from openstacksdk)
  ERROR: No matching distribution found for cryptography>=2.7

This is less self-explanatory but looking at the lower-constraints for
openstacksdk 0.52.0 shows a dependency on cryptography 2.7 [1], meaning
we need to bump this also.

Next up, flake8-import-order seems to cause the dependency resolver to
go nuts, eventually ending with the following error message in a Python
3.6 environment:

  Using cached enum34-1.1.2.zip (49 kB)
    ERROR: Command errored out with exit status 1:
     command: ...
         cwd: ...
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File ".../lib/python3.6/site-packages/setuptools/__init__.py", line 7, in <module>
        import setuptools.distutils_patch  # noqa: F401
      File ".../lib/python3.6/site-packages/setuptools/distutils_patch.py", line 9, in <module>
        import re
      File "/usr/lib64/python3.6/re.py", line 142, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'
    ----------------------------------------

A quick Google suggests this is because the enum34 package is not
complete [2]. We shouldn't even be using it since our base virtualenv
should at least use Python 3.6, but I guess some dependency doesn't
properly restrict the dependency to <= Python 3.4. This is moved from
'test-requirements.txt' to 'tox.ini' since we don't need to use our
constraints machinery for linters.

Finally, the versions of bandit and hacking that pip is bringing in both
requires in a newer version of babel, which in turn requires a new
version of pytz.

  Collecting hacking>=2.0.0
  ...
  ERROR: Cannot install oslo.i18n because these package versions have
  conflicting dependencies.
  The conflict is caused by:
      babel 2.9.0 depends on pytz>=2015.7
      babel 2.8.1 depends on pytz>=2015.7
      babel 2.8.0 depends on pytz>=2015.7
      babel 2.7.0 depends on pytz>=2015.7

Seeing as we shouldn't be tracking bandit in
lower-constraints, I'm not sure why we're want to bump these
dependencies for just that. As above, we move these dependencies out of
'test-requirements' and into 'tox.ini' since we can do that for linters.

[1] https://opendev.org/openstack/openstacksdk/src/tag/0.52.0/requirements.txt#L19
[2] https://github.com/iterative/dvc/issues/1995#issuecomment-491889669

Change-Id: I8ec738fbcabc8d8553db79a876e5592576cd18fa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-12-08 10:55:57 +00:00
Elod Illes 5b04a86d1f Replace deprecated UPPER_CONSTRAINTS_FILE variable
UPPER_CONSTRAINTS_FILE is deprecated and TOX_CONSTRAINTS_FILE is
the new environment variable name that replaces it [1].

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

Change-Id: Ic0d2dcf20f7929733deb10a275e5d67f9627428f
2020-10-28 12:37:58 +01:00
Zuul 7046562919 Merge "bump py37 to py38 in tox.ini" 2020-10-01 13:14:02 +00:00
maaoyu 4b709a2c04 Remove install unnecessary packages
The docs requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I35a367505b2b423c345b05519e4134113cb66648
2020-09-24 17:09:49 +08:00
wangzihao cbc1fb08ec bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.
and remove redundant python env.

Change-Id: I6426cc55ee9b6bee96620a8185fbdb39c24a68a8
2020-09-18 11:15:47 +08:00
Monty Taylor 7696593dc1 Remove os-client-config references
We've depended on openstacksdk for config for ages now, clean up
after ourselves and stop installing it in tests.

Change-Id: I66b3ec2a36bc462d2f1ac151e95ccbdc946076b8
2020-06-08 16:20:28 -05:00
Daniel Bengtsson bf2beb9e86 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.

Change-Id: I410173d5fdcd8c592d98eed2f48b98e06299e8b3
2020-03-16 08:00:44 +01:00
Monty Taylor 32080f7a42 Bump tox minversion
ignore_basepython_conflict was introduced in tox 3.1.0.

Change-Id: I7a6049b6a4fd3ee376a3478e94837c0afe89d4df
2020-01-07 09:22:30 -05:00
Daniel Bengtsson 924627678d Stop testing python 2 in tox and zuul.
Remove python 2 from envlist parameter. Check the link:

https://etherpad.openstack.org/p/drop-python2-support

The plan is drop the python 2 support from OpenStack in Ussuri release.
Remove the zuul jobs.

Note that the (non-voting) openstackclient-check-plugins job is still
running under py2 at this time. That will need to be fixed in the
python/openstackclient repository where the job is defined.

Change-Id: I3148db053b9ef0fcf7dc88e5cc075d974c93d819
2019-12-06 16:06:36 +00:00
Eric Fried 6f07828bf0 Add redirect testing
Adds a dependency on and invocation of the `whereto` command to validate
redirects in the .htaccess file during doc builds.

Change-Id: Ib6cc2953f0fd774de3c3a0c8a2bd6cff49667c14
2019-11-05 07:09:05 -06:00
Stephen Finucane 6419533f43 Bump hacking version
Pick up newer versions of this library. Thankfully no serious changes
are needed.

Change-Id: I69e523844529fc1c8aa0c1ce764182dbe29cfeb6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-08-27 17:12:15 -05:00
Corey Bryant b41d7518c3 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: I7d0a996b33d4d1eec436f92fbd390968cd37630c
Story: #2005924
Task: #34232
2019-07-05 14:33:43 -04:00
Zuul d270174a21 Merge "Add Python 3 Train unit tests" 2019-07-03 04:03:30 +00:00
pengyuesheng d16d98b27b Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Ie0a41fa97696bcd8b5fd2e670efdf9379ff1080e
2019-07-01 15:13:11 +08:00
pengyuesheng 5986f47306 Add Python 3 Train unit tests
See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I897645a4cb9f03ca464daa14f0895572212b81d9
2019-07-01 15:08:23 +08:00
Ghanshyam Mann a8309a2a85 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: Ie7bcc327fd588a1ff6b2556d49017df56bc55bf8
2019-04-22 23:45:27 +00:00
Dean Troyer 0f56b7d074 Followup opendev cleanup and test jobs
* upper-constraints references need s/plain/raw/

Change-Id: I04368dc42f1a62a048ac9d11497747ef6f600515
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-04-19 23:47:02 -05:00
whoami-rajat 0a187905c0 Add py36 env
While running `tox` command in binoic env, we see the following
message,
ERROR: InterpreterNotFound: python3.5
It is because the default py3 version for binoic is py36.
This patch adds the env in OSC also maintaining consistency
with setup.cfg

Change-Id: I8e5cf72901cba34ad44f2b356609f85b3b0c431f
2019-02-13 12:43:20 +05:30
Monty Taylor 2dd5393167
Use os-cloud instead of OS env vars for functional tests
In order to support switching auth contexts, such as for registered_limits
which take a system scoped token, switch the functional tests to using
the --os-cloud command line parameter. However, honor the OS_CLOUD env var
as a way that someone can select a different cloud, including 'envvars',
to use.

Use devstack-system-admin cloud for limit tests

Keystone requires these to have system scope now.

Change-Id: Ia81eebd3e00ae986cf3ba7e3d98f3e8a1647b622
2019-01-10 14:21:03 +00:00
Doug Hellmann 544f0e2b3f 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: I051f1c18b719a27372b626d483e47327085dd3b7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-09-26 18:45:25 -04:00
Stephen Finucane 63d741fd66 Replace pbr autodoc with sphinxcontrib-apidoc
This fixes local building of the documentation using tox, and allows the
gate to stop relying on pbr and move completely to the new docs PTI.

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

Change-Id: I485acda07098a435753e91c1ca45e586de199c35
2018-07-10 17:15:26 +01:00
Doug Hellmann bf32cdf3a9 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: I4a4ca9726fab1d0cf9a33311201b7f65951a0942
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-25 11:27:13 -04:00
Monty Taylor 6168ca7a89
Rename python-openstacksdk to openstacksdk
Depends-On: https://review.openstack.org/554662
Change-Id: I6169f9e98418055c7c3ae5bc3b76b1216703cd55
2018-03-23 08:46:00 -05:00
Matt Riedemann 8468b2a064 Fix tox -e venv -- reno new <slug>
Change I7e8c47dead1e019e8705db3ff7559dd39b1d90d9 broke
the ability to create a new release note from the venv
tox target because the reno requirement was moved from
test-requirements.txt. This fixes it.

Change-Id: Ifac83121388728fa445e0ed4433c9d981c057737
2018-01-27 20:46:32 -05:00
Doug Hellmann 189aec9b18 Partially Revert "Update new documentation PTI jobs"
The zuul job figures out whether to run "setup.py build_sphinx" or
"build-sphinx" based on whether the project is relying on pbr's
ability to auto-generate API reference docs. Because we are relying on
that, we want local builds to use "setup.py build_sphinx".

This reverts commit 42e0037cd0.

Change-Id: Ia01188110fa9c3ccaf3d794fa3a511a6780e683e
2018-01-17 10:16:17 -05:00
Guoqiang Ding 42e0037cd0 Update new documentation PTI jobs
For compliance with the Project Testing Interface as described in [1].
For more detailed information, please refer to [2].

[1] https://governance.openstack.org/tc/reference/project-testing-interface.html
[2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: I7e8c47dead1e019e8705db3ff7559dd39b1d90d9
2017-12-28 16:16:28 +00:00
Masayuki Igawa bafe5357c2
Switch to use stestr directly
This commit makes to use stestr instead of ostestr
directly. ostestr>1.0.0 has started to use stestr instead of
testrepository. So there is no reason to use ostestr anymore.

Change-Id: I6327d50c9f6dd19f1de24b9b51532104fb3e916e
2017-12-27 16:18:49 +09:00
Dean Troyer 1d914dd9ad Fix SDK Connection creation alternative to Profile
Do a dummy import to determine which SDK is installed (Pre/post merge).

This solves the DevStack error "Cloud defaults was not found" in -tips jobs.

Depends-On: Ia111f127fbdceac2afe20fd9d1fe032145cdd72c
Change-Id: I60c2d418dd5a393eee2cc2a5c2fdebfffdabf2d3
2017-12-07 08:10:23 -06:00
Andreas Jaeger 0bf69a9462 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: I9f818d4b78e7540498a1501be14cd63ac3e891b3
2017-12-02 19:21:22 +01:00
Monty Taylor 8b32b53a0f
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: Ie7c06ead39c8597ec9326f223625d1fa0d5208d1
2017-12-01 10:26:50 -06:00
Monty Taylor b061b9c34e
Add cliff and keystoneauth to tips jobs
Both of these can severely break openstackclient. Add them to the
required-projects list of the tips jobs. We should then add at least
osc-tox-unit-tips but maybe also osc-functional-devstack-tips to both
cliff and keystoneauth so that it's symmetrical.

Change-Id: Ie0f3e9d7e221c9cdd3c5d726148f456246186ff4
2017-12-01 10:19:34 -06:00
Dean Troyer 90230c3766 Zuul job updates
* Add unit-tips job to run unit tests with the same project master branches
  as the functional-tips job (mostly useful for the unit.integ tests)
* Add irrelevant-files to the osc-functional-devstack-base job
* Comment out the functional-n-net job as it is horribly broken for now
  until the replacement package-installed OpenStack is ready

Change-Id: I5acdcb0a2f0f0dfe488740ae0add36366cc0ee21
2017-10-27 12:40:24 -05:00
Dean Troyer 676159555f Native DevStack jobs
Convert legacy DevStack jobs to native Zuul v3 form, plus some
test-job-related docs updates.

Change-Id: Ia8c08be81605da885b9eee799fc58129305dfc41
2017-10-24 17:35:55 -05:00
Monty Taylor ef595fcfc4 Add wrapper around ostestr
The functional tests assume that an openrc file has been sourced. Make a
simple wrapper that will do that.

Change-Id: I42584aaebcbca99a8c922f6ff90c8bbce57bbfbb
2017-10-23 08:34:15 -05:00
Dean Troyer 7274e8efe6 Updates for stestr
Change-Id: I860981f06e31abda3141a0cb4fd13a0d49080b50
2017-09-15 06:32:58 +00:00
Akihiro Motoki ff85c62707 flake8-import-order: Ensure to place project imports last
To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checked only standard imports or not.

Change-Id: Iad7afa456cec7cf5b44955f1ea03c593a4c0e426
2017-08-22 21:38:07 +00:00