Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove 'm' and 'd' ABI tags for Python 3.8 wheels #2121

Merged
merged 7 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions poetry/masonry/utils/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
koehlma marked this conversation as resolved.
Show resolved Hide resolved
):
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]
Expand Down
11 changes: 11 additions & 0 deletions poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,7 @@ def __init__(
is_venv=False,
pip_version="19.1",
sys_path=None,
config_vars=None,
**kwargs
):
super(MockEnv, self).__init__(**kwargs)
Expand All @@ -1162,6 +1163,7 @@ def __init__(
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]
Expand Down Expand Up @@ -1192,3 +1194,12 @@ def sys_path(self):

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
23 changes: 23 additions & 0 deletions tests/masonry/utils/test_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from poetry.masonry.utils.tags import get_abi_tag
from poetry.utils.env import MockEnv


def test_tags_cpython38():
koehlma marked this conversation as resolved.
Show resolved Hide resolved
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"
)