fix: patching pypy venv (#502)

Potentially revert / remove on release of PyPy 7.3.4.

* patching linux and macos

* try test

* add patch files for pypy2.7

* fix installing

* Combine patch files into one

* Simplify further, and add test to remind ourselves to remove the PyPy patch

* ignore fail of patch on linux

make new test failing only on linux

* fix test

* add timeout

* fix patch on linux

* change `-N` to `--force`

Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
This commit is contained in:
Grzegorz Bokota
2020-12-31 11:50:19 -05:00
committed by GitHub
co-authored by Yannick Jadoul
parent 1029a1a123
commit 99203a83f9
8 changed files with 87 additions and 3 deletions
+4
View File
@@ -105,6 +105,10 @@ 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 = Path(__file__).absolute().parent / 'resources' / f'pypy_venv{patch_version}.patch'
call(['patch', '--force', '-d', installation_path, patch_path])
installation_bin_path = installation_path / 'bin'
python_executable = 'pypy3' if version[0] == '3' else 'pypy'