Commit Graph

42 Commits

Author SHA1 Message Date
Takashi Kajinami e4593665d1 Display coverage report
... for easy reference. Also make sure old data is purged.

This also fixes the missing coverage command, and the wrong option in
.coveragerc .

Change-Id: I7d4dcaea2e42d564c8f4264aecd15588085d63e3
2024-02-07 12:26:30 +09:00
yangyawei fee00ebb11 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: I4ad1fbca83af0f0c89c3f18d38caa66ee735ea3e
2021-06-07 16:55:32 +08:00
Zuul 051476b84c Merge "Use py3 as the default runtime for tox" 2021-04-16 13:29:22 +00:00
Zuul 63df07a5b3 Merge "Use TOX_CONSTRAINTS_FILE" 2021-04-16 13:28:10 +00:00
Hervé Beraud 5f5db610c6 Fix requirements issues.
This patch is the merge of 2 current fixes that need to be solved in the
same time. Indeed each issue lock our gates independently.

Dropping lower constraints testing

We facing errors related to the new pip resolver, this
topic was discussed on the ML and QA team proposed to
to test lower-constraints [1].

I propose to drop this test because the complexity and recurring pain needed
to maintain that now exceeds the benefits provided by this mechanismes.

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

Move flake8 as a pre-commit local target.

The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>

Change-Id: Ia349eba36d8556d4d2775a83b9a344b2ebeed972
2021-04-07 16:21:41 +02:00
Hervé Beraud dc97a45c3b 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: I8da7cc0740c7067052ddcf26e2da5f382f8b08a0
2020-11-04 10:49:57 +01:00
Hervé Beraud 55dd214558 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: I5137ec978ab66c33fa37aaa1d7812c77221bf8c7
2020-11-04 10:03:45 +01:00
Hervé Beraud d7f6ddc55c 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: Ic88cf026a74e9da4acaf9e00c50fddd2c8a48fbe
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-08 14:17:12 +02:00
Sean McGinnis 186ed27a46
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: If96ca50b1836f444a2a6842a589ae60f436b7eaf
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:50 -05:00
Andreas Jaeger bbae96ea23 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Remove hacking and friends from lower-constraints, they are not needed
for installation.

