Skip to content

Commit f76f4f2

Browse files
author
hauntsaninja
committed
Cleanup build_wheel script
1 parent 82f767a commit f76f4f2

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ graft mypyc/doc
3030

3131
# files necessary for testing sdist
3232
include mypy-requirements.txt
33-
include build-requirements.txt
3433
include test-requirements.txt
3534
include mypy_self_check.ini
3635
prune misc

build-requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

misc/build_wheel.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
The main GitHub workflow where this script is used:
44
https://github.com/mypyc/mypy_mypyc-wheels/blob/master/.github/workflows/build.yml
55
6-
This uses cibuildwheel (https://github.com/pypa/cibuildwheel) to
7-
build the wheels.
6+
This uses cibuildwheel (https://github.com/pypa/cibuildwheel) to build the wheels.
87
98
Usage:
109
11-
build_wheel_ci.py --python-version <python-version> \
12-
--output-dir <dir>
10+
build_wheel.py --python-version <python-version> --output-dir <dir>
1311
1412
Wheels for the given Python version will be created in the given directory.
1513
Python version is in form "39".
@@ -18,9 +16,7 @@
1816
1917
You can test locally by using --extra-opts. macOS example:
2018
21-
mypy/misc/build_wheel_ci.py --python-version 39 --output-dir out --extra-opts="--platform macos"
22-
23-
Other supported values for platform: linux, windows
19+
mypy/misc/build_wheel.py --python-version 39 --output-dir out --extra-opts="--platform macos"
2420
"""
2521

2622
import argparse
@@ -39,13 +35,13 @@ def create_environ(python_version: str) -> Dict[str, str]:
3935
"""Set up environment variables for cibuildwheel."""
4036
env = os.environ.copy()
4137

42-
env['CIBW_BUILD'] = "cp{}-*".format(python_version)
38+
env['CIBW_BUILD'] = f"cp{python_version}-*"
4339

4440
# Don't build 32-bit wheels
4541
env['CIBW_SKIP'] = "*-manylinux_i686 *-win32"
4642

4743
# Apple Silicon support
48-
# When cross-compiling on Intel, it is not possible to test arm64 and
44+
# When cross-compiling on Intel, it is not possible to test arm64 and
4945
# the arm64 part of a universal2 wheel. Warnings will be silenced with
5046
# following CIBW_TEST_SKIP
5147
env['CIBW_ARCHS_MACOS'] = "x86_64 arm64"
@@ -54,22 +50,16 @@ def create_environ(python_version: str) -> Dict[str, str]:
5450
env['CIBW_BUILD_VERBOSITY'] = '1'
5551

5652
# mypy's isolated builds don't specify the requirements mypyc needs, so install
57-
# requirements and don't use isolated builds. we need to use build-requirements.txt
58-
# with recent mypy commits to get stub packages needed for compilation.
59-
#
60-
# TODO: remove use of mypy-requirements.txt once we no longer need to support
61-
# building pre modular typeshed releases
53+
# requirements and don't use isolated builds.
6254
env['CIBW_BEFORE_BUILD'] = """
63-
pip install -r {package}/mypy-requirements.txt &&
64-
(pip install -r {package}/build-requirements.txt || true)
55+
pip install -r {package}/mypy-requirements.txt
6556
""".replace('\n', ' ')
6657

6758
# download a copy of clang to use to compile on linux. this was probably built in 2018,
6859
# speeds up compilation 2x
6960
env['CIBW_BEFORE_BUILD_LINUX'] = """
7061
(cd / && curl -L %s | tar xzf -) &&
71-
pip install -r {package}/mypy-requirements.txt &&
72-
(pip install -r {package}/build-requirements.txt || true)
62+
pip install -r {package}/mypy-requirements.txt
7363
""".replace('\n', ' ') % LLVM_URL
7464

7565
# the double negative is counterintuitive, https://github.com/pypa/pip/issues/5735
@@ -128,8 +118,7 @@ def main() -> None:
128118
output_dir = args.output_dir
129119
extra_opts = args.extra_opts
130120
environ = create_environ(python_version)
131-
script = 'python -m cibuildwheel {} --output-dir {} {}'.format(extra_opts, output_dir,
132-
ROOT_DIR)
121+
script = f'python -m cibuildwheel {extra_opts} --output-dir {output_dir} {ROOT_DIR}'
133122
subprocess.check_call(script, shell=True, env=environ)
134123

135124

test-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-r mypy-requirements.txt
2-
-r build-requirements.txt
32
attrs>=18.0
43
flake8>=3.8.1
54
flake8-bugbear

0 commit comments

Comments
 (0)