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

[0.980 backport] build changes #13688

Merged
merged 3 commits into from Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -120,7 +120,7 @@ jobs:
if: ${{ matrix.test_mypyc }}
run: |
pip install -r test-requirements.txt
CC=clang MYPYC_OPT_LEVEL=0 python3 setup.py --use-mypyc build_ext --inplace
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
- name: Setup tox environment
run: tox -e ${{ matrix.toxenv }} --notest
- name: Test
Expand Down
3 changes: 2 additions & 1 deletion build-requirements.txt
@@ -1,3 +1,4 @@
# NOTE: this needs to be kept in sync with the "requires" list in pyproject.toml
-r mypy-requirements.txt
types-setuptools
types-typed-ast>=1.5.0,<1.6.0
types-typed-ast>=1.5.8,<1.6.0
1 change: 1 addition & 0 deletions mypy-requirements.txt
@@ -1,3 +1,4 @@
# NOTE: this needs to be kept in sync with the "requires" list in pyproject.toml
typing_extensions>=3.10
mypy_extensions>=0.4.3
typed_ast>=1.4.0,<2; python_version<'3.8'
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
@@ -1,7 +1,19 @@
[build-system]
requires = [
# NOTE: this needs to be kept in sync with mypy-requirements.txt
# and build-requirements.txt, because those are both needed for
# self-typechecking :/
"setuptools >= 40.6.2",
"wheel >= 0.30.0",
# the following is from mypy-requirements.txt
"typing_extensions>=3.10",
"mypy_extensions>=0.4.3",
"typed_ast>=1.4.0,<2; python_version<'3.8'",
"tomli>=1.1.0; python_version<'3.11'",
# the following is from build-requirements.txt
"types-psutil",
"types-setuptools",
"types-typed-ast>=1.5.8,<1.6.0",
]
build-backend = "setuptools.build_meta"

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -79,8 +79,8 @@ def run(self):

USE_MYPYC = False
# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH
if len(sys.argv) > 1 and sys.argv[1] == "--use-mypyc":
sys.argv.pop(1)
if len(sys.argv) > 1 and "--use-mypyc" in sys.argv:
sys.argv.remove("--use-mypyc")
USE_MYPYC = True
if os.getenv("MYPY_USE_MYPYC", None) == "1":
USE_MYPYC = True
Expand Down