diff options
author | David Tucker <david.tucker@emc.com> | 2022-11-29 14:01:23 -0800 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2023-01-23 23:53:46 +0200 |
commit | bd02d4cfef1a0386a7e11f40325932cf5b4b932e (patch) | |
tree | 896fa27804775105dd6f2ae6ef79880f75a896d8 | |
parent | 8dfef1355a8f19e773a08630613bd2da6c636c37 (diff) | |
download | wheel-git-bd02d4cfef1a0386a7e11f40325932cf5b4b932e.tar.gz |
Replace spaces in platform names with underscores
Without this, wheels produced on such platforms will cause a WheelError.
-rw-r--r-- | src/wheel/bdist_wheel.py | 4 | ||||
-rw-r--r-- | tests/test_bdist_wheel.py | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py index 7fcf4a3..4b81be5 100644 --- a/src/wheel/bdist_wheel.py +++ b/src/wheel/bdist_wheel.py @@ -285,7 +285,9 @@ class bdist_wheel(Command): ): plat_name = "linux_i686" - plat_name = plat_name.lower().replace("-", "_").replace(".", "_") + plat_name = ( + plat_name.lower().replace("-", "_").replace(".", "_").replace(" ", "_") + ) if self.root_is_pure: if self.universal: diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py index 5a6db16..cede03b 100644 --- a/tests/test_bdist_wheel.py +++ b/tests/test_bdist_wheel.py @@ -282,3 +282,11 @@ def test_get_abi_tag_new(monkeypatch): monkeypatch.setattr(sysconfig, "get_config_var", lambda x: "pypy37-pp73-darwin") monkeypatch.setattr(tags, "interpreter_name", lambda: "pp") assert get_abi_tag() == "pypy37_pp73" + + +def test_platform_with_space(dummy_dist, monkeypatch): + """Ensure building on platforms with a space in the name succeed.""" + monkeypatch.chdir(dummy_dist) + subprocess.check_call( + [sys.executable, "setup.py", "bdist_wheel", "--plat-name", "isilon onefs"] + ) |