334 Commits

Author SHA1 Message Date
Takashi Kajinami
343a4a2c01 tox: Remove basepython
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
2025-04-15 21:12:05 +09:00
Zuul
9c1510b042 Merge "pre-commit: Bump versions" 2025-02-15 06:58:08 +00:00
Takashi Kajinami
1fe08af3aa pre-commit: Bump versions
Also skip installation in pep8 job to speed up the check.

Change-Id: I90b13eef56cea666d7d3a13e3ea63f9dc9830ca8
2025-02-15 15:34:08 +09:00
Takashi Kajinami
b7ec3e5da7 Enable E721
The check now passes without any failure.

Change-Id: I34e6ddd7988fa08129cb9439dfb3d256124124b1
2025-02-13 10:56:34 +09:00
Zuul
ef9125c724 Merge "Use per-commit to run style checks" 2024-10-26 18:54:58 +00:00
Zuul
9027863857 Merge "Drop unused fixtures library" 2024-10-26 17:36:34 +00:00
Takashi Kajinami
deffd2dc8c Drop unused fixtures library
This is not actually used by test codes.

Change-Id: I05c6cb5fc1869fda475f31849928d6018e6b4b7b
2024-10-27 02:14:58 +09:00
Takashi Kajinami
de23b01423 Use per-commit to run style checks
Change-Id: Idb2ea751ad65aac7f997c40a0f4c1ef44b00768e
2024-10-27 02:13:38 +09:00
Takashi Kajinami
820034d5ac Remove unnecessary 'x' bit
Change-Id: Ifbf4b253f41976d65979fe616a80aa2a0273c170
2024-10-27 02:11:23 +09:00
Takashi Kajinami
c054a36e93 Run pyupgrade to clean up Python 2 syntaxes
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
2024-10-21 22:03:14 +09:00
Takashi Kajinami
82a1eb0076 Drop unnecessary 'x' bit from doc config file
This file is not actually executable.

Trivial-Fix

Change-Id: I77638bc17bbfcb85f2d63baaca01aa41caf97162
2024-10-21 20:22:32 +09:00
Takashi Kajinami
8b158b45ea Declare Python 3.12 support
Now Python 3.12 unit tests job is voting. So we can safely say this
is tested with Python 3.12 .

Change-Id: Id655751bc4e9a5ba305b91dd16de1d0fb7508d12
2024-10-09 22:50:16 +09:00
Takashi Kajinami
a3029db6d8 Remove old excludes
These are detected as errors since the clean up was done[1] in
the requirements repository.

[1] 314734e938f107cbd5ebcc7af4d9167c11347406

Change-Id: Ie5c80d2215ee6864564f50ac648f26ddc8c4d18c
2024-04-30 17:49:26 +09:00
Zuul
e3fe357a51 Merge "Fix localtz() function" 2024-03-19 01:30:14 +00:00
Takashi Kajinami
61e61a6d0a Remove Python 3.6/7 support again
... with a release note added.

Change-Id: I4cec8d2e9664962b5abd7ac9bfd7b7a3bd419f61
2024-03-15 02:41:34 +09:00
Takashi Kajinami
aa855fc4cc Restore Python 3.6/7 support
... so that users can try to use the version with the security fix in
older python versions if needed.

Change-Id: I7e972c388e3f4f126360cea15fd201c9f8d563d5
3.0.0
2024-03-15 00:25:41 +09:00
Takashi Kajinami
83e28324e1 Remove format function
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
2024-03-14 15:25:14 +00:00
Takashi Kajinami
2a159b85ae Publish release notes
Change-Id: I708168743594f4a40f9e8812062b1d9588fe40fd
2024-03-13 17:06:47 +09:00
Radovan Pieter
269f966996 Fix localtz() function
Closes-Bug: #2052593
Change-Id: I739b44829202f0edba94ff502cd06e6cba60a4d0
2024-03-13 10:21:33 +09:00
Zuul
0d63eb1346 Merge "Update python classifier in setup.cfg" 2024-01-17 04:58:29 +00:00
Zuul
e38e0ab94b Merge "Bump hacking" 2024-01-17 03:34:27 +00:00
Takashi Kajinami
d52f0e593a Bump hacking
hacking 3.0.x is too old.