Change-Id: I9a2a7c6cd9a0dfd02c6193ceca5653431eed3753
2020-04-02 14:57:10 +02:00
Zuul 7b8c4d4597 Merge "Add functional tests" 2020-03-07 22:47:46 +00:00
Stephen Finucane 8c6a52ae0c tox: Add missing 'deps' for releasenotes testenv
Change-Id: Ief0a06e95197b37b47c4ae8cbdff10b4a9fad37c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-02-13 15:11:55 +01:00
Hervé Beraud c4d72cfcdf [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: Ia01dfa4bc5d7224bb0f753116cd23bdcc22df146
Sem-Ver: api-break
2020-02-06 10:25:13 +01:00
Hervé Beraud e39c40b629 tox: Trivial cleanup
Move 'basepython' to the top-level 'testenv'.
Use the default 'install_command'

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

Change-Id: Ic951cc21208e54105cfd42fbd28ce1f2f738cced
2020-01-08 19:55:14 +01:00
Ben Nemec dfcd983ee3 Add functional tests
These add some coverage to functionality not covered by the regular
unit tests, but I think they can't be run in the gate because they
use sudo.

Change-Id: Ic62c95b83f68f94328deb00227b7eabf249ce898
2019-12-11 10:26:01 +00:00
caoyuan b99765fd6c 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: I07c753f5070fe887faf4f103b3f46bff59e3d1be
2019-10-24 15:10:31 +08:00
pengyuesheng df9d3eaf88 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Ib489b7c28a70463d1ab765da267f6d8fdadb5577
2019-09-26 14:13:58 +08:00
Zuul 14fbdc967f Merge "Move doc related modules to doc/requirements.txt" 2019-08-12 15:31:32 +00:00
Corey Bryant 0d09fd1885 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: I425e381b3d830ff9d15f8c92bade6cb2a4ee0108
Story: #2005924
Task: #34234
2019-07-05 14:59:35 -04:00
caoyuan 3a8f29ed71 Move doc related modules to doc/requirements.txt
Change-Id: Iedf201e211648452df29fa518c069ecf41a0acf3
2019-07-06 02:15:13 +08:00
jacky06 447b377f86 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Idd169dc8dbe07a17cbdf3e0834ccf3998badcfb2
Closes-Bug: #1826999
2019-04-30 13:27:01 +08:00
Vieri ef4ea2ef99 Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: Ie3c26ca1fab0d6248b49c74d7643d8cffcaec3d3
2018-10-09 13:36:18 +00:00
Vu Cong Tuan 58ecafb104 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: I06d7b72fcaa4ce1f8764fd51635ae8239ea649b2
2018-07-03 16:09:28 +07:00
Doug Hellmann 8b24f73506 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: Ib592f5d76510dcb3303e954307066675838d58b8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 14:53:49 -04:00
Doug Hellmann 8e7936bf1e 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: I76c2528d825a5f66d34c21a02abf099b8dc547ec
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-13 16:03:45 -04:00
Pavlo Shchelokovskyy ec396082c9 Skip unit tests in bandit scan
no need to enforce security for unit tests, they are not being run in
production installations.

Change-Id: Ib03d5b4b9c14cbfd9dca9a97db883d989b93e654
2018-04-12 17:08:42 +03:00
Doug Hellmann 682cc92aa7 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: Id1ebd6dc1b5178643646a3278a413ab25baef260
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:44 -04:00
ChangBo Guo(gcb) 518a811b9f add bandit to pep8 job
Add the bandit security scanner to the pep8 job.
* convert assert statement to raise AssertionError
* Don't hard code temporary file path
* skip B404,B603

Change-Id: If4bdb9569236927449648a8b750ae0fa2da76f53
2017-12-12 14:21:30 +08:00
Andreas Jaeger 7486ad4f35 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: I1fa8b383ce9fcadbe500649b7722786cd04afdae
2017-12-02 19:28:36 +01:00
Andreas Jaeger fbcec41ba9 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: I04fb2c898e41ec9a847b0ad387d794dd3b16067f
2017-12-01 09:49:21 +01:00
liangcui 8c96cfd08c 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: I1e2612a92014b17d9f3158ec868f07e734263f13
2017-07-06 11:01:25 +08:00
Eric Brown 90576b9017 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: I2bff52b0958b2d1d025cd0a8b9676c3840c51634
2017-01-17 10:30:33 -08:00
Tony Breeds 2208a539ee 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.privsep.

Change-Id: Icff042fc20da27181a3e7c7624e4e8e1704923b1
2016-12-20 14:36:31 +11:00
Jenkins 76dd259bbd Merge "Add Python 3.5 classifier and venv" 2016-09-05 03:52:30 +00:00
ChangBo Guo(gcb) 21c300721e 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: I6df77ff6df3ffd833bcfd67e489b1f2038fd1d79
2016-08-11 10:26:18 +08:00
Kirill Bespalov f0370ac773 Add reno for release notes management
An initial patch to add reno and create a base directory for
release notes

Change-Id: If4c4e681e175315b4c6c5d51d339833fd83fb560
2016-07-04 12:55:50 +03:00
Jenkins 3b0330ee25 Merge "Remove unused file openstack-common.conf" 2016-01-04 14:47:26 +00:00
ChangBo Guo(gcb) 5989693255 Remove unused file openstack-common.conf
We don't use it to sync code from oslo-incubator any more.

Change-Id: Ifcccbff41b2496be08d92ba4c0a8f4cdaecdc8ed
2015-12-28 16:19:43 +08:00
sonu.kumar 89cb22bd78 Remove python 2.6 and tox.ini cleanup
This patch
* Remove support for python 2.6
* Remove skipsdist : Needs to be set only if
  sdist is expensive
* Remove usedevelop : only needed when skipsdist
  is set to True
* Remove install_command : We can just use the
  default, we don't need to override
* 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: Icf33533348b8b6088abe3d4de5a84f253fe3836d
Closes-Bug: #1519510
2015-12-10 14:34:48 +05:30
Angus Lees 025dd2476f Initial basic privsep functionality
Supports starting privileged process via fork or sudo, and a thread-safe
client and server communication mechanism.

Coming in later changes:
 - Extend json encoding to deal with non-unicode and more varied dict
   keys (see test_comm.py).
 - eventlet test case.
 - Linux capabilities.

Change-Id: If6456631c51d4f2a1c95805ab9d6962b04f172bc
Implements: blueprint privsep
2015-11-09 11:15:43 +11:00
Angus Lees 3f1146730c oslo.i18n boilerplate
Following http://docs.openstack.org/developer/oslo.i18n/usage.html

Change-Id: I25d2e34a97c2386314bb5158457a2a2ea0b67e24
2015-10-23 18:51:50 +11:00
Angus Lees 269a3d277c Initial cookiecutter project
This is the unmodified output of
cookiecutter https://git.openstack.org/openstack-dev/oslo-cookiecutter

Change-Id: I8fbc11c50bbd171b9f99bd9b5ba39eef1f686860
Implements: blueprint privsep
Depends-On: Iee84120f4da14ee3d441933a0e03a67c22fce8d1
Depends-On: Ia4d56747d56dcfe50889ebbdf9d553df13e1b950
2015-10-23 18:51:29 +11:00