Skip to content

Commit 2440e1c

Browse files
committed
Get latest available pure python package for each host
This commit creates dedicated asset templates for value of "python_version" key to make sure PyPiClient downloads latest available package for each python version. The issue to solve is that pure python packages don't carry any information about supported python versions in their name. name-1.0.0-py3-any.whl maybe 3.8+ name-1.1.0-py3-any.whl maybe 3.13+
1 parent f8a858a commit 2440e1c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

package_control/clients/pypi_client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,18 @@ def _make_download_info(pattern, selectors, version, assets):
288288
return info
289289

290290
return None
291+
292+
@staticmethod
293+
def _expand_asset_variables(asset_templates):
294+
output = []
295+
for pattern, spec in JSONApiClient._expand_asset_variables(asset_templates):
296+
if len(spec["python_versions"]) == 1:
297+
output.append((pattern, spec))
298+
continue
299+
300+
for py_ver in spec["python_versions"]:
301+
new_spec = spec.copy()
302+
new_spec["python_versions"] = [py_ver]
303+
output.append((pattern, new_spec))
304+
305+
return output

0 commit comments

Comments
 (0)