Change-Id: Iab6dcdcd1746f6608b7ac9fe4541e93fda5851df
2024-01-17 01:43:34 +09:00
Zuul
ad2b78ce92 Merge "Drop direct execution of run.py" 2024-01-12 03:29:12 +00:00
Zuul
c1e445d86f Merge "Remove shebang from setup.py" 2024-01-12 03:29:11 +00:00
Zuul
72ae6e24d4 Merge "Use py3 as the default runtime for tox" 2.0.1 2024-01-09 08:38:45 +00:00
Zuul
027f18133c Merge "Replace assertItemsEqual with assertCountEqual" 2024-01-09 08:38:44 +00:00
Zuul
cf75637fe4 Merge "Stop using deprecated 'message' attribute in Exception" 2024-01-09 08:38:42 +00:00
Takashi Kajinami
6cbb3da041 Remove shebang from setup.py
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
2024-01-09 17:13:05 +09:00
Takashi Kajinami
14794a3fa4 Drop direct execution of run.py
The console script is generated during installation and we don't expect
any users may attempt to run this script directly.

Change-Id: I1f83d91b658d1f91d4fef162ef09c48e62c98df0
2024-01-09 17:08:20 +09:00
kavithahr
be3059e2ef Stop using deprecated 'message' attribute in Exception
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
2024-01-09 16:47:48 +09:00
Ghanshyam Mann
b64b7dbfad Update python classifier in setup.cfg
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
2024-01-04 01:11:17 -08:00
Takashi Kajinami
b18495bac4 Remove translation sections from setup.cfg
These translation sections are not needed anymore, Babel can generate
translation files without them.

Change-Id: Ia30f705a71d0d4f54ce605ba00ad494d6b70a97b
2023-12-20 21:47:02 +09:00
Stephen Finucane
18138d9f09 Update CI to use unversioned jobs template
As part of the migration of this project to the independent release
model, we failed to notice that the job template was still tied to a
specific release. We've now introduced a new unversioned job template,
'openstack-python3-jobs' [1], which was can and should use. Do this.

[1] https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/833286/

Depends-On: https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/833286/
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I6bed7c11b5060718ed20aef61bce8d248885a1ae
2022-03-15 15:12:40 +00:00
Zuul
99a15169ce Merge "setup.cfg: Replace dashes by underscores" 2022-03-08 08:53:02 +00:00
Zuul
bf7c0d4f5c Merge "Migrate from testr to stestr" 2022-02-22 03:32:23 +00:00
Takashi Kajinami
1803608b5c setup.cfg: Replace dashes by underscores
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
2022-02-05 17:08:55 +00:00
Ghanshyam Mann
bb65fc6402 [community goal] Update contributor documentation
This patch updates/adds the contributor documentation to follow
the guidelines of the Ussuri cycle community goal[1].

[1] https://governance.openstack.org/tc/goals/selected/ussuri/project-ptl-and-contrib-docs.html

Story: #2007236
Task: #38539
Change-Id: I12ddfc0d4332ea19b5b0abab5cac61653726e3d1
2021-05-31 20:35:23 +00:00
zhangboye
a3cc95f523 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.

Change-Id: I3297e51a724e8d02486059abcd07bf588aabf8e4
2021-04-20 10:28:49 +08:00
Dirk Mueller
b4c39c5874 Replace assertItemsEqual with assertCountEqual
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
2021-02-16 10:29:21 +01:00
Stephen Finucane
e2dd407c76 Migrate from testr to stestr
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I9dd3a3db55fdd01d46cb7a204be46f7c5f260c4e
2021-02-11 12:33:45 +00:00
Stephen Finucane
c3bda9eeb1 Switch to collections.abc.*
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
2.0.0
2021-02-01 11:11:27 +00:00
Stephen Finucane
4670f0949c Remove six
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I2f37e055838ea50627562d3585d6951f8d8d46aa
2021-02-01 11:11:17 +00:00
Stephen Finucane
8fcac72fd3 tox: Set 'ignore_basepython_conflict'
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
2021-02-01 10:55:35 +00:00
Dirk Mueller
0b006f0722 Replace assertItemsEqual with assertCountEqual
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
2020-06-11 11:55:50 +02:00
Hervé Beraud
356c9651b0 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I042e2fd85b2255cd3be509504b8f992ad02783fa
2020-06-02 21:07:55 +02:00
Andreas Jaeger
3309e689e2 Switch to newer openstackdocstheme and reno versions
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
2020-05-31 20:01:04 +02:00
Ghanshyam Mann
bfc3c48685 Fix hacking min version to 3.0.1
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
2020-05-12 19:33:36 -05:00
zhurong
e1eedff1e0 Cleanup py27 support
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
2020-04-07 04:48:25 -07:00
Zuul
730b701d79 Merge "Update hacking for Python3" 2020-03-31 02:36:45 +00:00
Andreas Jaeger
1f35cce0e7 Update hacking for Python3
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
2020-03-30 12:00:00 +02:00