Commit Graph

195 Commits

Author SHA1 Message Date
Takashi Kajinami cbf882ac02 Retire PowerVMStacker SIG: Stop requirements syncing
... and also remove the pypowervm library which is no longer used.

Depends-on: https://review.opendev.org/c/openstack/governance/+/909540
Change-Id: I4ed0f235cf52a4fd6db9cf5e715cfb78c989a188
2024-02-20 23:01:10 +09:00
Zuul 362e15ee67 Merge "Remove components from TripleO" 2024-01-29 06:19:48 +00:00
Zuul 2f843f3cfe Merge "Allow locally requiring a package for specific python versions" 2024-01-26 18:06:57 +00:00
Stephen Finucane 22fe101eee generate-constraints: Log results somewhere
These can be interesting when debugging.

Change-Id: Ifb5c860336d41c4550612b7fe518b3d0fd0de26d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-24 15:01:58 +00:00
Stephen Finucane ae953e17cb Remove 'update-requirements' tool
Requirements haven't been centrally managed for a long time now. Remove
the tool.

Change-Id: I5689985fd8ab2a061c04776c5320188343b2f077
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-24 15:01:49 +00:00
Stephen Finucane 69e21be288 Remove six
Change-Id: I1d6e583f41f95be7c2af232a2f22ee20fa83c4be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-24 15:49:09 +01:00
Takashi Kajinami 4060815706 Remove components from TripleO
... because TripleO project was deprecated[1] and is under the process
of complete retirement[2].

[1] https://review.opendev.org/c/openstack/governance/+/877132
[2] https://review.opendev.org/c/openstack/governance/+/905145

Change-Id: I85866434097f3722002154b27cffc3087ffe94d8
2024-01-22 11:24:55 +09:00
Takashi Kajinami 28af2ea157 Allow locally requiring a package for specific python versions
Sometimes we have to require a specific library in certain python
versions only.

In oslo and a few other projects, we are now replacing pytz by built-in
zoneinfo[1] to reduce 3rd party dependency, but zoneinfo is not
available in python < 3.9 and pytz is still required in python < 3.9.
In addition we need tzdata when zoneinfo is used, which means we need
tzdata only in python >= 3.9.

However these updates are currently prohibited by requirement check
because pytz in the global requirement does not contain python version
marker.

This change allows having a local requirement with python marker along
with the corresponding global requirement without python marker to
support such usage.

[1] https://review.opendev.org/c/openstack/oslo.utils/+/897623

Change-Id: I2bd5671962b3ca1abac91c2afba6e2c566616390
2023-11-16 17:19:25 +09:00
manchandavishal a2732c3a70 Bump XStatic package version to latest i.e. 1.0.3
horizon does not support setuptools 67.3.1 and it broke Kolla
Horizon container builds. We recently cut a new release of Xstatic
[1] which may fix this setuptools issue. So this patch bump the
Xstatic version to 1.0.3 to fix setuptools issue.

[1] 5cd7a23470

Related-Bug: #2007574
Change-Id: Icdeb56c9890132b19bf65934bbee135df56d0341
2023-05-12 10:39:14 +05:30
Dr. Jens Harbott 4eb4cf59bf Fix overlong line
hacking 6.0.0 was released and this now detects a line that is too long,
but went unnoticed before.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Ia6bcf800a284284e88610aad2edd1d60b75142e6
2023-04-19 21:14:14 +02:00
Elod Illes 28248c2d01 Workaround for unittests
Probably with the latest virtualenv [1] (which bundles setuptools), the
unit tests started to fail with this error:

  File "/home/zuul/src/opendev.org/openstack/requirements/.tox/py310/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 37, in __init__
    raise InvalidRequirement(str(e)) from e
pkg_resources.extern.packaging.requirements.InvalidRequirement: Expected end or semicolon (after version specifier)
    lesscpy>=0.9h

It seems that the parser have become more strict and now it does not
accept other than 0.9a, 0.9b (alpha, beta) releases when parsing
constraints. This patch updates the global requirements test file to
not break the parser.

