Commit Graph

73 Commits

Author SHA1 Message Date
Hervé Beraud 515daab81a Fix issues related to tox4
Change-Id: I7be9a22796f484df79f0f509a2cf4f47e3a00128
2023-02-17 17:49:38 +01:00
likui 807d9c5ca4 Replace deprecated UPPER_CONSTRAINTS_FILE variable
UPPER_CONSTRAINTS_FILE is old name and deprecated

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

Change-Id: Ie7971577aeba299aaf9406fc97793d946342eaeb
2021-06-03 10:11:29 +08:00
Zuul b38217691e Merge "update doc url" 2021-04-12 16:50:25 +00:00
likui 50723fa870 remove lower-constraints.txt
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html

Change-Id: I407b2c9bc6e9c1cd5b070a1cdca7c0eabe19b0ca
2021-01-16 15:51:31 +08:00
Zuul 68cefad313 Merge "tox: Enable parallel docs builds" 2020-11-05 21:54:01 +00:00
Hervé Beraud ab18255dcd 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: Iab5475c25b3ff1ffd0b10766ab0a5dbd4b1c821a
2020-11-03 16:13:27 +01:00
likui 3cf6c60d81 update doc url
Change-Id: I227172cb51ea357a2c807fa080b0eaf7fd312e78
2020-10-30 11:20:26 +08:00
Hervé Beraud 5e1011a630 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: I65a40bbff17d92b959764846801d5e0ddd3b97ce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:25:01 +02:00
Stephen Finucane ea51c21bd9 tox: Enable parallel docs builds
While we're here, specifying the doctree directory and configuring use
of saved environments doesn't really make sense when we blast all
previous doc build artefacts away on each build, so stop specifying
those.

Change-Id: I2b04a5c0ac121954aed91ae133e249a2e5813ee0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-09-10 16:36:53 +01:00
Zuul 13f16e23ae Merge "mypy: Add boilerplate configuration" 2020-03-07 21:39:29 +00:00
Stephen Finucane 5a5cf72c64 mypy: Add boilerplate configuration
Add the requirement, tox job, and basic configuration.

Change-Id: I3a865255ee731a27a00e7653557099fb99096486
2020-02-12 09:56:58 +00:00
Hervé Beraud b764ae19de trivial: Cleanup tox.ini
Update the minversion parameter to use the python -m pip to install
python packages:

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

Also Inherit the jobs requirements to simplify maintainance.

