#19 F32: Update to 7.3.1
Merged 4 years ago by thrnciar. Opened 4 years ago by churchyard.
rpms/ thrnciar/pypy3 update-7-3-1  into  f32

file modified
+1
@@ -10,3 +10,4 @@ 

  /pypy3.6-v7.1.1-src.tar.bz2

  /pypy3.6-v7.2.0-src.tar.bz2

  /pypy3.6-v7.3.0-src.tar.bz2

+ /pypy3.6-v7.3.1-src.tar.bz2

file modified
+49 -19
@@ -1,51 +1,81 @@ 

  diff --git a/lib-python/3/ensurepip/__init__.py b/lib-python/3/ensurepip/__init__.py

- index 9f5d151..8b81155 100644

+ index 6b35b3d..97fc83b 100644

  --- a/lib-python/3/ensurepip/__init__.py

  +++ b/lib-python/3/ensurepip/__init__.py

- @@ -1,16 +1,27 @@

+ @@ -1,16 +1,34 @@

  +import distutils.version

  +import glob

   import os

   import os.path

- -import pkgutil

+  import pkgutil

   import sys

+ +import runpy

   import tempfile

-  

-  

+ 

+ 

   __all__ = ["version", "bootstrap"]

-  

+ 

+ 

+ -_SETUPTOOLS_VERSION = "44.0.0"

  +_WHEEL_DIR = "/usr/share/python-wheels/"

-  

- -_SETUPTOOLS_VERSION = "41.2.0"

-  

- -_PIP_VERSION = "19.2.3"

+ 

+ -_PIP_VERSION = "20.0.2"

+ +_wheels = {}

+ +

  +def _get_most_recent_wheel_version(pkg):

  +    prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))

- +    suffix = "-py2.py3-none-any.whl"

- +    pattern = "{}*{}".format(prefix, suffix)

- +    versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern))

- +    return str(max(versions, key=distutils.version.LooseVersion))

+ +    _wheels[pkg] = {}

+ +    for suffix in "-py2.py3-none-any.whl", "-py3-none-any.whl":

+ +        pattern = "{}*{}".format(prefix, suffix)

+ +        for path in glob.glob(pattern):

+ +            version_str = path[len(prefix):-len(suffix)]

+ +            _wheels[pkg][version_str] = os.path.basename(path)

+ +    return str(max(_wheels[pkg], key=distutils.version.LooseVersion))

  +

  +

  +_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")

  +

  +_PIP_VERSION = _get_most_recent_wheel_version("pip")

-  

