From 32ffa63874f3b1c0b00b7d6b8cf96065afba4df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 27 Jan 2022 00:30:08 +0100 Subject: [PATCH] PyPy 3.9 --- .gitignore | 1 + 189-use-rpm-wheels.patch | 32 ++++++++++++++++++-------------- pypy3.8.spec => pypy3.9.spec | 16 +++++++--------- sources | 2 +- tests/tests.yml | 4 ++-- 5 files changed, 29 insertions(+), 26 deletions(-) rename pypy3.8.spec => pypy3.9.spec (99%) diff --git a/.gitignore b/.gitignore index 9a71710..3f09cde 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /pypy3.7-v7.3.7-src.tar.bz2 /pypy3.8-v7.3.7-src.tar.bz2 /pypy3.8-v7.3.8rc1-src.tar.bz2 +/pypy3.9-v7.3.8rc1-src.tar.bz2 diff --git a/189-use-rpm-wheels.patch b/189-use-rpm-wheels.patch index 5b61035..4ad6f24 100644 --- a/189-use-rpm-wheels.patch +++ b/189-use-rpm-wheels.patch @@ -2,23 +2,26 @@ diff --git a/lib-python/3/ensurepip/__init__.py b/lib-python/3/ensurepip/__init_ index 597a1ef9ee..3bfab52083 100644 --- a/lib-python/3/ensurepip/__init__.py +++ b/lib-python/3/ensurepip/__init__.py -@@ -1,6 +1,7 @@ +@@ -1,3 +1,5 @@ +import distutils.version +import glob import os import os.path --import pkgutil import sys - import runpy - import tempfile -@@ -9,9 +10,24 @@ import subprocess +@@ -6,13 +8,29 @@ import tempfile + import subprocess + from importlib import resources + +-from . import _bundled +- + __all__ = ["version", "bootstrap"] - --_SETUPTOOLS_VERSION = "56.0.0" +-_SETUPTOOLS_VERSION = "58.1.0" +-_PIP_VERSION = "21.2.4" ++ +_WHEEL_DIR = "/usr/share/python-wheels/" - --_PIP_VERSION = "21.1.1" ++ +_wheels = {} + +def _get_most_recent_wheel_version(pkg): @@ -35,17 +38,18 @@ index 597a1ef9ee..3bfab52083 100644 +_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools") + +_PIP_VERSION = _get_most_recent_wheel_version("pip") - ++ _PROJECTS = [ ("setuptools", _SETUPTOOLS_VERSION, "py3"), -@@ -101,13 +117,10 @@ def _bootstrap(*, root=None, upgrade=False, user=False, + ("pip", _PIP_VERSION, "py3"), +@@ -101,13 +119,10 @@ def _bootstrap(*, root=None, upgrade=False, user=False, # additional paths that need added to sys.path additional_paths = [] for project, version, py_tag in _PROJECTS: - wheel_name = "{}-{}-{}-none-any.whl".format(project, version, py_tag) -- whl = pkgutil.get_data( -- "ensurepip", -- "_bundled/{}".format(wheel_name), +- whl = resources.read_binary( +- _bundled, +- wheel_name, - ) - with open(os.path.join(tmpdir, wheel_name), "wb") as fp: - fp.write(whl) diff --git a/pypy3.8.spec b/pypy3.9.spec similarity index 99% rename from pypy3.8.spec rename to pypy3.9.spec index ac339fc..7db20aa 100644 --- a/pypy3.8.spec +++ b/pypy3.9.spec @@ -1,7 +1,7 @@ %global basever 7.3 %global micro 8 %global pre rc1 -%global pyversion 3.8 +%global pyversion 3.9 Name: pypy%{pyversion} Version: %{basever}.%{micro}%{?pre:~%{pre}} %global version_ %{basever}.%{micro}%{?pre} @@ -289,8 +289,8 @@ Obsoletes: pypy3-libs < 7.3.4-4 Requires: python-setuptools-wheel Requires: python-pip-wheel %else -Provides: bundled(python3dist(pip)) = 21.1.1 -Provides: bundled(python3dist(setuptools)) = 56.0.0 +Provides: bundled(python3dist(pip)) = 21.2.4 +Provides: bundled(python3dist(setuptools)) = 58.1.0 %endif # Provides for the bundled libmpdec @@ -340,7 +340,6 @@ Header files for building C extension modules against PyPy%{pyversion}. %if %{with rpmwheels} %apply_patch -m %(basename %{SOURCE189}) %{SOURCE189} rm lib-python/3/ensurepip/_bundled/*.whl -rmdir lib-python/3/ensurepip/_bundled %endif @@ -705,8 +704,8 @@ mv -v lib-python/3/test/regrtest.py-new lib-python/3/test/regrtest.py || : # since 5.10.0, the debug binaries are built and shipped, making the # pypy3 package ~350 MiB. let's remove them here for now and TODO figure out why -rm -f %{buildroot}%{pypyprefix}/bin/pypy3.debug -rm -f %{buildroot}%{pypyprefix}/bin/libpypy3-c.so.debug +rm -f %{buildroot}%{pypyprefix}/bin/pypy%{pyversion}.debug +rm -f %{buildroot}%{pypyprefix}/bin/libpypy%{pyversion}-c.so.debug %check @@ -714,7 +713,7 @@ rm -f %{buildroot}%{pypyprefix}/bin/libpypy3-c.so.debug %{?libmpdec_version: # Verify that the bundled libmpdec version python was compiled with, is the same version we have virtual # provides for in the SPEC. -test "$(%{goal_dir}/pypy3-c -c 'import decimal; print(decimal.__libmpdec_version__.decode("ascii"))')" = \ +test "$(%{goal_dir}/pypy%{pyversion}-c -c 'import decimal; print(decimal.__libmpdec_version__.decode("ascii"))')" = \ "%{libmpdec_version}" } @@ -836,7 +835,7 @@ CheckPyPy() { #pypy/goal/pypy pypy/test_all.py --resultlog=pypyjit_new.log %if %{run_selftests} -CheckPyPy pypy3-c +CheckPyPy pypy%{pyversion}-c %endif # run_selftests # Because there's a bunch of binary subpackages and creating @@ -869,7 +868,6 @@ CheckPyPy pypy3-c %files devel %dir %{pypy_include_dir} -%{pypy_include_dir}/*.h %dir %{pypy_include_dir}/pypy%{pyversion} %{pypy_include_dir}/pypy%{pyversion}/*.h %if %{with main_pypy3} diff --git a/sources b/sources index e9e0e29..2cd33d0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pypy3.8-v7.3.8rc1-src.tar.bz2) = 69eca2ef7c44e15e4b09f36450a985770b3867e41fcd15101881b04fce817f9c8eba3cb783b42fe6509d38e8a4ecfa94573d97cfb902c7c1de9acc2a4d2d760c +SHA512 (pypy3.9-v7.3.8rc1-src.tar.bz2) = d1b1942fbacc7f8d642c85ceb4c4c9796e73bd5836615e2db81f4ddabf9e4f94c230f2d946ea9c49b642d41304aeed3906df1931a52ec40c56d14f1028139978 diff --git a/tests/tests.yml b/tests/tests.yml index a8dc641..6ac1743 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -10,8 +10,8 @@ tests: - smoke: dir: python/smoke - run: PYTHON=pypy3.8 VERSION=3.8 ./venv.sh + run: PYTHON=pypy3.9 VERSION=3.9 ./venv.sh required_packages: - gcc - python3-tox - - pypy3.8-devel + - pypy3.9-devel