|
17 | 17 |
|
18 | 18 |
|
19 | 19 | 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' |
36 | 30 | PACKAGES_TO_TEST = { |
37 | 31 | 'pandas': { |
38 | 32 | 'version': PANDAS_VERSION, |
39 | | - 'legacy_version': '1.5.3', |
40 | 33 | 'dependencies': ['numpy==%s' % NUMPY_VERSION], |
41 | 34 | 'contents': [ |
42 | 35 | 'pandas/*__init__.py', |
43 | 36 | 'pandas/*cpython-*-x86_64-linux-gnu.so' |
44 | 37 | ], |
45 | 38 | }, |
46 | 39 | 'SQLAlchemy': { |
47 | | - 'version': '2.0.40', |
48 | | - 'legacy_version': '1.4.47', |
| 40 | + 'version': SQLALCHEMY_VERSION, |
49 | 41 | 'contents': [ |
50 | 42 | 'sqlalchemy/__init__.py', |
51 | 43 | 'sqlalchemy/*cpython-*-x86_64-linux-gnu.so' |
52 | 44 | ], |
53 | 45 | }, |
54 | 46 | 'numpy': { |
55 | 47 | 'version': NUMPY_VERSION, |
56 | | - 'legacy_version': '1.23.3', |
57 | 48 | 'contents': [ |
58 | 49 | 'numpy/__init__.py', |
59 | 50 | 'numpy/*cpython-*-x86_64-linux-gnu.so' |
60 | 51 | ], |
61 | 52 | }, |
62 | 53 | 'cryptography': { |
63 | 54 | 'version': '44.0.3', |
64 | | - 'legacy_version': '39.0.0', |
65 | 55 | 'contents': [ |
66 | 56 | 'cryptography/__init__.py', |
67 | 57 | 'cryptography/*.so' |
68 | 58 | ], |
69 | 59 | }, |
70 | 60 | 'Jinja2': { |
71 | 61 | 'version': '3.1.6', |
72 | | - 'legacy_version': '2.11.2', |
73 | 62 | 'contents': ['jinja2/__init__.py'], |
74 | 63 | }, |
75 | 64 | 'Mako': { |
76 | 65 | 'version': '1.3.10', |
77 | | - 'legacy_version': '1.1.3', |
78 | 66 | 'contents': ['mako/__init__.py'], |
79 | 67 | }, |
80 | 68 | 'MarkupSafe': { |
81 | 69 | 'version': '3.0.2', |
82 | | - 'legacy_version': '1.1.1', |
83 | 70 | 'contents': ['markupsafe/__init__.py'], |
84 | 71 | }, |
85 | 72 | 'scipy': { |
86 | | - 'version': '1.15.3', |
87 | | - 'legacy_version': '1.10.1', |
| 73 | + 'version': SCIPY_VERSION, |
88 | 74 | 'dependencies': ['numpy==%s' % NUMPY_VERSION], |
89 | 75 | 'contents': [ |
90 | 76 | 'scipy/__init__.py', |
91 | 77 | 'scipy/cluster/_hierarchy.cpython-*-x86_64-linux-gnu.so' |
92 | 78 | ], |
93 | 79 | }, |
94 | 80 | 'cffi': { |
95 | | - 'version': '1.17.1', |
96 | | - 'legacy_version': '1.15.1', |
| 81 | + 'version': CFFI_VERSION, |
97 | 82 | 'contents': ['_cffi_backend.cpython-*-x86_64-linux-gnu.so'], |
98 | 83 | }, |
99 | 84 | 'pygit2': { |
100 | | - 'version': '1.17.0', |
101 | | - 'legacy_version': '1.10.1', |
| 85 | + 'version': PYGIT2_VERSION, |
102 | 86 | 'contents': ['pygit2/_pygit2.cpython-*-x86_64-linux-gnu.so'], |
103 | 87 | }, |
104 | 88 | 'pyrsistent': { |
105 | 89 | 'version': '0.20.0', |
106 | | - 'legacy_version': '0.17.3', |
107 | 90 | 'contents': ['pyrsistent/__init__.py'], |
108 | 91 | }, |
109 | 92 | } |
@@ -138,12 +121,8 @@ def _get_random_package_name(): |
138 | 121 |
|
139 | 122 | def _get_package_install_test_cases(): |
140 | 123 | testcases = [] |
141 | | - if PY_VERSION <= LEGACY_VERSION_CUTOFF: |
142 | | - version_key = 'legacy_version' |
143 | | - else: |
144 | | - version_key = 'version' |
145 | 124 | for package, config in PACKAGES_TO_TEST.items(): |
146 | | - package_version = f'{package}=={config[version_key]}' |
| 125 | + package_version = f'{package}=={config["version"]}' |
147 | 126 | requirements = [package_version] + config.get('dependencies', []) |
148 | 127 | testcases.append( |
149 | 128 | pytest.param(requirements, config['contents'], id=package_version) |
@@ -229,11 +208,10 @@ def test_can_package_sqlalchemy(self, runner, app_skeleton, |
229 | 208 | ) |
230 | 209 |
|
231 | 210 | 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' |
233 | 211 | assert_can_package_dependency( |
234 | 212 | runner, |
235 | 213 | app_skeleton, |
236 | | - ['pandas==' + version, 'numpy==%s' % NUMPY_VERSION], |
| 214 | + ['pandas==' + PANDAS_VERSION, 'numpy==%s' % NUMPY_VERSION], |
237 | 215 | contents=[ |
238 | 216 | 'pandas/_libs/__init__.py', |
239 | 217 | ], |
|
0 commit comments