Skip to content

Commit

Permalink
Use packaging.tags instead of distlib
Browse files Browse the repository at this point in the history
See the discussion in #5
  • Loading branch information
tttapa committed May 28, 2022
1 parent 88a8db3 commit 68e751c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["distlib", "flit"]
requires = ["distlib~=0.3", "flit~=3.7"]
build-backend = "py_build_cmake.build"
backend-path = ["src"]

Expand All @@ -22,7 +22,7 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
]
dependencies = ["distlib~=0.3", "flit~=3.7"]
dependencies = ["distlib~=0.3", "flit~=3.7", "packaging~=21.0"]
dynamic = ["version", "description"]

[project.urls]
Expand Down
10 changes: 9 additions & 1 deletion src/py_build_cmake/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,16 @@ def create_wheel(self, wheel_directory, tmp_build_dir, cfg, dist_name,
tags = None
if cfg.cross:
tags = self.get_cross_tags(cfg.cross)
if pure:
elif pure:
tags = {'pyver': ['py3']}
else:
import packaging.tags
tag = next(packaging.tags.sys_tags())
tags = {
'pyver': [tag.interpreter],
'abi': [tag.abi],
'arch': [tag.platform],
}
wheel_path = whl.build(paths, tags=tags, wheel_version=(1, 0))
whl_name = os.path.relpath(wheel_path, wheel_directory)
return whl_name
Expand Down

0 comments on commit 68e751c

Please sign in to comment.