From ee854f3700962061304894a7b001879019c3c4cd Mon Sep 17 00:00:00 2001 From: savin Date: Fri, 28 Feb 2025 20:20:33 -0800 Subject: [PATCH 1/2] changes --- metaflow/plugins/pypi/pip.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/metaflow/plugins/pypi/pip.py b/metaflow/plugins/pypi/pip.py index 5aeb03ec5f4..76b133ba92a 100644 --- a/metaflow/plugins/pypi/pip.py +++ b/metaflow/plugins/pypi/pip.py @@ -68,7 +68,7 @@ def solve(self, id_, packages, python, platform): with tempfile.TemporaryDirectory() as tmp_dir: report = "{tmp_dir}/report.json".format(tmp_dir=tmp_dir) - implementations, platforms, abis = zip( + interpreter, platforms, abis = zip( *[ (tag.interpreter, tag.platform, tag.abi) for tag in pip_tags(python, platform) @@ -92,7 +92,8 @@ def solve(self, id_, packages, python, platform): ), *(chain.from_iterable(product(["--abi"], set(abis)))), *(chain.from_iterable(product(["--platform"], set(platforms)))), - # *(chain.from_iterable(product(["--implementations"], set(implementations)))), + *(chain.from_iterable(product(["--implementation"], set(["cp"])))), + "--python-version=%s" % python, ] for package, version in packages.items(): if version.startswith(("<", ">", "!", "~", "@")): @@ -106,9 +107,9 @@ def solve(self, id_, packages, python, platform): except PipPackageNotFound as ex: # pretty print package errors raise PipException( - "Unable to find a binary distribution compatible with %s for %s.\n\n" + "Unable to find a binary distribution compatible with %s for %s.\n\n %s" "Note: ***@pypi*** does not currently support source distributions" - % (ex.package_spec, platform) + % (ex.package_spec, platform, ex.error) ) def _format(dl_info): @@ -205,7 +206,7 @@ def _build(key, package): shutil.move(os.path.join(path, wheel), target) metadata["{url}".format(**package)] = target - implementations, platforms, abis = zip( + interpreter, platforms, abis = zip( *[ (tag.interpreter, tag.platform, tag.abi) for tag in pip_tags(python, platform) @@ -228,7 +229,8 @@ def _build(key, package): ), *(chain.from_iterable(product(["--abi"], set(abis)))), *(chain.from_iterable(product(["--platform"], set(platforms)))), - # *(chain.from_iterable(product(["--implementations"], set(implementations)))), + *(chain.from_iterable(product(["--implementation"], set(["cp"])))), + "--python-version=%s" % python, ] packages = [package for package in packages if not package["require_build"]] for package in packages: From b426f8b5671f30fdf94a768da1c7c458d09a91c7 Mon Sep 17 00:00:00 2001 From: savin Date: Fri, 28 Feb 2025 20:21:40 -0800 Subject: [PATCH 2/2] change --- metaflow/plugins/pypi/pip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metaflow/plugins/pypi/pip.py b/metaflow/plugins/pypi/pip.py index 76b133ba92a..a09c0a6881a 100644 --- a/metaflow/plugins/pypi/pip.py +++ b/metaflow/plugins/pypi/pip.py @@ -107,9 +107,9 @@ def solve(self, id_, packages, python, platform): except PipPackageNotFound as ex: # pretty print package errors raise PipException( - "Unable to find a binary distribution compatible with %s for %s.\n\n %s" + "Unable to find a binary distribution compatible with %s for %s.\n\n" "Note: ***@pypi*** does not currently support source distributions" - % (ex.package_spec, platform, ex.error) + % (ex.package_spec, platform) ) def _format(dl_info):