tox uses the python version where tox is installed by default, and we
no longer expect that the tests may run in env with python 2.
Change-Id: I042d1cd1a2fa7400fb7ac04165d951f814a5e394
Update all .py source files by
$ pyupgrade --py3-only $(git ls-files | grep ".py$")
to modernize the code according to Python 3 syntaxes.
pep8 errors are fixed by
$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
--in-place yaql
Change-Id: If8fe14ea056d30984669f4cb96098084c4d32e7c
These are detected as errors since the clean up was done[1] in
the requirements repository.
[1] 314734e938f107cbd5ebcc7af4d9167c11347406
Change-Id: Ie5c80d2215ee6864564f50ac648f26ddc8c4d18c
... so that users can try to use the version with the security fix in
older python versions if needed.
Change-Id: I7e972c388e3f4f126360cea15fd201c9f8d563d5
The format function allowed too arbitrary access to the values being
formatted, and this behavior caused information leakage in some cases.
Closes-Bug: #2048114
Change-Id: Id7ec5f267314bb7166ca64802ab47d768bb5eb89
Most of the repositories don't contain shebang in their setup.py. Let's
remove it to make the file more consistent across repos.
Change-Id: I844c198878a044b91d04cfa48971712b30288ae1
The console script is generated during installation and we don't expect
any users may attempt to run this script directly.
Change-Id: I1f83d91b658d1f91d4fef162ef09c48e62c98df0
The 'message' attribute has been deprecated and removed
from Python3.
For more details, please check:
https://www.python.org/dev/peps/pep-0352/
Co-Authored-By: Bob Haddleton <bob.haddleton@nokia.com>
Closes-Bug: #1762073
Change-Id: I655fb3471c6e78fd21f653c55067f79fad778406
As per the current release tested runtime, we test
python version from 3.8 to 3.11 so updating the
same in python classifier in setup.cfg
Change-Id: Ia16fc1b095c2a1e7ec205f2e2b3ab2ab579f4af0
These translation sections are not needed anymore, Babel can generate
translation files without them.
Change-Id: Ia30f705a71d0d4f54ce605ba00ad494d6b70a97b
Since setuptools v54.1.0[1], the parmeters with dash have been
deprecated in favor of the new parameters with underscore.
This change updates the parameters accordingly to avoid the warnings
like the example below.
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: I6b50af9c7825b48e37c395466ce479e38937e094
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: I6ebd93aa093caad6f2d3db6e43beb8bc8d9cedb7
The abstract base classes previously defined in 'collections' were moved
to 'collections.abc' in 3.3. The aliases will be removed in 3.10.
Preempt this change now with a simple find-replace:
$ ag -l 'collections.($TYPES)' | \
xargs sed -i 's/\(collections\)\.\($TYPES\)/\1.abc.\2/g'
Where $TYPES is the list of moved ABCs from [1].
[1] https://docs.python.org/3/library/collections.abc.html
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ib07d778a01275d7c985e059156e95abc112e81c8
Ensure we run with the versions of Python we expect to. Some other
cruft is removed.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I450c062eed1185e7e4c49a156307abb4320f6cb6
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: I1591e8603262d377d8e0801af152928787374e79
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: I7f8c249b574213a9189e13f679179bbaaa382e28
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.
Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.
To avoid similar gate break in future, we need to bump the hacking min
version.
- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html
Change-Id: Icf9fa58f9c9ae9e1bbe436638fe915974543dddb
Make a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
know about the requirement
- Remove obsolete sections from setup.cfg:
* Wheel is not needed for python 3 only repo
* Some other sections are obsolete
- Update classifiers
- Update requirements, no need for python_version anymore
Change-Id: I4b236a3b85f37358ff44a8063dfec1e4d10c036a
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Change-Id: Idffc923ac339978714001be22e3c9ef285e907f5