Commit dbc1e1b9 by Maximilian Köhl Committed by GitHub

build: remove 'm' and 'd' ABI tags for Python 3.8 wheels

parent dad6b084
......@@ -76,19 +76,22 @@ def get_abi_tag(env):
env,
"Py_DEBUG",
lambda: hasattr(sys, "gettotalrefcount"),
warn=(impl == "cp"),
warn=(impl == "cp" and env.version_info < (3, 8)),
):
d = "d"
if get_flag(env, "WITH_PYMALLOC", lambda: impl == "cp", warn=(impl == "cp")):
m = "m"
if get_flag(
env,
"Py_UNICODE_SIZE",
lambda: sys.maxunicode == 0x10FFFF,
expected=4,
warn=(impl == "cp" and env.version_info < (3, 3)),
) and env.version_info < (3, 3):
u = "u"
if env.version_info < (3, 8):
if get_flag(
env, "WITH_PYMALLOC", lambda: impl == "cp", warn=(impl == "cp")
):
m = "m"
if get_flag(
env,
"Py_UNICODE_SIZE",
lambda: sys.maxunicode == 0x10FFFF,
expected=4,
warn=(impl == "cp" and env.version_info < (3, 3)),
) and env.version_info < (3, 3):
u = "u"
abi = "%s%s%s%s%s" % (impl, get_impl_ver(env), d, m, u)
elif soabi and soabi.startswith("cpython-"):
abi = "cp" + soabi.split("-")[1]
......
......@@ -1151,6 +1151,7 @@ class MockEnv(NullEnv):
is_venv=False,
pip_version="19.1",
sys_path=None,
config_vars=None,
**kwargs
):
super(MockEnv, self).__init__(**kwargs)
......@@ -1162,6 +1163,7 @@ class MockEnv(NullEnv):
self._is_venv = is_venv
self._pip_version = Version.parse(pip_version)
self._sys_path = sys_path
self._config_vars = config_vars
@property
def version_info(self): # type: () -> Tuple[int]
......@@ -1192,3 +1194,12 @@ class MockEnv(NullEnv):
def is_venv(self): # type: () -> bool
return self._is_venv
def config_var(self, var): # type: (str) -> Any
if self._config_vars is None:
return super().config_var(var)
else:
try:
return self._config_vars[var]
except KeyError:
return None
import pytest
from poetry.masonry.utils.tags import get_abi_tag
from poetry.utils.env import MockEnv
def test_tags_cpython38():
assert (
get_abi_tag(
MockEnv(
version_info=(3, 8, 0),
python_implementation="CPython",
config_vars={"Py_DEBUG": True},
)
)
== "cp38d"
)
assert (
get_abi_tag(
MockEnv(
version_info=(3, 8, 0), python_implementation="CPython", config_vars={},
)
)
== "cp38"
)
def test_tags_cpython37():
assert (
get_abi_tag(
MockEnv(
version_info=(3, 7, 3),
python_implementation="CPython",
config_vars={"Py_DEBUG": True, "WITH_PYMALLOC": True},
)
)
== "cp37dm"
)
assert (
get_abi_tag(
MockEnv(
version_info=(3, 7, 3),
python_implementation="CPython",
config_vars={"Py_DEBUG": True, "WITH_PYMALLOC": False},
)
)
== "cp37d"
)
assert (
get_abi_tag(
MockEnv(
version_info=(3, 7, 3),
python_implementation="CPython",
config_vars={"Py_DEBUG": False, "WITH_PYMALLOC": True},
)
)
== "cp37m"
)
assert (
get_abi_tag(
MockEnv(
version_info=(3, 7, 3),
python_implementation="CPython",
config_vars={"Py_DEBUG": False, "WITH_PYMALLOC": False},
)
)
== "cp37"
)
with pytest.warns(RuntimeWarning):
assert (
get_abi_tag(
MockEnv(
version_info=(3, 7, 3),
python_implementation="CPython",
config_vars={"Py_DEBUG": False},
)
)
== "cp37m"
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment