Skip to content

Commit 17687fa

Browse files
committed
Clean up packaging smoke test version pins
1 parent 704f983 commit 17687fa

1 file changed

Lines changed: 16 additions & 38 deletions

File tree

tests/integration/test_package.py

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,93 +17,76 @@
1717

1818

1919
PY_VERSION = sys.version_info[:2]
20-
LEGACY_VERSION_CUTOFF = (3, 9)
21-
# Pin numpy for packages that depend on it so these smoke tests do not
22-
# drift to a newer wheel that pip can install locally but Chalice cannot
23-
# package for the target Lambda runtime.
24-
NUMPY_VERSION = '2.3.4' if PY_VERSION >= (3, 14) else '2.2.6'
25-
PANDAS_VERSION = '2.3.3' if PY_VERSION >= (3, 14) else '2.2.3'
26-
# We're being cautious here, but we want to fix the package versions we
27-
# try to install on older versions of python.
28-
# If the python version being tested is less than or equal to
29-
# LEGACY_VERSION_CUTOFF,
30-
# then we'll install the `legacy_version` in the packages below. This is to
31-
# ensure we don't regress on being able to package older package versions on
32-
# older versions on python. Any python version above LEGACY_VERSION_CUTOFF
33-
# will install the `version` identifier. That way newer versions of python
34-
# won't need to update this list as long as a package can still be installed
35-
# on versions greater than LEGACY_VERSION_CUTOFF.
20+
PY314_OR_LATER = PY_VERSION >= (3, 14)
21+
# Keep these smoke-test pins compatible with every Python version in the
22+
# current CI matrix. Some projects dropped Python 3.10 support before adding
23+
# cp314 wheels, so those packages need Python-version-specific pins.
24+
NUMPY_VERSION = '2.3.4' if PY314_OR_LATER else '2.2.6'
25+
PANDAS_VERSION = '2.3.3'
26+
SQLALCHEMY_VERSION = '2.0.49'
27+
SCIPY_VERSION = '1.17.1' if PY314_OR_LATER else '1.15.3'
28+
CFFI_VERSION = '2.0.0'
29+
PYGIT2_VERSION = '1.19.2' if PY314_OR_LATER else '1.17.0'
3630
PACKAGES_TO_TEST = {
3731
'pandas': {
3832
'version': PANDAS_VERSION,
39-
'legacy_version': '1.5.3',
4033
'dependencies': ['numpy==%s' % NUMPY_VERSION],
4134
'contents': [
4235
'pandas/*__init__.py',
4336
'pandas/*cpython-*-x86_64-linux-gnu.so'
4437
],
4538
},
4639
'SQLAlchemy': {
47-
'version': '2.0.40',
48-
'legacy_version': '1.4.47',
40+
'version': SQLALCHEMY_VERSION,
4941
'contents': [
5042
'sqlalchemy/__init__.py',
5143
'sqlalchemy/*cpython-*-x86_64-linux-gnu.so'
5244
],
5345
},
5446
'numpy': {
5547
'version': NUMPY_VERSION,
56-
'legacy_version': '1.23.3',
5748
'contents': [
5849
'numpy/__init__.py',
5950
'numpy/*cpython-*-x86_64-linux-gnu.so'
6051
],
6152
},
6253
'cryptography': {
6354
'version': '44.0.3',
64-
'legacy_version': '39.0.0',
6555
'contents': [
6656
'cryptography/__init__.py',
6757
'cryptography/*.so'
6858
],
6959
},
7060
'Jinja2': {
7161
'version': '3.1.6',
72-
'legacy_version': '2.11.2',
7362
'contents': ['jinja2/__init__.py'],
7463
},
7564
'Mako': {
7665
'version': '1.3.10',
77-
'legacy_version': '1.1.3',
7866
'contents': ['mako/__init__.py'],
7967
},
8068
'MarkupSafe': {
8169
'version': '3.0.2',
82-
'legacy_version': '1.1.1',
8370
'contents': ['markupsafe/__init__.py'],
8471
},
8572
'scipy': {
86-
'version': '1.15.3',
87-
'legacy_version': '1.10.1',
73+
'version': SCIPY_VERSION,
8874
'dependencies': ['numpy==%s' % NUMPY_VERSION],
8975
'contents': [
9076
'scipy/__init__.py',
9177
'scipy/cluster/_hierarchy.cpython-*-x86_64-linux-gnu.so'
9278
],
9379
},
9480
'cffi': {
95-
'version': '1.17.1',
96-
'legacy_version': '1.15.1',
81+
'version': CFFI_VERSION,
9782
'contents': ['_cffi_backend.cpython-*-x86_64-linux-gnu.so'],
9883
},
9984
'pygit2': {
100-
'version': '1.17.0',
101-
'legacy_version': '1.10.1',
85+
'version': PYGIT2_VERSION,
10286
'contents': ['pygit2/_pygit2.cpython-*-x86_64-linux-gnu.so'],
10387
},
10488
'pyrsistent': {
10589
'version': '0.20.0',
106-
'legacy_version': '0.17.3',
10790
'contents': ['pyrsistent/__init__.py'],
10891
},
10992
}
@@ -138,12 +121,8 @@ def _get_random_package_name():
138121

139122
def _get_package_install_test_cases():
140123
testcases = []
141-
if PY_VERSION <= LEGACY_VERSION_CUTOFF:
142-
version_key = 'legacy_version'
143-
else:
144-
version_key = 'version'
145124
for package, config in PACKAGES_TO_TEST.items():
146-
package_version = f'{package}=={config[version_key]}'
125+
package_version = f'{package}=={config["version"]}'
147126
requirements = [package_version] + config.get('dependencies', [])
148127
testcases.append(
149128
pytest.param(requirements, config['contents'], id=package_version)
@@ -229,11 +208,10 @@ def test_can_package_sqlalchemy(self, runner, app_skeleton,
229208
)
230209

231210
def test_can_package_pandas(self, runner, app_skeleton, no_local_config):
232-
version = PANDAS_VERSION if PY_VERSION >= (3, 10) else '2.0.3'
233211
assert_can_package_dependency(
234212
runner,
235213
app_skeleton,
236-
['pandas==' + version, 'numpy==%s' % NUMPY_VERSION],
214+
['pandas==' + PANDAS_VERSION, 'numpy==%s' % NUMPY_VERSION],
237215
contents=[
238216
'pandas/_libs/__init__.py',
239217
],

0 commit comments

Comments
 (0)