Also the test_match_without_python3_markers test caused the same error
(with: withmarker>=1.5') and needed an update.

[1] virtualenv (20.19.0) released at Tue, 07 Feb 2023 20:16:53 GMT

Change-Id: Ia2ba3f38a83216abc430ed754bb7d8cbe8c564d3
2023-02-13 17:45:13 +01:00
Tony Breeds 8037b316c7 [tests] to pass a list to _is_requirement_in_global_reqs()
When we call this from playbooks/files/project-requirements-change.py
we pass in a list[1].  Update the tests to use a list as well.

[1] built with list( dict().keys() )

Change-Id: I3b359a4afc24a7d0069a3531a1d69f87795af115
2022-10-19 11:16:29 -05:00
Stephen Finucane 8412994369 Fix backport checks
In change I85501b4bff97d1c1e1873c3329ef998a8e501134, we added the
ability for stdlib backport-style libraries to have different version
specifiers (i.e. 'python_version<=3.9') from what we define in our
global requirements file. At least, that was the intention. However, we
used a regex that wouldn't actually work since it was checking for
Python versions greater than or equal to rather than the inverse. Fix
the regex, adding tests in the process (like we should have done last
time) to prove that things actually work now.

While we're here, add some whitespace and test docstrings to make the
whole thing a little more readable.

Change-Id: I6a8566d086761148d2e7a8e8f8288b2b0e447d08
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-10-04 12:22:47 +01:00
Tony Breeds b12966c487 Update code to use a std. read_requirements_file()
Change-Id: I48c26cc432a0322c5482bc1645537f59c1f6717d
2022-08-08 17:30:16 -05:00
Tony Breeds 5d31764c15 Move the definition of BACKPORTS out of code
Move the library names that we are flexible with - backports from the
std.lib - from a hard coded list in code into a txt file

Change-Id: I414f7c386b838248f45fbce003a64d0c83a9919c
2022-08-08 17:29:55 -05:00
Stephen Finucane a968919ebe Allow backports to have arbitrary python_version markers
There are a number of backport packages in place for packages in stdlib
that are still evolving. One such package is 'importlib-metadata' which
is a backport of 'importlib.metadata'. The README [1] for this package
shows a mapping of versions of the 'importlib-metadata' third party
library to versions of stdlib 'importlib.metadata':

  importlib_metadata  stdlib
  4.8                 3.11
  4.4                 3.10
  1.4                 3.8

A project may want to use a shiny new feature only found in the Python
3.11 stdlib version while continuing to support Python 3.8, 3.9 and
3.10. If so, they could specify something like so:

  importlib-metadata>=4.8;python_version<3.11

Meanwhile, other packages might require features found in the Python
3.10 stdlib version. They would want to specify something like so:

  importlib-metadata>=4.4;python_version<3.10

Currently this is not possible as it is not possible to specify
arbitrary 'python_version' markers. Since 'importlib-metadata' does not
have a 'python_version' marker in 'global-requirements.txt' (not since
change I5febaed02e95ff27accd946abc32f3bcbb1a5ead anyway), both projects
would have to specify

  importlib-metadata>={required_version}

Which means they'll use importlib-metadata even where they don't need
it.

Fix this issue by allowing a list of particular modules to specify a
project-specific 'python_version' marker. Currently this list only
includes 'importlib-metadata', but in the future we may wish to enhance
it to include other rolling backport libraries (e.g. mock).

[1] https://pypi.org/project/importlib-metadata/

Change-Id: I85501b4bff97d1c1e1873c3329ef998a8e501134
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-08-02 19:07:10 +10:00
OpenStack Proposal Bot 06b9b7ef8c
Updated from generate-constraints
Change-Id: I0b1a2ad5e372bb9759c6bd9f81341047e0be1ac0
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-08-09 09:29:24 -05:00
Sorin Sbarnea ecf18825ab Make tox -e generate easier to use
- auto detect python paths (which)
- make it possible to call `tox -e generate` w/o extra args
- update list of pythons to include currently supported versions

Change-Id: Ib727242c1aba8597389259d8dbacba7194f9f0d6
2021-06-24 10:29:44 +01:00
Pierre Riteau 6ecdc97211 Fix requirements-check error message
If local exclusions are not a subset of global exclusions, we probably
want to identify any item in local exclusions that are not in global
exclusions, instead of the opposite.

Change-Id: Id8e5a423288ac6db3b836ae553d766e5f04b4dec
2021-05-31 16:31:41 +02:00
Takashi Natsume 7a55d689e0 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] - https://github.com/testing-cabal/testtools/issues/286
[4] - https://github.com/testing-cabal/testtools/pull/277

Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Change-Id: I485b6f1c44185eaf327aadb044d6d2b1dce40eb2
2021-05-23 17:14:44 +09:00
Zuul d8a0a38c31 Merge "Remove the searchlight deliverables from req" 2020-12-25 18:45:12 +00:00
Kendall Nelson b12c8794e8 Remove Karbor deliverables from Reqs
Karbor is being retired this cycle so it makes sense to
stop syncing its deliverables requirements.