Change-Id: I730f15a4872334f040d5bd03da37e7c4f9e8148b
2020-02-11 15:33:00 +01:00
Stephen Finucane 4e071eb034 [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: I13ce8e8264679a19c7b108381ccb969573ea9ac6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Sem-Ver: api-break
2020-02-03 15:12:02 +00:00
Hervé Beraud db72309ae8 tox: Trivial cleanup
Move 'basepython' to the top-level 'testenv'.

Change-Id: I4957925d96c2eea0f9a2d791feb71b6d3f54a224
2020-01-08 20:00:56 +01:00
Daniel Bengtsson f0c992f5c0 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: Ibcdd3a9f7e7ea421e906cf1d96f95b516008b5d7
2019-11-14 15:05:29 +01:00
caoyuan 0f7244f9dc 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: Ied9f46640cf2f338a5784e1c72998f93b5c860c5
2019-10-24 14:04:44 +08:00
pengyuesheng 064aaa0e24 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Ib1d98cf2feb7837c7c4c2922a48cbc9f0bf0d3ef
2019-09-23 16:17:30 +08:00
Zuul 01a632e243 Merge "Clean up the unnecessary sphinx from test-requirements.txt" 2019-08-12 14:56:56 +00:00
caoyuan 8955b48620 Clean up the unnecessary sphinx from test-requirements.txt
1. Clean up the unnecessary sphinx from test-requirements.txt
2. when run `tox -e docs` in localhost, some files will be
created, it not belong to the code, shoule be ignore by the git

Change-Id: I2bae30fedfdc64fbbafbe0e96794597b564c2d54
2019-07-07 11:59:49 +08:00
Corey Bryant 2488c1e1ce 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: Ia547c6f2e27c12ef58eb955286b5f2ab5359c2e2
Story: #2005924
Task: #34234
2019-07-05 14:43:07 -04:00
Ben Nemec 9513d26b47 Fix coverage tox venv
We need to configure tox to actually run coverage or we get no data
for coverage to combine.

Change-Id: I6dc1601e628ac1090ce7a277c2be4b97f8577058
2019-06-03 18:00:43 +00:00
Stephen Finucane 893d6c1131 Revert "Replace git.openstack.org URLs with opendev.org URLs"
This reverts commit 034a90d005.

Change-Id: Ief33299e46242d9435a382116cf51c2780cc1beb
2019-05-03 20:36:15 +00:00
jacky06 034a90d005 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I292921cbee1f24857f0ee32cc010a8e3e6f1b8ad
2019-04-23 13:25:30 +08:00
Ghanshyam Mann a73e55d1bd 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: I915a7c690e127aaf271b3862bbbd63fca582ae2b
2019-04-15 18:58:28 +00:00
Stephen Finucane 0950403744 tox: Suppress output
As noted in I1678bcd26b41fdf09f98c36fc095d6d4c1826deb (for pbr), we need
to pass some flags [1] to stestr to ensure stdout is captured in
additional to any logs.

We also make it easier to override this capturing and remove some errant
whitespace.

[1] https://github.com/mtreinish/stestr/commit/1316ebd7

Change-Id: I5d98c2b8e31b4eb4741dfa5055a5628140b1add5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2019-04-08 16:45:12 +02:00
Stephen Finucane 3e905ff28c tox: Whitelist 'find'
Fixes a warning.

Change-Id: I5a689666553b7bc926ce936d123f3bccb68cb165
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-02-28 15:28:42 +00:00
Rui Yuan Dou 819534b20b Migrating oslo.config to use stestr
os-testr has moved over to use stestr instead of testr. While this
is usually compaible with existing settings, there is a warning
that is emitted when .stestr.conf is not present. It is usually
able to fall back to parsing the .testr.conf file, but to be more
correct and to prevent future problems we should update the config.

Change-Id: I929f75d069f20b8cfa8af4e0712883e91a54dc4f
2019-01-15 16:15:34 +08:00
Stephen Finucane d85735d1b2 tox: Fix typo
This was introduced in change I87b30273. While we're here, we also start
passing positional arguments to 'sphinx-build' so we can configure it
somewhat dynamically.

Change-Id: I766da57377cd2ddb0a82419e36eeec1046309948
2018-06-18 12:33:08 +01:00
Doug Hellmann c8a8f4eba1 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: I4b329f3233ce126fb25bff6c947aa8379b991d59
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:57:00 -04:00
Kenneth Giusti 96e9a3471a 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: I08712ccb25ecda617bb90363c5171f8720a34029
2018-05-01 09:24:01 -04:00
Doug Hellmann 8f97bdb646 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.

Change-Id: Ief7f053de13287bc3c1032870c255be4b880d172
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-12 15:56:56 -04:00
Ben Nemec f95a6ff35e Switch pep8 job to python 3
pep8 under python 3 is more strict than under python 2, so to make
sure our projects meet the more strict standards we want to run the
pep8 jobs using python 3 by default.

Change-Id: If3016aef3a75281ff9edb5615bbc4575e6214e9e
2018-04-12 16:42:21 +00:00
Zuul 0aedd36684 Merge "Clean old output before new doc builds" 2018-04-10 20:43:31 +00:00
Zuul e713fa9f59 Merge "add a job to run unit tests against the lower bounds of our dependencies" 2018-03-26 18:11:46 +00:00
Doug Hellmann 98aba84d71 add a job to run unit tests against the lower bounds of our dependencies
This is part of the migration to stop syncing global requirements into
projects.

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

Depends-On: https://review.openstack.org/555034
Change-Id: Ie768d173b0940bea0d8c299a17cf2dbd6fc6e2fd
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:20 -04:00
Sean McGinnis 9ca9546fd1 Clean old output before new doc builds
Remove the doc/build directory to make sure there are no stale
artifacts from past runs.

Change-Id: I87b302733402cc096eecacebbbc5631aebc42948
2018-03-21 16:15:01 -05:00
Sean McGinnis 7d250abe04 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: I46a861f88166b3b2de0a532cc88beef1ef91ab89
2018-03-21 15:59:01 -05:00
Andreas Jaeger a6a4f279ef 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: I400b848c79955a8fcb08cdd46e043660df67589c
2017-12-02 19:27:57 +01:00
Andreas Jaeger 7071b0f392 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: I7a266b2209097ff2db0e43076c0e8621cfece5f1
2017-12-01 08:08:56 +01:00
blue55 3ac6be2b96 Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

Change-Id: I0a99014f983c24a8d36533e36cf56ed8d7a74c5c
2017-06-22 10:48:40 +08:00
Eric Brown 08eff4f4d6 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: Iacd8ea7388a8e7c0c28b184a4b823a95aa04b987
2017-01-09 10:05:36 -08:00
Tony Breeds 30dbe55791 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.config.

Change-Id: I98622a0d783aa759e73df4e594afe409ad141bab
2016-12-14 22:04:42 +11:00
Eric Brown 335b1845b7 Add Python 3.5 classifier and venv
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.

Change-Id: I688d8d5ded43878cc3330d67c7749c208d821767
2016-07-09 22:39:20 -07:00
Ronald Bradford 20e6e90b44 Added i18n formatting to log messages
Change-Id: I22143feee4ab936aac91b14f4dafb6fcdde07d7e
2016-05-23 13:38:09 -04:00
Eric Brown fa16eb73e1 Explicitly exclude tests from bandit scan
Now that the bandit linter runs without a bandit.yaml specified,
it should exclude the tests directory similar to how it did before
in the bandit.yaml.

The reason this has not caused a problem yet is because bandit is
still finding a config bandit.yaml in .tox/pep8/etc/bandit/bandit.yaml.
But in a newer version of bandit this will not be the case.

Change-Id: I66dc7c2b826cf6e061fc6abc368c2be00ab2d202
2016-03-12 19:58:54 -08:00
ChangBo Guo(gcb) 47318f2490 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 short-running job to enable it.

This copy the idea from I54a4fccebb375517f9cd129f62f8f0c795b6edcc

Change-Id: I4dc181ec30fd632043619e4a34093772de23eb2a
2016-03-02 13:26:41 +08:00
Alexis Lee 68d5def976 Add reno for release notes management
The release management team have indicated this is their preferred way
to collect release notes in future.

Change-Id: Icab591ed1b12c1fd84c15f7b4a5d1d56d1d7588a
2016-02-22 11:28:17 +00:00
Doug Hellmann afdbfa697c always show coverage output from tests
Change-Id: If3855c04d7b252132b6ed49813a642344284d7ef
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-02-08 13:00:57 -05:00
Jenkins ad461d1967 Merge "Removal of bandit.yaml" 2016-02-03 14:33:23 +00:00
Mark McLoughlin 7b00576365 Fix bandit entry in tox.ini
It needs to be defined as a test environment.

Change-Id: I07230448e1129e23fcdf7088ca537903ec40b028
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2016-02-02 13:11:40 +00:00