tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~
According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293
Change-Id: I704c467d08ecd2ba22e9ac52263d1108a28d5e96
oslo.context is pretty small and therefore easy to introduce mypy for.
Minimal type hints are added, along with tox targets to validate things.
We can build on these in the future if we'd like to.
Change-Id: Ie5ab9eedfc89654ac3aa635f4a3ad24409ad23b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We noticed some aberrations in log level/threshold handling as of
Setuptools 60.0.0, and the only substantive change for that release[1]
toggles the default selection for its internal ("local") distutils
replacement vs the "stdlib" one. For now, toggle the
SETUPTOOLS_USE_DISTUTILS envvar in our testing back to the old
value. This should be revisited once logging is handled better in
Setuptools.
[1] https://github.com/pypa/setuptools/issues/3038
Change-Id: I2eacb9756d9eb9c5d606599f16cdb412007f5854
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: I4473e5e96419e4da9c8922d5832249da23c61acd
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
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: I0dff5f597bd431159b868d210d1c199d373bb318
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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: Ib6e94fa9f822830242a99f6690349569626f1931
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: I07690fb61001eb282d895fbbac4cd856defe6581
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: Ic863da849df2a728ce6b26bfd946262a5439fcad
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: Ib73cac0235c6213645187ec52c719c8403eede5c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
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: I7b2a817147a0f1d1c7aabe09161a4df2ebec503f
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: Ib0948bfba3be14f0068bb3b49d2d356bd36f96b9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
'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: Id41c1ef58fdf8f1c15dc4be4a74faf3d6296cf5c
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: I2310cc11d5d0b53b42d2deb34111dfaaac34e911
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: I451e64acc01b843c5c7e637fddcbeeb2fe2e98d5
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.context.
Change-Id: I6c9bead1bbafd13e6639574955081edca93211f6
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: I800ad84596d1ff25686516fcf84184ce185cc77a
* 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: Ibceadc1d9f315044121e904f97e53aafec3b7cfa
Currently translatable messages are not used, so there are no uses
of _.
This will ensure if _ is used in the future pep8 won't assume
it is provided as a builtin.
Change-Id: Iad8357364ad88961c280096480e8521d873f7c7f