Skip to content

Commit

Permalink
Ensure correct normalization of tag names.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Sep 25, 2024
1 parent 7c66f38 commit 5de17e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/packaging/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ def ios_platforms(

if multiarch is None:
multiarch = sys.implementation._multiarch
multiarch = multiarch.replace("-", "_")

ios_platform_template = "ios_{major}_{minor}_{multiarch}"

Expand Down
10 changes: 5 additions & 5 deletions tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def mock_ios(monkeypatch):

# Mock a fake architecture that will fit the expected pattern, but
# wont actually be a legal multiarch
monkeypatch.setattr(sys.implementation, "_multiarch", "gothic_iphoneos")
monkeypatch.setattr(sys.implementation, "_multiarch", "gothic-iphoneos")

# Mock the return value of platform.ios_ver.
def mock_ios_ver(*args):
Expand Down Expand Up @@ -356,7 +356,7 @@ def test_macos_11(self, major, minor):

class TestIOSPlatforms:
def test_version_detection(self, mock_ios):
platforms = list(tags.ios_platforms(multiarch="arm64_iphoneos"))
platforms = list(tags.ios_platforms(multiarch="arm64-iphoneos"))
assert platforms == [
"ios_12_0_arm64_iphoneos",
"ios_12_1_arm64_iphoneos",
Expand All @@ -378,10 +378,10 @@ def test_multiarch_detection(self, mock_ios):
assert platforms == ["ios_12_0_gothic_iphoneos"]

def test_ios_platforms(self, mock_ios):
platforms = list(tags.ios_platforms((12, 0), "arm64_iphoneos"))
platforms = list(tags.ios_platforms((12, 0), "arm64-iphoneos"))
assert platforms == ["ios_12_0_arm64_iphoneos"]

platforms = list(tags.ios_platforms((13, 0), "x86_64_iphonesimulator"))
platforms = list(tags.ios_platforms((13, 0), "x86_64-iphonesimulator"))
assert platforms == [
"ios_12_0_x86_64_iphonesimulator",
"ios_12_1_x86_64_iphonesimulator",
Expand All @@ -396,7 +396,7 @@ def test_ios_platforms(self, mock_ios):
"ios_13_0_x86_64_iphonesimulator",
]

platforms = list(tags.ios_platforms((14, 3), "arm64_iphoneos"))
platforms = list(tags.ios_platforms((14, 3), "arm64-iphoneos"))
assert platforms == [
"ios_12_0_arm64_iphoneos",
"ios_12_1_arm64_iphoneos",
Expand Down

0 comments on commit 5de17e8

Please sign in to comment.