-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create binary wheels with mypyc (#242)
Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
- Loading branch information
Showing
11 changed files
with
219 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# Changelog | ||
|
||
## 2.2.0 | ||
|
||
- Added | ||
- mypyc generated binary wheels for common platforms | ||
|
||
## 2.1.0 | ||
|
||
- Deprecated | ||
|
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 @@ | ||
prune tests/ |
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 @@ | ||
tomli-w |
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,12 @@ | ||
from pathlib import Path | ||
import tomllib | ||
|
||
import tomli_w # type: ignore[import-not-found] | ||
|
||
pyproject_path = Path(__file__).parent.parent / "pyproject.toml" | ||
data = tomllib.loads(pyproject_path.read_bytes().decode()) | ||
data["build-system"] = { | ||
"requires": ["setuptools>=69", "mypy[mypyc]>=1.13"], | ||
"build-backend": "setuptools.build_meta", | ||
} | ||
pyproject_path.write_bytes(tomli_w.dumps(data).encode()) |
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,15 @@ | ||
import os | ||
|
||
from setuptools import setup # type: ignore[import-untyped] | ||
|
||
if os.environ.get("TOMLI_USE_MYPYC") == "1": | ||
import glob | ||
|
||
from mypyc.build import mypycify # type: ignore[import-untyped] | ||
|
||
files = glob.glob("src/**/*.py", recursive=True) | ||
ext_modules = mypycify(files) | ||
else: | ||
ext_modules = [] | ||
|
||
setup(ext_modules=ext_modules) |
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
Oops, something went wrong.