-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support PyPy builds - not Windows (#28)
Needs to run pypy_patch.py after builds until PyO3/maturin#312 is closed Cannot support Windows PyPy until PyO3/maturin#115 is closed
- Loading branch information
1 parent
a7c41df
commit e94b30f
Showing
4 changed files
with
105 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import sysconfig | ||
import pathlib | ||
import re | ||
import sys | ||
|
||
""" | ||
Hacky hack, not very good support with maturin for PyPy | ||
1. Doesn't work on Windows | ||
2. The naming is wrong in resulting wheels in Linux & OSX | ||
This script patches the last issue; ran after normal maturin build for these | ||
systems on PyPy builds. | ||
""" | ||
|
||
abi = sysconfig.get_config_var("SOABI").replace("-", "_") | ||
major, minor = sys.version_info.major, sys.version_info.minor | ||
|
||
regex = re.compile(r"(?P<name>pp3[py0-9_]+-pypy[3_p0-9]+)") | ||
|
||
for file in pathlib.Path("./wheels").iterdir(): | ||
if file.name.endswith(".whl"): | ||
new_name = regex.sub(f"pp{major}{minor}-{abi}", file.name) | ||
new_name = new_name.replace("linux", "manylinux2010") | ||
print(f"Renaming {file.name} -> {new_name}") | ||
file.rename(file.parent.joinpath(new_name)) |