summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-03-25 13:46:09 +0100
committerGitHub <noreply@github.com>2024-03-25 13:46:09 +0100
commit9b046a39a8530b5d65b435c932b794a7259e7ea7 (patch)
treeb7e77ed0ce5d4f98d841f02bb54a2e98e079da07 /lib
parent0c9a53ba3a9c94ee60fa3825160e72ff025fb8b7 (diff)
downloadspack-9b046a39a8530b5d65b435c932b794a7259e7ea7.tar.gz
spack-9b046a39a8530b5d65b435c932b794a7259e7ea7.tar.bz2
spack-9b046a39a8530b5d65b435c932b794a7259e7ea7.tar.xz
spack-9b046a39a8530b5d65b435c932b794a7259e7ea7.zip
strip url: fix whl suffix, remove exe (#43344)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/url.py6
-rw-r--r--lib/spack/spack/test/llnl/url.py9
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/spack/llnl/url.py b/lib/spack/llnl/url.py
index 9812af5eaa..92acfed38d 100644
--- a/lib/spack/llnl/url.py
+++ b/lib/spack/llnl/url.py
@@ -357,10 +357,8 @@ def strip_version_suffixes(path_or_url: str) -> str:
r"i[36]86",
r"ppc64(le)?",
r"armv?(7l|6l|64)?",
- # PyPI
- r"[._-]py[23].*\.whl",
- r"[._-]cp[23].*\.whl",
- r"[._-]win.*\.exe",
+ # PyPI wheels
+ r"-(?:py|cp)[23].*",
]
for regex in suffix_regexes:
diff --git a/lib/spack/spack/test/llnl/url.py b/lib/spack/spack/test/llnl/url.py
index 3e13e6a729..ffe344fee2 100644
--- a/lib/spack/spack/test/llnl/url.py
+++ b/lib/spack/spack/test/llnl/url.py
@@ -84,14 +84,15 @@ def test_get_bad_extension():
("astyle_1.23_macosx", "astyle_1.23"),
("haxe-2.08-osx", "haxe-2.08"),
# PyPI - wheel
- ("entrypoints-0.2.2-py2.py3-none-any.whl", "entrypoints-0.2.2"),
+ ("wheel-1.2.3-py3-none-any", "wheel-1.2.3"),
+ ("wheel-1.2.3-py2.py3-none-any", "wheel-1.2.3"),
+ ("wheel-1.2.3-cp38-abi3-macosx_10_12_x86_64", "wheel-1.2.3"),
+ ("entrypoints-0.2.2-py2.py3-none-any", "entrypoints-0.2.2"),
(
"numpy-1.12.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel."
- "macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl",
+ "macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64",
"numpy-1.12.0",
),
- # PyPI - exe
- ("PyYAML-3.12.win-amd64-py3.5.exe", "PyYAML-3.12"),
# Combinations of multiple patterns - bin, release
("rocketmq-all-4.5.2-bin-release", "rocketmq-all-4.5.2"),
# Combinations of multiple patterns - all