Change-Id: I729ea78158fa49fc641deb93517d314bc4f13ee5
2020-12-14 15:06:26 -08:00
Ghanshyam Mann f695891a7b Remove the searchlight deliverables from req
Searchlight deliverables are going to be retired in Wallaby[1],
so let's stop syncing the searchlight deveilerables requirements.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-November/018637.html

Change-Id: Id8c8f38644740d80a32c3bde3fc58b088222d1d3
2020-12-07 13:14:05 -06:00
Jens Harbott 83b781ae4f Fix failure with setuptools >= 49.0.0
Recent setuptools include updated vendored pkg_resource that changed
the exception that we need to expect from them. Leave in the old
version, too, for backwards compatibility.

Change-Id: I5bb01fb21982fb8757e925659ad206a15a79f799
2020-07-09 14:07:01 +00:00
Sean McGinnis 8c58c188a0
Use venv instead of virtualenv in generate script
The gate nodes no longer have the virtualenv package globally installed
and available, resulting in our nightly job failing with the error:

FileNotFoundError: [Errno 2] No such file or directory: 'virtualenv'

To get around this, this patch updates our generate.py code to use the
venv module that is part of the standard lib in Python 3.3 and later.

Change-Id: I128ce15a1b6ce885dacae4ecd160f5892215683b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-06-29 12:50:08 -05:00
Hervé Beraud 55387a4f4a Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Ib4184a05e753c3d1368167b91fc43bcc64a176c3
2020-06-09 19:16:34 +02:00
Hervé Beraud fac394f79c 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: I15d451f6a832b2e698b28e7351a36ef7aea92abe
2020-06-02 20:56:04 +02:00
Matthew Thode d0b389d840
update requirements and constraints for py3 only Victoria
generate-constraints -b blacklist.txt -p /usr/bin/python3.6 -p /usr/bin/python3.8 -r global-requirements.txt

Change-Id: I2d58d1b524764ea1d46d6ab3a382783f6a002b34
Signed-off-by: Matthew Thode <mthode@mthode.org>
2020-05-15 23:17:51 -05:00
Matthew Thode d92bd96ee1
fix pep8 errors
Change-Id: I1000dee7f2be48f00911c9a7f5c8124d0c712e8e
2020-05-11 21:17:50 -05:00
Ghanshyam Mann 15b2e73c03 Replace old requires-python with python-requires
requires-python is old value and does not work, python-requires
is right metadata.

'python-requires' is introduced from PEP440 and requires-python was old value
in PEP345.
- https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
- https://www.python.org/dev/peps/pep-0345/#requires-python

Change-Id: I496973e204b4f486ba3ce13faed545faf6392762
2020-03-27 13:47:38 -05:00
Sean McGinnis bb128fca02
Soften the py3-only warning check
Change-Id: I4c770fab0366f70e7e01920498498a3b79bfc423
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-23 14:46:34 -05:00
Daniel Bengtsson 4da6e47b8f Fix the warning to read the configuration file.
The method readfp is deprecated and will be removed in future versions.
Use read_file method instead.

Change-Id: I706e73505666e27dc409182db317f05284e6fe85
2020-01-16 15:28:22 +01:00
Stephen Finucane a6a75d1f75
Allow projects to drop 'python_version>=3.x' version specifier
For projects that have gone Python 3, having to keep the
'python_version' specifiers can add otherwise unnecessary noise. Special
case these until such a time as Python 2.7 is history and we can drop
all these Python version specifiers.

Change-Id: Ie6dba8bc78dcd5fa95c7ac15b0a3770cdef8ad95
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
2019-12-19 23:22:40 -06:00
Stephen Finucane 40de09edad trivial: Variable rename
Before doing any work on this, let's use some more meaningful names.

Change-Id: I640290359c0c15035187a62da1bc57dba5912b05
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-12-18 19:34:03 +00:00
Matthew Thode 698b571749
mark regex as regex for pycodestyle
Change-Id: Id66a3e4d574fa4da5fbffe6a1aa24c5ea23ab8cc
2019-12-13 23:17:32 -06:00
Sean McGinnis 3d9c4ca96c
Stop enforcing py2 requirements match starting with U
Ussuri and later will be Python 3 only. This updates our requirements
checks to only enforce local requirements match the exact global
requirements for the py3.5 and later entries.

Python 2 requirements can still be present in the local files, but this
allows teams that want to remove all Python 2 code to clean up their
requirements files for entries that are no longer relevant.

Change-Id: Ifaa44593b08630f84bb50060871412c66315adcc
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-11-15 09:10:29 -06:00
Sean McGinnis 7904ae1b52
Make requirements-check output more obvious
This makes the output from checking requirements a little more verbose
when issues are found to help make it more obvious what the issue is
when there is a failure.

