Commit Graph

64 Commits

Author SHA1 Message Date
Hervé Beraud 7c5dfbac3a Fix issues related to tox4
Related to https://lists.openstack.org/pipermail/openstack-discuss/2023-February/032247.html

Change-Id: Ifa9eb53cf6989fb04047edd495c43193a00c43d3
2023-02-17 13:16:08 +00:00
Zuul fda85f1f1c Merge "Remove lower-constraints remnants" 2021-04-16 14:11:32 +00:00
Zuul aadae08b7e Merge "Use py3 as the default runtime for tox" 2021-04-16 13:43:18 +00:00
Hervé Beraud 5505ee3a7e Remove lower-constraints remnants
Change-Id: I21c0ca526394796fb60d50cc5e2a703c575b68bd
2021-04-16 11:52:31 +01:00
Hervé Beraud 46bcafb74e Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

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

Change-Id: I69cb454902b1c153ca09bfb713d5748aa0dd532a
2021-01-14 11:04:24 +01:00
Hervé Beraud b763302576 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I138a808e799e4969af8542346289737c544a3c5e
2020-11-04 10:05:53 +01:00
Hervé Beraud cef0e7cc4c Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
  (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
  (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: I593196cf0d099fe1dcc3a6298fd6cc6b7a883ea2
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 12:28:20 +02:00
Sean McGinnis e37be9d362
Bump default tox env from py37 to py38
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.

This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.

Change-Id: Ie160ee9faca27890e5fdcd21b1212d6c93cde735
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:52 -05:00
Andreas Jaeger d16593eb10 Document disable flake8/hacking warnings
document the ignored warnings in tox.ini.

Change-Id: I4d22611f6676e96e5d5287bee4620e16ad41c3a1
2020-03-30 14:57:58 +02:00
Andreas Jaeger 724f36bd3e Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix:
F601 dictionary key 'cr_to_rp' repeated with different values
F841 local variable 'excep' is assigned to but never used
F821 undefined name 'excep'
E305 expected 2 blank lines after class or function definition, found 1
E731 do not assign a lambda expression, use a def

Blacklist:
W504 line break after binary operator

Update hacking extension for newer flake8 version.

Change-Id: I9f0d7b166e285091111c42fe978d29d7dd3bf5db
2020-03-30 11:56:00 +00:00
Daniel Bengtsson 7f8a8dbe2e Update the tox 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. Remove the useless install_command
parameter.

Change-Id: I17588a5702fa1f9429dd6bc2d1a8c4ad9e90c539
2020-03-10 12:06:42 +01:00
Hervé Beraud 2961c30bce [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I4b1f1b65d21340e76971d2bf31ee79d97392c454
Sem-Ver: api-break
2020-02-04 17:16:27 +01:00
caoyuan fa7a6e35e5 tox: Trivial cleanup
move 'basepython' to the top-level 'testenv'

Change-Id: Ic3474388671341921bbfe3267405b4d90412ace0
2019-12-23 13:07:44 +00:00
caoyuan 127ded28c9 tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: I390f8f7add7530f1442f66816389202e3ed21f05
2019-10-24 14:50:28 +08:00
ZhongShengping c59246530f 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 detailed information, please refer to:

http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Id20646cd51ffc13cf4e77c640eb677fe376c1b1f
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
2019-07-19 10:56:20 +01:00
Corey Bryant f1c25b189f 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: I4625a70e74f5c01c7b69ef14f1112c5057d10255
Story: #2005924
Task: #34234
2019-07-19 09:50:21 +00:00
Stephen Finucane ce3122c2f1 Add local bindep.txt
As it was announced [1] global bindep-fallback.txt was removed and now
projects need to have a local bindep.txt to be able to install binary
dependencies for testing.

We use lxml which requires a number of underlying packages.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html

Change-Id: Ie635fa5d613cb89f8de8c8c8d5b119621acb926d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-07-18 10:38:26 +01:00
Ghanshyam Mann 462eb63cc9 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: I29cc5d550d36fc2d80ca4364aa972567fa70d280
2019-05-14 18:41:58 +00:00
jacky06 d57de111f4 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I335d3b2493f53a305ec0e22c31d817ca8ba87e40
2019-05-05 13:05:49 +08:00
Vu Cong Tuan d1cfde2b6d Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Iea425a8583f7396cc4e9d6964f3efa9875dc59ac
2018-07-04 07:54:50 +07:00
Doug Hellmann a7154d7416 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: I1c8016a76062f21c7413da9fc3d422677a40712e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-07 13:03:44 -04:00
Kenneth Giusti bcf2977497 Remove stale pip-missing-reqs tox test
pip_missing_reqs tool is no longer maintained and has broken with
release 10 of pip

Refer to:
 http://lists.openstack.org/pipermail/openstack-dev/2018-April/130027.html

Change-Id: I30bfdeca565a21867ea8c1ddedca5d74293008cd
2018-05-02 11:17:16 -04:00
Doug Hellmann cda1daf83c set default python to python3
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.

Because flake8 now runs under python 3 there is no built-in name
'file'. Instead we can use the same symbols from the io module to
build the spec for mocking out the open() call. The old version of
that code that used to only run under python 3 used a private version
of the io module, so that is also corrected.

Change-Id: I2491e65736d2c79f1134eec6371967c39873891b
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-16 14:45:12 -04:00
Zuul a7c32f35bd Merge "add lower-constraints job" 2018-03-29 06:31:12 +00:00
Doug Hellmann 9432188ac0 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: Ie6b0b270193f4e8eb20fd2d98f315a9dc2abe05b
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:03:02 -04:00
Saju 87becf6a46 pypy is not checked at gate
Change-Id: I8977570e734801fca4c5cec5207e29dd4a0e5339
2018-03-21 21:38:09 +05:30
Andreas Jaeger 9574ad69ac 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: I2b4bf1e1c970afea899521e3cab08a817a186782
2017-12-02 19:29:03 +01:00
Andreas Jaeger fed9e7cea5 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: I0e3485e2cab064db3f8faf85c406c83720fb0242
2017-12-01 09:56:54 +01:00
Jenkins 276cff6a95 Merge "Improving cover testenv" 2017-07-13 11:22:10 +00:00
Nguyen Van Trung 45c4ba26bb Improving cover testenv
- Add whitelist_externals envconfig setting
- Add percentage report to further analyze code-base

result:

Name                                Stmts   Miss Branch BrPart     Cover
------------------------------------------------------------------------
oslo_vmware/__init__.py                 0      0      0      0   100.00%
oslo_vmware/_i18n.py                    4      0      0      0   100.00%
oslo_vmware/api.py                    205      5     50      6    95.69%
oslo_vmware/common/__init__.py          0      0      0      0   100.00%
oslo_vmware/common/loopingcall.py      76      8     20      8    83.33%
oslo_vmware/constants.py                5      0      0      0   100.00%
oslo_vmware/exceptions.py             155     12     30      2    90.27%
oslo_vmware/image_transfer.py         117     23     22      4    77.70%
oslo_vmware/image_util.py               9      0      0      0   100.00%
oslo_vmware/objects/__init__.py         0      0      0      0   100.00%
oslo_vmware/objects/datacenter.py       9      0      4      0   100.00%
oslo_vmware/objects/datastore.py      172     18     56      8    87.72%
oslo_vmware/pbm.py                     94      8     20      0    92.98%
oslo_vmware/rw_handles.py             289     52     52     10    80.65%
oslo_vmware/service.py                239     14     88     12    90.21%
oslo_vmware/version.py                  2      2      0      0     0.00%
oslo_vmware/vim.py                     14      2      2      0    87.50%
oslo_vmware/vim_util.py               218      1     56     10    95.99%
------------------------------------------------------------------------
TOTAL                                1608    145    400     60    88.79%

Change-Id: Ib5dc6a9f0600f7399d0a773e8a78102bbbfd7893
2017-07-08 23:06:52 +07:00
Ngo Quoc Cuong c5aed4fe30 Add hacking rule to prevent log translations
Since we have removed log translations completely, we should also add
hacking rule to prevent future mistakes

Change-Id: I8df524e23ab072d198cbc256e8018671e5f32764
2017-07-03 02:47:10 -04:00
Eric Brown 99d23f8bfa Remove references to Python 3.4
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.

Change-Id: I067d84b89167c5e84373cb0656348d3e7a573a45
2017-01-05 15:36:32 -08:00
Tony Breeds 0c3a089d10 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 oslo.vmware.

Change-Id: I6d20d90191f5b0e9dce17affd7aca40081cf7cc7
2016-12-13 15:40:18 +11:00
Eric Brown 04ad3d8c79 Add a py35 tox venv for upcoming py35 support
Soon the gate jobs will support Python 3.5. This patch adds the tox
virtualenv in preparation for the move from 3.4 to 3.5.

Change-Id: I8eb0289b4ce4cfbc47ad79affa7af6ea3dac73d0
2016-07-06 08:20:26 -07:00
Kirill Bespalov 2e9ba24c04 Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: I67132d71d478ab5aca9b19c2c417aaaf51357748
2016-05-24 15:06:34 +03:00
ChangBo Guo(gcb) 0ae1810e1f Trivial: ignore openstack/common in flake8 exclude list
The directory openstack/common doesn't exist any more.
So remove it from flake8 exclude list.

Change-Id: I36cabd08d1e89b2f2e42ec7c97e9282c2dd8e36c
2016-05-12 10:20:58 +08:00
Eric Brown fa93ed4972 Move bandit into pep8
Run security linter bandit as part of pep8. Pep8 is the usual linter
target and thus let's use it there instead of starting another node
for this short-running job.

Also reduced the lines of context from 5 to 3 since it shouldn't
matter to most.

Change-Id: I54a4fccebb375517f9cd129f62f8f0c795b6edcc
2016-02-25 09:02:07 -08:00
Eric Brown 8b1dc76f97 Remove bandit.yaml in favor of defaults
The bandit.yaml is only necessary for advanced tweaking. None of
which is necessary for oslo_vmware.

Change-Id: If06c64e0b5278a000d02c34fe10288a67182357b
2016-02-04 14:09:56 -08:00
Janonymous f044ac1273 Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.

Change-Id: I9dd91b4b58e84c9f73b1e662aa24a779629a8a37
Closes-bug: #1489059
2015-12-22 18:25:28 +05:30
Davanum Srinivas f6bae5c24d Remove python 2.6 and cleanup tox.ini
* Remove support for python 2.6
* Remove setenv : We can just use the default as
  we don't need any extra environment variables
* Remove requirements.txt from deps, as this is
  already added automatically


Change-Id: Iff527b5e96cd2f2f1b3fc56f65bb984c37d8b276
2015-11-16 00:35:08 +00:00
Ronald Bradford 865f000842 Fix coverage configuration and execution
A number of configuration errors prevent the successful creation of code
coverage. This corrects the .coveragerc source/omit setup and the tox
package name generation.

http://lists.openstack.org/pipermail/openstack-dev/2015-October/076193.html

Change-Id: Ife807248caa66472bb30027eef3e68aedb035e7d
2015-10-08 17:24:38 -04:00
Eric Brown 0a0e7e8bae Update bandit.yaml to the latest
The existing bandit.yaml was based on 0.10.1 version of bandit.
Commit I9504c44ac575b47b256496e833dd53a9dce113d2 adopts version
0.13.2 of bandit.  As a result, the bandit.yaml needs to be synced
with the standard version.

Also, with the newest bandit, some #nosec tags can be removed.

Change-Id: I503cd33d401b104aa502e7909f949c438a6248e6
2015-08-18 07:57:06 +00:00
Davanum Srinivas 41fa6ab38b flake8 - remove unused rules
Change-Id: If09a1c2d6fef10f14cf0b577f8285b83fc2c7254
2015-08-08 11:41:58 +00:00
Davanum Srinivas 440570c0ee Add tox target to find missing requirements
Change-Id: I44ce0015cd12148120ae590362473f15ba376285
2015-07-02 00:43:40 +00:00
Eric Brown 84492c14a7 Fix bandit tox environment to properly run
These changes were necessary:
- Move bandit dependency from test-requirements-bandit.txt to
  test-requirements.txt
- Only print high and medium severity errors (-ll)
- Rename blacklist_functions to proper plugin name of
  blacklist_calls

Change-Id: Ibf2a16e3fc62aadc995c70b5dfe2258f1cf23f85
2015-06-09 13:44:54 -07:00
Davanum Srinivas 7758123c3d Remove support for Python 3.3
Change-Id: I2353396e505452ecb05b19f59f2620f5a7d895b6
2015-05-11 07:00:47 -04:00
Victor Stinner 1986196ece Use suds-jurko on Python 2
Replace suds dependency with suds-jurko on Python 2. It was already used
on Python 3.

suds-jurko is actively maintained (latest commit in december 2014) and
supports Python 3, whereas suds doesn't seem to be maintained anymore
(last release in 2010).

suds-jurko is a drop-in replacement for suds, both packages provide the
same Python module.

This change removes requirements-py3.txt because they are no more Python
3 specific dependencies.

It also fixes a bug in packaging: currently, oslo.vmware provides a
single wheel package for Python 2 and Python 3 whereas dependencies are
different. suds is incompatible with Python 3 and so the oslo.vmware
wheel package cannot be installed on Python 3.

requirements-py3.txt contained oslo.serialization and httplib2
dependencies. These dependencies were removed from requirements.txt by
the commit 6d8594ae51,
requirements-py3.txt wasn't updated.

Update py33 and py34 test environments in tox.ini to use
requirements.txt instead of requirements-py3.txt.

Change-Id: I699c65e4abd607ea6f377d86c45fd609569f3c2b
2015-05-05 12:11:59 +02:00
Eric Brown 32c61ee8b0 Add bandit to tox for security static analysis
This patch adds security static analysis to tox as an optional
target.

Change-Id: Id74a190e893326a587911e32593040bcb844d3e9
2015-04-23 07:45:32 -07:00
Doug Hellmann 3879e83ff6 Move pylint dependency to tox.ini
We do not run a gate job against oslo.vmware using pylint, so move the
dependency out of the synced requirements and into the tox environment
settings instead. If that's no longer useful, we can remove the tox
environment completely.

Change-Id: Ice3527b8d92137d04fd77e7e800a5875fa7fdaf2
2015-03-20 16:14:43 +00:00
Doug Hellmann 48771e6bfd Move files out of the namespace package
Move the public API out of oslo.vmware to oslo_vmware. Retain the ability
to import from the old namespace package for backwards compatibility
for this release cycle.

bp/drop-namespace-packages

Change-Id: I11cf038c3832a7357ed53363d8ccf143daddd2a2
2015-01-12 13:22:13 -05:00