Skip to content

Commit 2328979

Browse files
authored
Merge pull request #136 from stackhpc/upstream/master-2025-10-27
Synchronise master with upstream
2 parents 0151ab3 + bfced6c commit 2328979

File tree

12 files changed

+53
-493
lines changed

12 files changed

+53
-493
lines changed

global-requirements.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ bcrypt==4.0.1 # Apache-2.0
2424
beautifulsoup4 # MIT
2525
betamax # Apache-2.0
2626
boto # MIT
27-
boto3 # Apache-2.0
28-
botocore # Apache-2.0
27+
# Capped until https://bugs.launchpad.net/glance/+bug/2121144 is resolved
28+
boto3<1.36 # Apache-2.0
29+
botocore<1.36 # Apache-2.0
30+
# indirect from boto3/botocore
31+
s3transfer<0.11 # Apache-2.0
2932
cachetools # MIT License
3033
cassandra-driver!=3.6.0 # Apache-2.0
3134
cffi # MIT
@@ -132,7 +135,7 @@ PyMySQL # MIT License
132135
pyOpenSSL # Apache-2.0
133136
pyparsing # MIT
134137
pyroute2!=0.5.4,!=0.5.5,!=0.7.1,!=0.9.1,!=0.9.2,!=0.9.3,!=0.9.4;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2)
135-
pysaml2!=4.0.3,!=4.0.4,!=4.0.5,!=4.0.5rc1,!=4.1.0,!=4.2.0,!=4.3.0,!=4.4.0,!=4.6.0 # Apache-2.0
138+
pysaml2!=4.0.3,!=4.0.4,!=4.0.5rc1,!=4.0.5,!=4.1.0,!=4.2.0,!=4.3.0,!=4.4.0,!=4.6.0 # Apache-2.0
136139
pysnmp-lextudio # BSD
137140
pystache # MIT
138141
# Only required for sasl/binary protocol

openstack_requirements/check.py

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import re
1919

2020
from packaging import markers
21-
from packaging import specifiers
2221

2322
from openstack_requirements import project
2423
from openstack_requirements import requirement
@@ -303,130 +302,3 @@ def validate(
303302
)
304303

305304
return failed
306-
307-
308-
def _find_constraint(req, constraints):
309-
"""Return the constraint matching the markers for req.
310-
311-
Given a requirement, find the constraint with matching markers.
312-
If none match, find a constraint without any markers at all.
313-
Otherwise return None.
314-
"""
315-
if req.markers:
316-
req_markers = markers.Marker(req.markers)
317-
for constraint_setting, _ in constraints:
318-
if constraint_setting.markers == req.markers:
319-
return constraint_setting
320-
if not constraint_setting.markers:
321-
# There is no point in performing the complex
322-
# comparison for a constraint that has no markers, so
323-
# we skip it here. If we find no closer match then the
324-
# loop at the end of the function will look for a
325-
# constraint without a marker and use that.
326-
continue
327-
# NOTE(dhellmann): This is a very naive attempt to check
328-
# marker compatibility that relies on internal
329-
# implementation details of the packaging library. The
330-
# best way to ensure the constraint and requirements match
331-
# is to use the same marker string in the corresponding
332-
# lines.
333-
c_markers = markers.Marker(constraint_setting.markers)
334-
env = {
335-
str(var): str(val)
336-
for var, op, val in c_markers._markers # WARNING: internals
337-
}
338-
if req_markers.evaluate(env):
339-
return constraint_setting
340-
# Try looking for a constraint without any markers.
341-
for constraint_setting, _ in constraints:
342-
if not constraint_setting.markers:
343-
return constraint_setting
344-
return None
345-
346-
347-
def validate_lower_constraints(req_list, constraints, denylist):
348-
"""Return True if there is an error.
349-
350-
:param reqs: RequirementsList for the head of the branch
351-
:param constraints: Parsed lower-constraints.txt or None
352-
353-
"""
354-
if constraints is None:
355-
return False
356-
357-
parsed_constraints = requirement.parse(constraints)
358-
359-
failed = False
360-
361-
for fname, freqs in req_list.reqs_by_file.items():
362-
363-
if fname == 'doc/requirements.txt':
364-
# Skip things that are not needed for unit or functional
365-
# tests.
366-
continue
367-
368-
print("Validating lower constraints of {}".format(fname))
369-
370-
for name, reqs in freqs.items():
371-
372-
if name in denylist:
373-
continue
374-
375-
if name not in parsed_constraints:
376-
print('ERROR: Package {!r} is used in {} '
377-
'but not in lower-constraints.txt'.format(
378-
name, fname))
379-
failed = True
380-
continue
381-
382-
for req in reqs:
383-
spec = specifiers.SpecifierSet(req.specifiers)
384-
# FIXME(dhellmann): This will only find constraints
385-
# where the markers match the requirements list
386-
# exactly, so we can't do things like use different
387-
# constrained versions for different versions of
388-
# python 3 if the requirement range is expressed as
389-
# python_version>3.0. We can support different
390-
# versions if there is a different requirement
391-
# specification for each version of python. I don't
392-
# really know how smart we want this to be, because
393-
# I'm not sure we want to support extremely
394-
# complicated dependency sets.
395-
constraint_setting = _find_constraint(
396-
req,
397-
parsed_constraints[name],
398-
)
399-
if not constraint_setting:
400-
print('ERROR: Unable to find constraint for {} '
401-
'matching {!r} or without any markers.'.format(
402-
name, req.markers))
403-
failed = True
404-
continue
405-
406-
version = constraint_setting.specifiers.lstrip('=')
407-
408-
if not spec.contains(version):
409-
print('ERROR: Package {!r} is constrained to {} '
410-
'which is incompatible with the settings {} '
411-
'from {}.'.format(
412-
name, version, req, fname))
413-
failed = True
414-
415-
min = [
416-
s
417-
for s in req.specifiers.split(',')
418-
if '>' in s
419-
]
420-
if not min:
421-
# No minimum specified. Ignore this and let some
422-
# other validation trap the error.
423-
continue
424-
425-
expected = min[0].lstrip('>=')
426-
if version != expected:
427-
print('ERROR: Package {!r} is constrained to {} '
428-
'which does not match '
429-
'the minimum version specifier {} in {}'.format(
430-
name, version, expected, fname))
431-
failed = True
432-
return failed

openstack_requirements/cmds/check_conflicts.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

openstack_requirements/cmds/generate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727

2828

2929
SECURITY_WARNING = [
30-
"# WARNING: OpenStack makes no security guarantees about third-party",
31-
"# dependencies listed here, and does not keep track of any",
32-
"# vulnerabilities they contain. Versions of these dependencies are",
33-
"# frozen at each coordinated release in order to stabilize upstream",
34-
"# testing, and can contain known vulnerabilities. Consumers are",
35-
"# *STRONGLY* encouraged to rely on curated distributions of OpenStack",
36-
"# or manage security patching of dependencies themselves.",
30+
"# WARNING: OpenStack makes no security guarantees about third-party\n",
31+
"# dependencies listed here, and does not keep track of any\n",
32+
"# vulnerabilities they contain. Versions of these dependencies are\n",
33+
"# frozen at each coordinated release in order to stabilize upstream\n",
34+
"# testing, and can contain known vulnerabilities. Consumers are\n",
35+
"# *STRONGLY* encouraged to rely on curated distributions of OpenStack\n",
36+
"# or manage security patching of dependencies themselves.\n",
3737
]
3838

3939

openstack_requirements/project.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,4 @@ def read(root):
7171
target_files.append('test-requirements-py%s.txt' % py_version)
7272
for target_file in target_files:
7373
_safe_read(result, target_file, output=requirements)
74-
# Read lower-constraints.txt and ensure the key is always present
75-
# in case the file is missing.
76-
result['lower-constraints.txt'] = None
77-
_safe_read(result, 'lower-constraints.txt')
7874
return result

openstack_requirements/requirement.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# This module has no IO at all, and none should be added.
1616

1717
import collections
18-
import distutils.version
1918
import packaging.specifiers
19+
import packaging.version
2020
import pkg_resources
2121
import re
2222

@@ -26,7 +26,7 @@ def key_specifier(a):
2626
'===': 1, '==': 1, '~=': 1, '!=': 1,
2727
'<': 2, '<=': 2}
2828
a = a._spec
29-
return (weight[a[0]], distutils.version.LooseVersion(a[1]))
29+
return (weight[a[0]], packaging.version.parse(a[1]))
3030

3131

3232
class Requirement(collections.namedtuple('Requirement',
@@ -179,6 +179,11 @@ def _pass_through(req_line, permit_urls=False):
179179
def to_reqs(content, permit_urls=False):
180180
for content_line in content.splitlines(True):
181181
req_line = content_line.strip()
182+
183+
# skip comments, blank lines
184+
if req_line.startswith('#') or not req_line:
185+
continue
186+
182187
if _pass_through(req_line, permit_urls=permit_urls):
183188
yield None, content_line
184189
else:

0 commit comments

Comments
 (0)