Change-Id: I85e3dc9525893de6be3fac4c952272bfb3474255
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-05-15 14:58:22 -05:00
Sean McGinnis 9078b0c275
Add missing format arg for missing g-r reqs
Error message when package not found in the global requirements has
formatting placeholder for the missing package name, but no formatting
was being called to actually populate the name.

Change-Id: Ibf778c61f170fcb798dc93c79c9ab4cdae658c84
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-05-03 15:40:49 -05:00
Andreas Jaeger b65b202ff2 Follow renames of repos
Update blacklist, pbr and hacking are now in openstack organization
after the big OpenDev migration.

Change-Id: I094a589da1a2f56164ee32791d79db7bf6d0a768
2019-04-22 17:37:38 +02:00
Ian Wienand ce33bf27e5 Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: I53162497c2f53e45139e6a3aa9ff20538ec1b35e
2019-03-24 20:36:01 +00:00
Matthew Thode 7d6051949f
Add check for prerelease and further clean up error message.
Change-Id: I3b29dd606e76c7855ff34decf29caf9417f1cf44
2019-01-29 15:34:07 -06:00
lijunjie 0e973bfa35 Fix the misspelling of "except"
Change-Id: Id464e32867a547658d5499268d7ac25028a95692
2019-01-04 17:21:54 +08:00
malei 8988a71b03 Change openstack-dev to openstack-discuss
Mailinglists have been updated. Openstack-discuss replaces openstack-dev.

Change-Id: I1d22ccf52b8bde51e17b4ced094f7e1a791df406
2018-12-07 19:57:42 +08:00
Zane Bitter cdecb6a46c generate-constraints: Fix error handling in Python3
When handling an error, we were trying to combine data from the output
of multiple commands, some of which had already been converted to
strings (from bytes) and some of which had not. This is forbidden in
Python 3. (We were also trying to decode UTF-8 multiple times as a
result.)

Store all of the output as bytes, and decode if and when it is needed.

Change-Id: I35cd872f7bb38be1006bd6bf8dc910a1b52aadeb
2018-10-04 16:09:01 -04:00
Ivan Kolodyazhny 0b4ce85651 Cap XStatic-jQuery version to <2
XStatic-jQuery v1.12.4.1 it the latest version supported by Horizon and
plugins. Newer versions break Horizon gates.

Related-Bug: #1794028
Story: https://storyboard.openstack.org/#!/story/2003856
Change-Id: Ia3671c695bffce22af94115315cab3c943aefc2f
2018-09-24 17:36:18 +03:00
Witold Bedyk 70b4ff219f Remove PyKafka from global-requirements
PyKafka was added to g-r as planned replacement for kafka-python client
in Monasca [1]. Support for this client was never added though and the
library is not used. Recent tests have shown that confluent-kafka client
provides better throughtput and Kafka API support. Current plan is to
add support for confluent-kafka client in Monasca instead of PyKafka
[2].

No other project uses PyKafka [3].

[1] https://git.openstack.org/cgit/openstack/requirements/commit/?id=c1749152a85a80180198a5985d34d3ab86aeb722
[2] https://storyboard.openstack.org/#!/story/2003079
[3] http://codesearch.openstack.org/?q=pykafka&i=nope&files=&repos=

Depends-On: https://review.openstack.org/585374
Change-Id: I91202fc1187c284c0fd994ad7d8bd649f5973196
2018-09-03 10:42:26 +02:00
Zuul 6726c40ac1 Merge "Update pypi url to new url" 2018-07-19 19:02:07 +00:00
Zuul e9dcbceeba Merge "Support cloning one freeze to multiple" 2018-07-16 15:56:31 +00:00
Tuan Do Anh bf4f776f73 Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: Id007f1ee7d35af66d95a09a73bc135037d348644
2018-07-16 07:50:46 +00:00
Tony Breeds 587460bac1 Support cloning one freeze to multiple
The idea behind the version-map code is to work around a lack of a node
that has multiple python3 versions by taking a freeze from one version
(say python-3.5) and cloning that to another (say python-3,4).  This was
written to facilitate the transition from trusty (3.4) to xenial (3.5).

With the transition from xenial (3.5) to bionic (3.6) we need to do
something similar.  To aid the transition it'd be nice to be able to
duplicate a 3.5 freeze to both 3.4 *and* 3.6.  The current version_map
doesn't allow for that.

Enhance the version_map code to accommodate this situation.  The idea
would be to backport this as far as Ocata[1]

[1] We need to look again at separating the requirements code from the
data

Change-Id: I8784509bc162eb6f2e80261bc2d81dbe63ce7989
2018-07-07 00:50:16 +00:00