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

Update to PyPy 7.3.4 #629

Closed
wants to merge 11 commits into from
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ What does it do?
| CPython 3.7 | ✅ | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.8 | ✅ | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| PyPy 2.7 v7.3.3 | ✅ | | | ✅ | ✅ | | | | |
| PyPy 3.6 v7.3.3 | ✅ | | | ✅ | ✅ | | | | |
| PyPy 3.7 (beta) v7.3.3 | ✅ | | | ✅ | ✅ | | | | |
| PyPy 2.7 v7.3.4 | ✅ | | | | | ✅ | | | |
| PyPy 3.7 v7.3.4 | ✅ | | | ✅ | | ✅ | | | |
YannickJadoul marked this conversation as resolved.
Show resolved Hide resolved

<sup>¹ Not supported on Travis</sup><br>

Expand Down
10 changes: 5 additions & 5 deletions bin/update_pythons.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def __init__(self, arch_str: ArchStr):
self.arch = arch_str

def update_version_windows(self, spec: Specifier) -> ConfigWinCP:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll probably take some more changes. But I'm guessing we'll have to wait for a final release of 7.3.4 to fix it.

if self.arch != "32":
raise RuntimeError("64 bit releases not supported yet on Windows")
if self.arch != "64":
raise RuntimeError("32 bit releases not supported on Windows")

releases = [r for r in self.releases if spec.contains(r["python_version"])]
releases = sorted(releases, key=lambda r: r["pypy_version"])
Expand All @@ -126,14 +126,14 @@ def update_version_windows(self, spec: Specifier) -> ConfigWinCP:

release = releases[-1]
version = release["python_version"]
identifier = f"pp{version.major}{version.minor}-win32"
identifier = f"pp{version.major}{version.minor}-win_amd64"

(url,) = [rf["download_url"] for rf in release["files"] if "" in rf["platform"] == "win32"]
(url,) = [rf["download_url"] for rf in release["files"] if "" in rf["platform"] == "win64"]

return ConfigWinPP(
identifier=identifier,
version=f"{version.major}.{version.minor}",
arch="32",
arch="64",
url=url,
)

Expand Down
12 changes: 0 additions & 12 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
get_build_verbosity_extra_flags,
prepare_command,
read_python_configs,
resources_dir,
)


Expand Down Expand Up @@ -105,17 +104,6 @@ def build(options: BuildOptions) -> None:
log.build_start(config.identifier)

dependency_constraint_flags: List[PathOrStr] = []
if config.identifier.startswith("pp"):
# Patch PyPy to make sure headers get installed into a venv
patch_version = '_27' if config.version == '2.7' else ''
patch_path = resources_dir / f'pypy_venv{patch_version}.patch'
patch_docker_path = PurePath('/pypy_venv.patch')
docker.copy_into(patch_path, patch_docker_path)
try:
docker.call(['patch', '--force', '-p1', '-d', config.path, '-i', patch_docker_path])
except subprocess.CalledProcessError:
print("PyPy patch not applied", file=sys.stderr)

if options.dependency_constraints:
constraints_file = options.dependency_constraints.get_for_python_version(config.version)
container_constraints_file = PurePath('/constraints.txt')
Expand Down
5 changes: 0 additions & 5 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
install_certifi_script,
prepare_command,
read_python_configs,
resources_dir,
unwrap,
)

Expand Down Expand Up @@ -163,10 +162,6 @@ def install_pypy(version: str, url: str) -> Path:
downloaded_tar_bz2 = Path("/tmp") / pypy_tar_bz2
download(url, downloaded_tar_bz2)
call(['tar', '-C', '/tmp', '-xf', downloaded_tar_bz2])
# Patch PyPy to make sure headers get installed into a venv
patch_version = '_27' if version == '2.7' else ''
patch_path = resources_dir / f'pypy_venv{patch_version}.patch'
call(['patch', '--force', '-p1', '-d', installation_path, '-i', patch_path])