+ 

   _PROJECTS = [

       ("setuptools", _SETUPTOOLS_VERSION),

- @@ -79,12 +95,9 @@ def bootstrap(*, root=None, upgrade=False, user=False,

+ @@ -23,10 +41,18 @@ def _run_pip(args, additional_paths=None):

+      if additional_paths is not None:

+          sys.path = additional_paths + sys.path

+ 

+ -    # Install the bundled software

+ -    import pip._internal.cli.main

+ -    return pip._internal.cli.main.main(args)

+ +    # Invoke pip as if it's the main module, and catch the exit.

+ +    backup_argv = sys.argv[:]

+ +    sys.argv[1:] = args

+ +    try:

+ +        # run_module() alters sys.modules and sys.argv, but restores them at exit

+ +        runpy.run_module("pip", run_name="__main__", alter_sys=True)

+ +    except SystemExit as exc:

+ +        return exc.code

+ +    finally:

+ +        sys.argv[:] = backup_argv

+ 

+ +    raise SystemError("pip did not exit, this should never happen")

+ 

+  def version():

+      """

+ @@ -93,13 +119,10 @@ def _bootstrap(*, root=None, upgrade=False, user=False,

+          # additional paths that need added to sys.path

           additional_paths = []

           for project, version in _PROJECTS:

-              wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)

+ -            wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)

  -            whl = pkgutil.get_data(

  -                "ensurepip",

  -                "_bundled/{}".format(wheel_name),

  -            )

  -            with open(os.path.join(tmpdir, wheel_name), "wb") as fp:

  -                fp.write(whl)

+ +            wheel_name = _wheels[project][version]

  +            with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:

  +                with open(os.path.join(tmpdir, wheel_name), "wb") as fp:

  +                    fp.write(sfp.read())

-  

+ 

               additional_paths.append(os.path.join(tmpdir, wheel_name))

-  

+ 

file modified
+10 -4
@@ -1,8 +1,8 @@ 

  %global basever 7.3

  Name:           pypy3

- Version:        %{basever}.0

+ Version:        %{basever}.1

  %global pyversion 3.6

- Release:        2%{?dist}

+ Release:        1%{?dist}

  Summary:        Python 3 implementation with a Just-In-Time compiler

  

  # LGPL and another free license we'd need to ask spot about are present in some
@@ -272,8 +272,8 @@ 

  Requires: python-setuptools-wheel

  Requires: python-pip-wheel

  %else

- Provides: bundled(python3-pip) = 9.0.1

- Provides: bundled(python3-setuptools) = 28.8.0

+ Provides: bundled(python3-pip) = 20.0.2

+ Provides: bundled(python3-setuptools) = 44.0.0

  %endif

  

  %description libs
@@ -858,6 +858,12 @@ 

  

  

  %changelog

+ * Wed Apr 15 2020 Tomas Hrnciar <thrnciar@redhat.com> - 7.3.1-1

+ - Update to 7.3.1

+ 

+ * Wed Feb 12 2020 Miro Hrončok <mhroncok@redhat.com> - 7.3.0-3

+ - Update the ensurepip module to work with setuptools >= 45

+ 

  * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 7.3.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (pypy3.6-v7.3.0-src.tar.bz2) = 313a4254262dd8d8b995a50bddbc360cfb67add0818e51a3e9ce25bda6a9b639e9fea8efe7da6adda76dff0a86a364544a13faa516e51b9ea6c25ec99223b435

+ SHA512 (pypy3.6-v7.3.1-src.tar.bz2) = f8e32aae7f01225e0e4d6763eaac40fc02dffc3d0b6a30f22d422147f9be4f3290ea78160a912ffae311dea3d503eb31a7a4f3999d3b541fbccd93d1cef4ca56

cc @thrnciar

I've opened this for the CI

Build failed.

+ pypy3 -m venv venv
Error: Command '['/var/str/python/smoke/venv/bin/pypy3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Run test 'smoke': done. Test's exit code: 1

Will investigate.

<mock-chroot> bash-5.0$ pypy3 -Im ensurepip --upgrade --default-pip
Traceback (most recent call last):
  File "/usr/lib64/pypy3-7.3/lib-python/3/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/pypy3-7.3/lib-python/3/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib64/pypy3-7.3/lib-python/3/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/usr/lib64/pypy3-7.3/lib-python/3/ensurepip/__init__.py", line 218, in _main
    default_pip=args.default_pip,
  File "/usr/lib64/pypy3-7.3/lib-python/3/ensurepip/__init__.py", line 131, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/usr/lib64/pypy3-7.3/lib-python/3/ensurepip/__init__.py", line 43, in _run_pip
    import pip._internal.cli.main
ModuleNotFoundError: No module named 'pip._internal.cli.main'

So pypy has upgraded their pip to 20.x, so they expect pip._internal.cli.main, but on Fedora 32, we still have pip 19.3.1 with pip._internal.main.

The patch 189 needs to be enhanced with replacing pip._internal.cli.main with a try-except block similar to https://src.fedoraproject.org/rpms/python-pip/blob/f32/f/pip-allow-different-versions.patch.

Let me know if you want my guidance on that.

Build failed.

3 new commits added

  • Update to 7.3.1
  • Update the ensurepip module to work with setuptools >= 45
  • Build with -fcommon
4 years ago

Build failed.

Build failed.

Build succeeded.

I've reviewed this in the rawhide PR, it is good to ship.

Pull-Request has been merged by thrnciar

4 years ago