Skip to content

Commit 41733ec

Browse files
authored
Merge pull request #138 from stackhpc/upstream/master-2025-11-03
Synchronise master with upstream
2 parents 2328979 + 0c02464 commit 41733ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1495
-1188
lines changed

.zuul.d/project-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- ^.*requirements-py[2,3].txt$
4343
- ^doc/requirements.txt$
4444
- ^lower-constraints.txt$
45+
- ^pyproject.toml$
4546

4647
- job:
4748
name: requirements-check-self

babel-test/babel-input.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
"""Test input for Babel"""
1515

16-
1716
from oslo.i18n import _
1817
from oslo.i18n import _LE
1918
from oslo_log import log as logging

denylist.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,31 @@ molecule-plugins
5050
# Once any stable branch move to 'Extended Maintenance' and we pin the
5151
# older Tempest to test them then we can move it from here to u-c file.
5252
tempest
53+
barbican_tempest_plugin
54+
blazar_tempest_plugin
55+
cinder_tempest-plugin
56+
cloudkitty_tempest_plugin
57+
cyborg_tempest-plugin
58+
designate_tempest-plugin
59+
freezer_tempest_plugin
60+
glance_tempest-plugin
61+
heat_tempest-plugin
62+
ironic_tempest-plugin
63+
keystone_tempest_plugin
64+
magnum_tempest_plugin
65+
manila_tempest-plugin
66+
mistral_tempest_tests
67+
monasca_tempest-plugin
68+
neutron_tempest-plugin
69+
octavia_tempest-plugin
70+
telemetry_tempest_plugin
71+
trove_tempest_plugin
72+
venus_tempest-plugin
73+
vitrage_tempest-plugin
74+
watcher_tempest-plugin
75+
whitebox_tempest-plugin
76+
zaqar_tempest_plugin
77+
zun_tempest-plugin
5378

5479
# annoying from setuptools
5580
pkg_resources

detail.py

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,77 @@
2020
import urllib.parse as urlparse
2121
import urllib.request as urlreq
2222

23-
import pkg_resources
23+
import packaging.requirement
2424

2525
try:
2626
PYPI_LOCATION = os.environ['PYPI_LOCATION']
2727
except KeyError:
2828
PYPI_LOCATION = 'http://pypi.org/project'
2929

3030

31-
KEEP_KEYS = frozenset([
32-
'author',
33-
'author_email',
34-
'maintainer',
35-
'maintainer_email',
36-
'license',
37-
'summary',
38-
'home_page',
39-
])
31+
KEEP_KEYS = frozenset(
32+
[
33+
'author',
34+
'author_email',
35+
'maintainer',
36+
'maintainer_email',
37+
'license',
38+
'summary',
39+
'home_page',
40+
]
41+
)
4042

4143

4244
def iter_names(req):
43-
for k in (req.key, req.project_name):
44-
yield k
45-
yield k.title()
46-
yield k.replace("-", "_")
47-
yield k.replace("-", "_").title()
45+
yield req.name
46+
yield req.name.lower()
47+
yield req.name.title()
48+
yield req.name.replace("-", "_")
49+
yield req.name.replace("-", "_").title()
4850

4951

5052
def release_data(req):
5153
# Try to find it with various names...
5254
attempted = []
5355
for name in iter_names(req):
54-
url = PYPI_LOCATION + "/%s/json" % (urlparse.quote(name))
56+
url = PYPI_LOCATION + f"/{urlparse.quote(name)}/json"
5557
if url in attempted:
5658
continue
5759
with contextlib.closing(urlreq.urlopen(url)) as uh:
5860
if uh.getcode() != 200:
5961
attempted.append(url)
6062
continue
6163
return json.loads(uh.read())
62-
attempted = [" * %s" % u for u in attempted]
63-
raise IOError("Could not find '%s' on pypi\nAttempted urls:\n%s"
64-
% (req.key, "\n".join(attempted)))
64+
attempted = [f" * {u}" for u in attempted]
65+
raise OSError(
66+
"Could not find '{}' on pypi\nAttempted urls:\n{}".format(
67+
req.key, "\n".join(attempted)
68+
)
69+
)
6570

6671

6772
def main():
6873
if len(sys.argv) == 1:
69-
print("%s requirement-file ..." % (sys.argv[0]), file=sys.stderr)
74+
print(f"{sys.argv[0]} requirement-file ...", file=sys.stderr)
7075
sys.exit(1)
7176
for filename in sys.argv[1:]:
72-
print("Analyzing file: %s" % (filename))
77+
print(f"Analyzing file: {filename}")
7378
details = {}
7479
with open(filename, "rb") as fh:
7580
for line in fh.read().splitlines():
7681
line = line.strip()
7782
if line.startswith("#") or not line:
7883
continue
79-
req = pkg_resources.Requirement.parse(line)
80-
print(" - processing: %s" % (req))
84+
req = packaging.requirement.Requirement(line)
85+
print(f" - processing: {req}")
8186
try:
8287
raw_req_data = release_data(req)
83-
except IOError:
88+
except OSError:
8489
traceback.print_exc()
8590
details[req.key] = None
8691
else:
8792
req_info = {}
88-
for (k, v) in raw_req_data.get('info', {}).items():
93+
for k, v in raw_req_data.get('info', {}).items():
8994
if k not in KEEP_KEYS:
9095
continue
9196
req_info[k] = v
@@ -94,9 +99,12 @@ def main():
9499
'info': req_info,
95100
}
96101
filename, _ext = os.path.splitext(filename)
97-
with open("%s.json" % (filename), "wb") as fh:
98-
fh.write(json.dumps(details, sort_keys=True, indent=4,
99-
separators=(",", ": ")))
102+
with open(f"{filename}.json", "wb") as fh:
103+
fh.write(
104+
json.dumps(
105+
details, sort_keys=True, indent=4, separators=(",", ": ")
106+
)
107+
)
100108

101109

102110
if __name__ == '__main__':

0 commit comments

Comments
 (0)