installation_bin_path = installation_path / 'bin'
python_executable = 'pypy3' if version[0] == '3' else 'pypy'
Expand Down
10 changes: 3 additions & 7 deletions cibuildwheel/resources/build-platforms.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ python_configurations = [
{ identifier = "cp38-manylinux_i686", version = "3.8", path_str = "/opt/python/cp38-cp38" },
{ identifier = "cp39-manylinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "pp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/pp27-pypy_73" },
{ identifier = "pp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/pp36-pypy36_pp73" },
{ identifier = "pp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
{ identifier = "cp35-manylinux_aarch64", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
{ identifier = "cp36-manylinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
Expand Down Expand Up @@ -44,9 +43,8 @@ python_configurations = [
{ identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
{ identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
{ identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
{ identifier = "pp27-macosx_x86_64", version = "2.7", url = "https://downloads.python.org/pypy/pypy2.7-v7.3.3-osx64.tar.bz2" },
{ identifier = "pp36-macosx_x86_64", version = "3.6", url = "https://downloads.python.org/pypy/pypy3.6-v7.3.3-osx64.tar.bz2" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.3-osx64.tar.bz2" },
{ identifier = "pp27-macosx_x86_64", version = "2.7", url = "https://downloads.python.org/pypy/pypy2.7-v7.3.4rc2-osx64.tar.bz2" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.3rc2-osx64.tar.bz2" },
]

[windows]
Expand All @@ -63,7 +61,5 @@ python_configurations = [
{ identifier = "cp38-win_amd64", version = "3.8.9", arch = "64" },
{ identifier = "cp39-win32", version = "3.9.4", arch = "32" },
{ identifier = "cp39-win_amd64", version = "3.9.4", arch = "64" },
{ identifier = "pp27-win32", version = "2.7", arch = "32", url = "https://downloads.python.org/pypy/pypy2.7-v7.3.3-win32.zip" },
{ identifier = "pp36-win32", version = "3.6", arch = "32", url = "https://downloads.python.org/pypy/pypy3.6-v7.3.3-win32.zip" },
{ identifier = "pp37-win32", version = "3.7", arch = "32", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.3-win32.zip" },
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.4rc2-win64.zip" },
]
2 changes: 1 addition & 1 deletion cibuildwheel/resources/pinned_docker_images.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-04-04-096d3ac
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-04-04-096d3ac

[pypy_x86_64]
manylinux2010 = pypywheels/manylinux2010-pypy_x86_64:2020-12-11-f1e0e80
manylinux2010 = yannickjadoul/manylinux2010-pypy_x86_64:7.3.4rc2

[aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-04-04-096d3ac
Expand Down
36 changes: 0 additions & 36 deletions cibuildwheel/resources/pypy_venv.patch

This file was deleted.

27 changes: 0 additions & 27 deletions cibuildwheel/resources/pypy_venv_27.patch

This file was deleted.

2 changes: 1 addition & 1 deletion cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def install_cpython(version: str, arch: str, nuget: Path) -> Path:


def install_pypy(version: str, arch: str, url: str) -> Path:
assert arch == '32'
assert arch == '64' and 'win64' in url
# Inside the PyPy zip file is a directory with the same name
zip_filename = url.rsplit('/', 1)[-1]
extension = ".zip"
Expand Down
5 changes: 2 additions & 3 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ When setting the options, you can use shell-style globbing syntax, as per [`fnma
| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64<br/>cp37-win32 | cp37-manylinux_x86_64<br/>cp37-manylinux_i686 | cp37-manylinux_aarch64<br/>cp37-manylinux_ppc64le<br/>cp37-manylinux_s390x |
| Python 3.8 | cp38-macosx_x86_64 | cp38-win_amd64<br/>cp38-win32 | cp38-manylinux_x86_64<br/>cp38-manylinux_i686 | cp38-manylinux_aarch64<br/>cp38-manylinux_ppc64le<br/>cp38-manylinux_s390x |
| Python 3.9 | cp39-macosx_x86_64<br/>cp39-macosx_universal2<br/>cp39-macosx_arm64 | cp39-win_amd64<br/>cp39-win32 | cp39-manylinux_x86_64<br/>cp39-manylinux_i686 | cp39-manylinux_aarch64<br/>cp39-manylinux_ppc64le<br/>cp39-manylinux_s390x |
| PyPy2.7 v7.3 | pp27-macosx_x86_64 | pp27-win32 | pp27-manylinux_x86_64 | |
| PyPy3.6 v7.3 | pp36-macosx_x86_64 | pp36-win32 | pp36-manylinux_x86_64 | |
| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win32 | pp37-manylinux_x86_64 | |
| PyPy2.7 v7.3 | pp27-macosx_x86_64 | | pp27-manylinux_x86_64 | |
| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win_amd64 | pp37-manylinux_x86_64 | |


The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to `cibuildwheel`.
Expand Down
15 changes: 7 additions & 8 deletions test/test_cpp_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def test_cpp11(tmp_path):
cpp11_project.generate(project_dir)

# VC++ for Python 2.7 does not support modern standards
add_env = {'CIBW_SKIP': 'cp27-win* pp27-win32'}
add_env = {'CIBW_SKIP': 'cp27-win*'}

actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
if 'cp27-cp27m-win' not in w and 'pp27-pypy_73-win32' not in w]
if 'cp27-cp27m-win' not in w]

assert set(actual_wheels) == set(expected_wheels)

Expand All @@ -110,12 +110,12 @@ def test_cpp14(tmp_path):

# VC++ for Python 2.7 does not support modern standards
# The manylinux1 docker image does not have a compiler which supports C++11
add_env = {'CIBW_SKIP': 'cp27-win* pp27-win32'}
add_env = {'CIBW_SKIP': 'cp27-win*'}

actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0')
if 'cp27-cp27m-win' not in w
and 'pp27-pypy_73-win32' not in w]
and 'pp27-pypy_73-win_amd64' not in w]

assert set(actual_wheels) == set(expected_wheels)

Expand Down Expand Up @@ -195,15 +195,14 @@ def add_vcvars(prev_env, platform):
return env

add_env_x86 = add_vcvars(add_env, 'x86')
add_env_x86['CIBW_BUILD'] = '?p27-win32'
add_env_x86['CIBW_BUILD'] = 'cp27-win32'
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env_x86)

add_env_x64 = add_vcvars(add_env, 'x64')
add_env_x64['CIBW_BUILD'] = 'cp27-win_amd64'
add_env_x64['CIBW_BUILD'] = '?p27-win_amd64'
actual_wheels += utils.cibuildwheel_run(project_dir, add_env=add_env_x64)

expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0', exclude_27=False)
if 'cp27-cp27m-win' in w
or 'pp27-pypy_73-win32' in w]
if 'cp27-cp27m-win' in w]

assert set(actual_wheels) == set(expected_wheels)
4 changes: 0 additions & 4 deletions test/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ def test_uname(self):
bits = struct.calcsize("P") * 8
if bits == 32:
self.assertEqual(platform.machine(), "i686")

def test_time_to_remove_the_pypy_venv_patch(self):
if sys.platform == "darwin":
assert not hasattr(sys, "pypy_version_info") or sys.pypy_version_info < (7,3,4)
'''


Expand Down
7 changes: 5 additions & 2 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def expected_wheels(package_name, package_version, manylinux_versions=None,
python_abi_tags = ['cp35-cp35m', 'cp36-cp36m', 'cp37-cp37m', 'cp38-cp38', 'cp39-cp39']

if machine_arch in ['x86_64', 'AMD64', 'x86']:
python_abi_tags += ['cp27-cp27m', 'pp27-pypy_73', 'pp36-pypy36_pp73', 'pp37-pypy37_pp73']
python_abi_tags += ['cp27-cp27m', 'pp37-pypy37_pp73']

if platform != 'windows':
python_abi_tags.append('pp27-pypy_73')

if platform == 'linux':
python_abi_tags.append('cp27-cp27mu') # python 2.7 has 2 different ABI on manylinux
Expand Down Expand Up @@ -149,7 +152,7 @@ def expected_wheels(package_name, package_version, manylinux_versions=None,
if python_abi_tag.startswith('cp'):
platform_tags = ['win32', 'win_amd64']
else:
platform_tags = ['win32']
platform_tags = ['win_amd64']

elif platform == 'macos':
if python_abi_tag == 'cp39-cp39' and machine_arch == 'arm64':
Expand Down
5 changes: 2 additions & 3 deletions unit_test/build_selector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ def test_build_limited_python():
assert not build_selector('cp27-win32')
assert build_selector('cp36-win32')
assert build_selector('cp37-win32')
assert not build_selector('pp27-win32')
assert build_selector('pp36-win32')
assert build_selector('pp37-win32')
assert build_selector('pp36-win_amd64')
assert build_selector('pp37-win_amd64')


def test_build_limited_python_partial():
Expand Down
4 changes: 2 additions & 2 deletions unit_test/main_tests/main_options_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
('i686', 'manylinux2014', 'quay.io/pypa/manylinux2014_i686:*'),
('i686', 'manylinux_2_24', 'quay.io/pypa/manylinux_2_24_i686:*'),
('i686', 'custom_image', 'custom_image'),
('pypy_x86_64', None, 'pypywheels/manylinux2010-pypy_x86_64:*'),
('pypy_x86_64', None, 'yannickjadoul/manylinux2010-pypy_x86_64:*'),
('pypy_x86_64', 'manylinux1', 'manylinux1'), # Does not exist
('pypy_x86_64', 'manylinux2010', 'pypywheels/manylinux2010-pypy_x86_64:*'),
('pypy_x86_64', 'manylinux2010', 'yannickjadoul/manylinux2010-pypy_x86_64:*'),
('pypy_x86_64', 'manylinux2014', 'manylinux2014'), # Does not exist (yet)
('pypy_x86_64', 'custom_image', 'custom_image'),
])
Expand Down