#62 Update to 20.1.1
Merged 3 years ago by churchyard. Opened 4 years ago by thrnciar.
rpms/ thrnciar/python-pip update-20-1b1  into  master

file removed
-149
@@ -1,149 +0,0 @@ 

- From 98aa09cf88d8851bb2be6ad39be1cbca7d181916 Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

- Date: Thu, 19 Mar 2020 17:57:53 +0100

- Subject: [PATCH 1/2] Prevent infinite recursion with pip wheel with $TMPDIR in

-  $PWD

- 

- During a build of extension module within `pip wheel` the source directory is

- recursively copied in a temporary directory.

- 

- See https://github.com/pypa/pip/issues/7555

- 

- When the temporary directory is inside the source directory

- (for example by setting `TMPDIR=$PWD/tmp`) this caused an infinite recursion

- that ended in:

- 

-     [Errno 36] File name too long

- 

- We prevent that buy never copying the target to the target in _copy_source_tree.

- 

- Fixes https://github.com/pypa/pip/issues/7872

- ---

-  news/7872.bugfix                        |  1 +

-  src/pip/_internal/operations/prepare.py | 22 +++++++++++++++++-----

-  tests/data/src/extension/extension.c    |  0

-  tests/data/src/extension/setup.py       |  4 ++++

-  tests/functional/test_wheel.py          | 11 +++++++++++

-  5 files changed, 33 insertions(+), 5 deletions(-)

-  create mode 100644 news/7872.bugfix

-  create mode 100644 tests/data/src/extension/extension.c

-  create mode 100644 tests/data/src/extension/setup.py

- 

- diff --git a/news/7872.bugfix b/news/7872.bugfix

- new file mode 100644

- index 0000000000..3550d573b8

- --- /dev/null

- +++ b/news/7872.bugfix

- @@ -0,0 +1 @@

- +Prevent an infinite recursion with ``pip wheel`` when ``$TMPDIR`` is within the source directory.

- diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py

- index 9f87148c03..1fcbb775ec 100644

- --- a/src/pip/_internal/operations/prepare.py

- +++ b/src/pip/_internal/operations/prepare.py

- @@ -156,13 +156,25 @@ def _copy2_ignoring_special_files(src, dest):

-  

-  def _copy_source_tree(source, target):

-      # type: (str, str) -> None

- +    target_abspath = os.path.abspath(target)

- +    target_basename = os.path.basename(target_abspath)

- +    target_dirname = os.path.dirname(target_abspath)

- +

-      def ignore(d, names):

-          # type: (str, List[str]) -> List[str]

- -        # Pulling in those directories can potentially be very slow,

- -        # exclude the following directories if they appear in the top

- -        # level dir (and only it).

- -        # See discussion at https://github.com/pypa/pip/pull/6770

- -        return ['.tox', '.nox'] if d == source else []

- +        skipped = []  # type: List[str]

- +        if d == source:

- +            # Pulling in those directories can potentially be very slow,

- +            # exclude the following directories if they appear in the top

- +            # level dir (and only it).

- +            # See discussion at https://github.com/pypa/pip/pull/6770

- +            skipped += ['.tox', '.nox']

- +        if os.path.abspath(d) == target_dirname:

- +            # Prevent an infinite recursion if the target is in source.

- +            # This can happen when TMPDIR is set to ${PWD}/...

- +            # and we copy PWD to TMPDIR.

- +            skipped += [target_basename]

- +        return skipped

-  

-      kwargs = dict(ignore=ignore, symlinks=True)  # type: CopytreeKwargs

-  

- diff --git a/tests/data/src/extension/extension.c b/tests/data/src/extension/extension.c

- new file mode 100644

- index 0000000000..e69de29bb2

- diff --git a/tests/data/src/extension/setup.py b/tests/data/src/extension/setup.py

- new file mode 100644

- index 0000000000..b26302b053

- --- /dev/null

- +++ b/tests/data/src/extension/setup.py

- @@ -0,0 +1,4 @@

- +from setuptools import Extension, setup

- +

- +module = Extension('extension', sources=['extension.c'])

- +setup(name='extension', version='0.0.1', ext_modules = [module])

- diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py

- index ce79dbee5e..f293233b9d 100644

- --- a/tests/functional/test_wheel.py

- +++ b/tests/functional/test_wheel.py

- @@ -289,6 +289,17 @@ def test_pip_wheel_with_user_set_in_config(script, data, common_wheels):

-      assert "Successfully built withpyproject" in result.stdout, result.stdout

-  

-  

- +def test_pip_wheel_ext_module_with_tmpdir_inside(script, data, common_wheels):

- +    tmpdir = data.src / 'extension/tmp'

- +    tmpdir.mkdir()

- +    script.environ['TMPDIR'] = str(tmpdir)

- +    result = script.pip(

- +        'wheel', data.src / 'extension',

- +        '--no-index', '-f', common_wheels

- +    )

- +    assert "Successfully built extension" in result.stdout, result.stdout

- +

- +

-  @pytest.mark.network

-  def test_pep517_wheels_are_not_confused_with_other_files(script, tmpdir, data):

-      """Check correct wheels are copied. (#6196)

- 

- From eb070d23721c5a0bff59ed5a252291efd3f5a7c6 Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

- Date: Thu, 19 Mar 2020 23:21:56 +0100

- Subject: [PATCH 2/2] Avoid a test dependency on a C compiler, skip the test on

-  Windows

- 

- ---

-  tests/functional/test_wheel.py | 8 ++++++++

-  1 file changed, 8 insertions(+)

- 

- diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py

- index f293233b9d..545c50ac9a 100644

- --- a/tests/functional/test_wheel.py

- +++ b/tests/functional/test_wheel.py

- @@ -1,6 +1,7 @@

-  """'pip wheel' tests"""

-  import os

-  import re

- +import sys

-  from os.path import exists

-  

-  import pytest

- @@ -289,10 +290,17 @@ def test_pip_wheel_with_user_set_in_config(script, data, common_wheels):

-      assert "Successfully built withpyproject" in result.stdout, result.stdout

-  

-  

- +@pytest.mark.skipif(sys.platform.startswith('win'),

- +                    reason='The empty extension module does not work on Win')

-  def test_pip_wheel_ext_module_with_tmpdir_inside(script, data, common_wheels):

-      tmpdir = data.src / 'extension/tmp'

-      tmpdir.mkdir()

-      script.environ['TMPDIR'] = str(tmpdir)

- +

- +    # To avoid a test dependency on a C compiler, we set the env vars to "noop"

- +    # The .c source is empty anyway

- +    script.environ['CC'] = script.environ['LDSHARED'] = str('true')

- +

-      result = script.pip(

-          'wheel', data.src / 'extension',

-          '--no-index', '-f', common_wheels

file modified
+18 -3
@@ -1,12 +1,27 @@ 

+ From 09bf87d33141a5c06a1d410839d162262baa16c4 Mon Sep 17 00:00:00 2001

+ From: Tomas Hrnciar <thrnciar@redhat.com>

+ Date: Sun, 26 Apr 2020 21:38:44 +0200

+ Subject: [PATCH] Dummy certifi patch

+ 

+ ---

+  src/pip/_vendor/certifi/core.py | 4 +---

+  1 file changed, 1 insertion(+), 3 deletions(-)

+ 

  diff --git a/src/pip/_vendor/certifi/core.py b/src/pip/_vendor/certifi/core.py

- index 7271acf..9f0dc20 100644

+ index 56b52a3c..e99043f0 100644

  --- a/src/pip/_vendor/certifi/core.py

  +++ b/src/pip/_vendor/certifi/core.py

- @@ -10,6 +10,4 @@ import os

+ @@ -21,9 +21,7 @@ except ImportError:

   

   

   def where():

  -    f = os.path.dirname(__file__)

  -

- -    return os.path.join(f, 'cacert.pem')

+ -    return os.path.join(f, "cacert.pem")

  +    return '/etc/pki/tls/certs/ca-bundle.crt'

+ 

+ 

+  def contents():

+ --

+ 2.23.0

+ 

@@ -1,6 +1,6 @@ 

- From aab24967a03bda3b0999d80562a6064c27d1e0e0 Mon Sep 17 00:00:00 2001

- From: Tomas Orsava <torsava@redhat.com>

- Date: Tue, 12 Nov 2019 17:15:08 +0100

+ From 74bb5d26e232493de43adfa1f4b42b66fd701294 Mon Sep 17 00:00:00 2001

+ From: Tomas Hrnciar <thrnciar@redhat.com>

+ Date: Sun, 26 Apr 2020 13:52:24 +0200

  Subject: [PATCH] Downstream only patch

  

  Emit a warning to the user if pip install is run with root privileges
@@ -10,7 +10,7 @@ 

   1 file changed, 19 insertions(+)

  

  diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py

- index 02a187c..8037ffb 100644

+ index 70bda2e2..1e750ae1 100644

  --- a/src/pip/_internal/commands/install.py

  +++ b/src/pip/_internal/commands/install.py

  @@ -13,6 +13,8 @@ import operator
@@ -22,9 +22,9 @@ 

   from optparse import SUPPRESS_HELP

   

   from pip._vendor import pkg_resources

- @@ -242,6 +244,23 @@ class InstallCommand(RequirementCommand):

-      def run(self, options, args):

-          # type: (Values, List[Any]) -> int

+ @@ -241,6 +243,23 @@ class InstallCommand(RequirementCommand):

+              raise CommandError("Can not combine '--user' and '--target'")

+  

           cmdoptions.check_install_build_global(options)

  +

  +        def is_venv():
@@ -47,5 +47,5 @@ 

           if options.upgrade:

               upgrade_strategy = options.upgrade_strategy

  -- 

- 2.20.1

+ 2.23.0

  

file modified
+34 -16
@@ -3,7 +3,9 @@ 

  %bcond_without doc

  

  %global srcname pip

- %global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl

+ %global base_version 20.1.1

+ %global upstream_version %{base_version}%{?prerel}

+ %global python_wheelname %{srcname}-%{upstream_version}-py2.py3-none-any.whl

  %global python_wheeldir %{_datadir}/python-wheels

  

  %if %{with doc}
@@ -15,8 +17,8 @@ 

  Name:           python-%{srcname}

  # When updating, update the bundled libraries versions bellow!

  # You can use vendor_meta.sh in the dist git repo

- Version:        20.0.2

- Release:        4%{?dist}

+ Version:        %{base_version}%{?prerel:~%{prerel}}

+ Release:        1%{?dist}

  Summary:        A tool for installing and managing Python packages

  

  # We bundle a lot of libraries with pip, which itself is under MIT license.
@@ -48,7 +50,7 @@ 

  

  License:        MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD)

  URL:            https://pip.pypa.io/

- Source0:        https://github.com/pypa/pip/archive/%{version}/%{srcname}-%{version}.tar.gz

+ Source0:        https://github.com/pypa/pip/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz

  

  BuildArch:      noarch

  
@@ -88,11 +90,6 @@ 

  # this warning is juts moot. Also, the warning breaks CPython test suite.

  Patch5:         nowarn-pip._internal.main.patch

  

- # Allow setting $TMPDIR to $PWD/... during pip wheel

- # This is needed to have proper debugsource packages with pyproject-rpm-macros

- # https://bugzilla.redhat.com/show_bug.cgi?id=1806625

- Patch6:         https://github.com/pypa/pip/pull/7873.patch

- 

  # Downstream only patch

  # Users might have local installations of pip from using

  # `pip install --user --upgrade pip` on older/newer versions.
@@ -207,6 +204,12 @@ 

  Provides:       pip = %{version}-%{release}

  Conflicts:      python-pip < %{version}-%{release}

  

+ # %%pyX_install_wheel and %%pyproject_install was adapted to workaround PEP 610 handling in pip 20.1+

+ # (This explicit conflict can be removed after we update to Python 3.9)

+ Conflicts: python-rpm-macros < 3.8-4

+ Conflicts: python3-rpm-macros < 3.8-4

+ Conflicts: pyproject-rpm-macros < 0-15

+ 

  %{crypt_compat_recommends 3}

  

  %description -n python%{python3_pkgversion}-%{srcname}
@@ -241,7 +244,7 @@ 

  A Python wheel of pip to use with venv.

  

  %prep

- %setup -q -n %{srcname}-%{version}

+ %setup -q -n %{srcname}-%{upstream_version}

  

  %if %{with doc}

  pushd docs/html
@@ -257,7 +260,6 @@ 

  %patch3 -p1

  %patch4 -p1

  %patch5 -p1

- %patch6 -p1

  

  # this goes together with patch4

  rm src/pip/_vendor/certifi/*.pem
@@ -265,6 +267,11 @@ 

  # tests expect wheels in here

  ln -s %{python_wheeldir} tests/data/common_wheels

  

+ # Upstream uses a Python 2/3 compatibility library for csv with Python 3 semantics in tests

+ # We only target Python 3 and csv23 is not (yet) packaged

+ # As of 20.1b1, this workaround was sufficient to get around the missing dependency

+ sed -i -e 's/csv23/csv/g' tests/lib/wheel.py

+ 

  

  %build

  %py3_build_wheel
@@ -279,15 +286,18 @@ 

  

  

  %install

- 

  # The following is similar to %%py3_install_wheel, but we don't have

  # /usr/bin/pip yet, so we install using the wheel directly.

  # (This is not standard wheel usage, but the pip wheel supports it -- see

  #  pip/__main__.py)

  %{__python3} dist/%{python_wheelname}/pip install \

-     -I 'dist/%{python_wheelname}' \

      --root %{buildroot} \

-     --no-deps

+     --no-deps \

+     --no-cache-dir \

+     --no-index \

+     --ignore-installed \

+     --find-links dist \

+     'pip==%{upstream_version}'

  

  %if %{with doc}

  pushd docs/build/man
@@ -306,7 +316,6 @@ 

    patch -p1 --no-backup-if-mismatch $PIP < %{SOURCE10}

  done

  

- 

  mkdir -p %{buildroot}%{bashcompdir}

  PYTHONPATH=%{buildroot}%{python3_sitelib} \

      %{buildroot}%{_bindir}/pip completion --bash \
@@ -325,7 +334,7 @@ 

  

  # Make sure the INSTALLER is not pip, otherwise Patch2 won't work

  # %%pyproject macros do this for all packages

- echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER

+ echo rpm > %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/INSTALLER

  

  mkdir -p %{buildroot}%{python_wheeldir}

  install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
@@ -385,6 +394,15 @@ 

  %{python_wheeldir}/%{python_wheelname}

  

  %changelog

+ * Wed May 20 2020 Tomas Hrnciar <thrnciar@redhat.com> - 20.1.1-1

+ - Update to 20.1.1

+ 

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

+ - Update to 20.1

+ 

+ * Mon Apr 27 2020 Tomas Hrnciar <thrnciar@redhat.com> - 20.1~b1-1

+ - Update to 20.1~b1

+ 

  * Wed Apr 15 2020 Miro Hrončok <mhroncok@redhat.com> - 20.0.2-4

  - Only recommend setuptools, don't require them

  

@@ -1,8 +1,8 @@ 

- From b46ec3663c0535fc40503fe9a78b1b7733281bdf Mon Sep 17 00:00:00 2001

- From: Tomas Orsava <torsava@redhat.com>

- Date: Tue, 12 Nov 2019 17:24:20 +0100

- Subject: [PATCH] Subject: Prevent removing of the system packages installed

-  under /usr/lib

+ From d381c59fdc15949c4dc293bd92bbccb60289a703 Mon Sep 17 00:00:00 2001

+ From: Tomas Hrnciar <thrnciar@redhat.com>

+ Date: Sun, 26 Apr 2020 21:19:03 +0200

+ Subject: [PATCH] Prevent removing of the system packages installed under

+  /usr/lib

  

  when pip install -U is executed.

  
@@ -11,39 +11,16 @@ 

  Co-Authored-By: Michal Cyprian <m.cyprian@gmail.com>

  Co-Authored-By: Victor Stinner <vstinner@redhat.com>

  ---

-  src/pip/_internal/legacy_resolve.py  |  5 ++++-

-  src/pip/_internal/req/req_install.py |  3 ++-

-  src/pip/_internal/utils/misc.py      | 11 +++++++++++

+  src/pip/_internal/req/req_install.py            |  3 ++-

+  src/pip/_internal/resolution/legacy/resolver.py |  5 ++++-

+  src/pip/_internal/utils/misc.py                 | 11 +++++++++++

   3 files changed, 17 insertions(+), 2 deletions(-)

  

- diff --git a/src/pip/_internal/legacy_resolve.py b/src/pip/_internal/legacy_resolve.py

- index ca269121..e8d939bf 100644

- --- a/src/pip/_internal/legacy_resolve.py

- +++ b/src/pip/_internal/legacy_resolve.py

- @@ -30,6 +30,7 @@ from pip._internal.exceptions import (

-  )

-  from pip._internal.utils.logging import indent_log

-  from pip._internal.utils.misc import dist_in_usersite, normalize_version_info

- +from pip._internal.utils.misc import dist_in_install_path

-  from pip._internal.utils.packaging import (

-      check_requires_python,

-      get_requires_python,

- @@ -199,7 +200,9 @@ class Resolver(object):

-          """

-          # Don't uninstall the conflict if doing a user install and the

-          # conflict is not a user install.

- -        if not self.use_user_site or dist_in_usersite(req.satisfied_by):

- +        if ((not self.use_user_site

- +                or dist_in_usersite(req.satisfied_by))

- +                and dist_in_install_path(req.satisfied_by)):

-              req.should_reinstall = True

-          req.satisfied_by = None

-  

  diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py

- index 22ac24b9..8a461b95 100644

+ index 3b28209b..d14217e9 100644

  --- a/src/pip/_internal/req/req_install.py

  +++ b/src/pip/_internal/req/req_install.py

- @@ -42,6 +42,7 @@ from pip._internal.utils.misc import (

+ @@ -38,6 +38,7 @@ from pip._internal.utils.misc import (

       ask_path_exists,

       backup_dir,

       display_path,
@@ -51,17 +28,40 @@ 

       dist_in_site_packages,

       dist_in_usersite,

       get_installed_version,

- @@ -457,7 +458,7 @@ class InstallRequirement(object):

-                          "lack sys.path precedence to %s in %s" %

-                          (existing_dist.project_name, existing_dist.location)

+ @@ -444,7 +445,7 @@ class InstallRequirement(object):

+                          "lack sys.path precedence to {} in {}".format(

+                              existing_dist.project_name, existing_dist.location)

                       )

  -            else:

  +            elif dist_in_install_path(existing_dist):

                   self.should_reinstall = True

           else:

               if self.editable and self.satisfied_by:

+ diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py

+ index cdb44d19..52e122c6 100644

+ --- a/src/pip/_internal/resolution/legacy/resolver.py

+ +++ b/src/pip/_internal/resolution/legacy/resolver.py

+ @@ -33,6 +33,7 @@ from pip._internal.resolution.base import BaseResolver

+  from pip._internal.utils.compatibility_tags import get_supported

+  from pip._internal.utils.logging import indent_log

+  from pip._internal.utils.misc import dist_in_usersite, normalize_version_info

+ +from pip._internal.utils.misc import dist_in_install_path

+  from pip._internal.utils.packaging import (

+      check_requires_python,

+      get_requires_python,

+ @@ -203,7 +204,9 @@ class Resolver(BaseResolver):

+          """

+          # Don't uninstall the conflict if doing a user install and the

+          # conflict is not a user install.

+ -        if not self.use_user_site or dist_in_usersite(req.satisfied_by):

+ +        if ((not self.use_user_site

+ +                or dist_in_usersite(req.satisfied_by))

+ +                and dist_in_install_path(req.satisfied_by)):

+              req.should_reinstall = True

+          req.satisfied_by = None

+  

  diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py

- index 4a581601..2617ad33 100644

+ index 09031825..3c064f8f 100644

  --- a/src/pip/_internal/utils/misc.py

  +++ b/src/pip/_internal/utils/misc.py

  @@ -29,6 +29,7 @@ from pip._vendor.six.moves.urllib.parse import unquote as urllib_unquote
@@ -72,7 +72,7 @@ 

       get_major_minor_version,

       site_packages,

       user_site,

- @@ -385,6 +386,16 @@ def dist_in_site_packages(dist):

+ @@ -400,6 +401,16 @@ def dist_in_site_packages(dist):

       return dist_location(dist).startswith(normalize_path(site_packages))

   

   
@@ -90,5 +90,6 @@ 

       # type: (Distribution) -> bool

       """

  -- 

- 2.24.1

+ 2.23.0

+ 

  

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

- SHA512 (pip-20.0.2.tar.gz) = f9965944ca0f319d01db1638ce97cf64772afff1778b3b1271155de73208cfcb3954d89a469c1143c0bf3288a53d4446165a49df994374b16ac6f7ffdae85857

+ SHA512 (pip-20.1.1.tar.gz) = ee7b0345c08fbe0215811d07b4c57c1ceece826871842f6d1c174d82e8eee0ad810aa5413d6763ecd5a513e151792a53c36623ab99d2049555ef2542d32d1658

  SHA512 (d2e63fbfc62af3b7050f619b2f5bb8658985b931.tar.gz) = fc7b11c5cbf6322469ce2eaca2a8d7eb60b17398d316f7465ab5d3d38dabd00ee22a3da7437a28f6312f0115f77f2df0d8bf0abc671e055eef06356c94283409

  SHA512 (2018.2.tar.gz) = 4c09c43a70ecb3ca3bc9445b01bf209eb382e41d9c969145696dea38551992ed88fd9b725a1264380f3dbdf8acdaf5ada3ef86b44255cdfbdbe4a01a1630912d

no initial comment
-  news/7872.bugfix                        |  1 +
-  src/pip/_internal/operations/prepare.py | 22 +++++++++++++++++-----
-  tests/data/src/extension/extension.c    |  0
-  tests/data/src/extension/setup.py       |  4 ++++
-  tests/functional/test_wheel.py          | 11 +++++++++++
-  5 files changed, 33 insertions(+), 5 deletions(-)
+  news/7872.bugfix               |  1 +
+  tests/functional/test_wheel.py | 18 ++++++++++++++++++

@churchyard, seems like many of patched files are not present in 20.1~b1. Could you please take a look whether they are really removed and if so what does it mean according to 7873.patch? Is it still relevant to have that patch?

+ /usr/bin/python3 -m pytest -m 'not network' -k 'not completion and not test_pep517_and_build_options and not test_config_file_venv_option and not test_uninstall_non_local_distutils'
ImportError while loading conftest '/builddir/build/BUILD/pip-20.1b1/tests/conftest.py'.
tests/conftest.py:19: in <module>
    from tests.lib import DATA_DIR, SRC_DIR, PipTestEnvironment, TestData
tests/lib/__init__.py:30: in <module>
    from tests.lib.wheel import make_wheel
tests/lib/wheel.py:14: in <module>
    import csv23
E   ModuleNotFoundError: No module named 'csv23'

I am getting the error with pytest. Seems like we should add csv23 as a requirement but I couldn't find it in Fedora packages.

rebased onto 97bfb68ed3bfca3ba2e0bbd60dd4c42f8fd484c0

4 years ago

7873.patch has been merged upstream.

You can see here: https://github.com/pypa/pip/pull/7873 -> follow the pradyunsg merged commit 81f1054 into pypa:master 16 days ago link to https://github.com/pypa/pip/commit/81f1054865e02e360cad9a2855151a63547a60e0 and at the header, see the branches and tags this is included in (below the commit message): 20.1b1

Try sedding csv23 with csv in %prep as a workaround and see if it is enough.

csv23 provides the unicode-based API of the Python 3 csv module for Python 2 and 3. Code that should run under both versions of Python can use it to hide the bytes vs. text difference between 2 and 3 and stick to the newer unicode-based interface.

use %upstream_version in here and elsewhere in the spec

you can keep using srcname instead pypi_name to minimize the diff (minimal diff makes it easier with future backports)

note the ?: it means that later when the final version is out, we can just undefine prerel and we can keep this macro defined as is

rebased onto 662dea22d164d40d695546da25440fb91daa7c23

4 years ago

Such hacks or workarounds must always be accompanied with a comment. What about:

# Upstream uses a Python 2/3 compatibility library for csv with Python 3 semantics in tests
# We only target Python 3 and csv23 is not (yet) packaged
# As of 20.1b1, this workaround was sufficient to get around the missing dependency

rebased onto 6700edb70151080f996bd5b13fa80ec9637ecc0a

4 years ago

rebased onto f4adb462cabedf215053032ddd39318ea51bbf5c

4 years ago

rebased onto 559bcc4b90727792ef816567804c84efdb5ee2f6

4 years ago

rebased onto 73c86449495c248da05aeade9bf7c9c2bb399d2a

4 years ago

Build failed.

The CI fails because our virtualenv cannot handle beta releases of pip.

Build failed.

python3-pip.noarch: E: non-readable /usr/lib/python3.8/site-packages/pip-20.1b1.dist-info/INSTALLER 600
python3-pip.noarch: E: non-readable /usr/lib/python3.8/site-packages/pip-20.1b1.dist-info/RECORD 600
python3-pip.noarch: E: non-readable /usr/lib/python3.8/site-packages/pip-20.1b1.dist-info/direct_url.json 600

This is weird.

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/freeze.py", line 98, in run
    for line in freeze(**freeze_kwargs):
  File "/usr/lib/python3.8/site-packages/pip/_internal/operations/freeze.py", line 68, in freeze
    req = FrozenRequirement.from_dist(dist)
  File "/usr/lib/python3.8/site-packages/pip/_internal/operations/freeze.py", line 256, in from_dist
    direct_url = dist_get_direct_url(dist)
  File "/usr/lib/python3.8/site-packages/pip/_internal/utils/direct_url_helpers.py", line 118, in dist_get_direct_url
    return DirectUrl.from_json(dist.get_metadata(DIRECT_URL_METADATA_NAME))
  File "/usr/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "/usr/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/pip-20.1b1.dist-info/direct_url.json'

I also don't understand why this does not happen on the CI.

rebased onto 1f8db695e07065b495c99f5f81f8a1f9e1775ffe

4 years ago

please keep the double newline here. it's to separate %prep from %build

Build failed.

with PEP 610, there is direct_url.json:

{"archive_info": {}, "url": "file:///builddir/build/BUILD/pip-20.1b1/dist/pip-20.1b1-py2.py3-none-any.whl"}

We need to figure out if we should just rm it, or disable it somehow. It leaks the builddir path.

Upstream discussion: https://discuss.python.org/t/4012

rebased onto af7e0cd5d1843a7e4cf48c7e957601f20c698a3c

3 years ago

rebased onto a6f6586c13bf13747fe66b9f77b2ece0f1e2c0b1

3 years ago

rebased onto 075bad05545d70ffc6ed4b8d61be4ccb42b4f0e6

3 years ago

Build failed.

To prevent direct_url.json creation here, we can do:

@@ -286,9 +289,12 @@ rm -rf docs/build/html/{.doctrees,.buildinfo}
 # (This is not standard wheel usage, but the pip wheel supports it -- see
 #  pip/__main__.py)
 %{__python3} dist/%{python_wheelname}/pip install \
-    -I 'dist/%{python_wheelname}' \
     --root %{buildroot} \
-    --no-deps
+    --no-deps \
+    --no-cache-dir \
+    --no-index \
+    --ignore-installed \
+    --find-links dist \
+    'pip==%{upstream_version}'

@pviktori Do you see any problem with that approach?

I don't, but I haven't tested it.

I have tested that it installs successfully and does not generate direct_url.json.

@thrnciar Could you please add the change from my pre-previous comment into this commit and update to 20.1 final in a separate one? Thanks.

rebased onto 8d81d1bc3778dec98956f7a14d6dc010c9337fa7

3 years ago

rebased onto 90783a544d1819730e246416c2f05d0897c328a1

3 years ago

Build succeeded.

rebased onto 8520b85f8c3c91f99191d335f86f4ae9de264fc3

3 years ago

Build succeeded.

I've removed the depends-on: https://src.fedoraproject.org/rpms/python-virtualenv/pull-request/19

Since this is no longer a beta version. I will also describe there what I think we should do about virtualenv.

Before we ship this update, we need to:

  • adapt %pyX_install_wheel to rm the direct_url.json file and sed it out from RECORD
  • adapt %pyproject_install to install via the same option as we do here

Build succeeded.

Build failed.

Build succeeded.

https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/53 was merged and built.

Could you please add to the python3-pip package:

# %%pyX_install_wheel and %%pyproject_install was adapted to workaround PEP 610 handling in pip 20.1+
# (This explicit conflict can be removed after we update to Python 3.9)
Conflicts: python-rpm-macros < 3.8-4
Conflicts: python3-rpm-macros < 3.8-4
Conflicts: pyproject-rpm-macros < 0-15

Build succeeded.

rebased onto 90783a544d1819730e246416c2f05d0897c328a1

3 years ago

rebased onto c779911574fe366825bae22b2555bc6730e0ba64

3 years ago

Serious problems have been discovered upstream in 20.1. Hence, I don't want to ship this version to users just yet. Let's keep this open and update it to 20.1.x once released.

The code change looks good @thrnciar , thank you.

Build succeeded.

rebased onto 90783a544d1819730e246416c2f05d0897c328a1

3 years ago

Build succeeded.

rebased onto 5540653

3 years ago

Thanks. I've rebased this PR via the magical Pagure button. Let's wait for the CI now and I'll merge it if t works fine.

Build succeeded.

Pull-Request has been merged by churchyard

3 years ago
Metadata
Flags
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for 5ef43e57
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for 40c9d5a2
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for bd4994e1
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for 0c2bfaeb
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
failure
Jobs result is failure
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for 2d2297eb
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
success
Jobs result is success
3 years ago
simple-koji-ci
success
Build completed for 6e5be8fe
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
simple-koji-ci
success
Build completed for 8e9830dd
3 years ago
Zuul
failure
Jobs result is failure
3 years ago
simple-koji-ci
success
Build completed for ac2eaaf4
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
simple-koji-ci
success
Build completed for 27373558
3 years ago
simple-koji-ci
success
Build completed for af7e0cd5
3 years ago
Zuul
pending
Jobs result is pending
3 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
success
Build completed for 1f8db695
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
success
Build completed for 73c86449
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
simple-koji-ci
success
Build completed for 559bcc4b
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
success
Build completed for f4adb462
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
success
Build completed for 6700edb7
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
failure
Build failed for 662dea22
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
simple-koji-ci
failure
Build failed for 97bfb68e
4 years ago
Zuul
pending
Jobs result is pending
4 years ago
Zuul
failure
Jobs result is failure
4 years ago
Fedora CI
success
Package tests for 5ef43e57: passed
3 years ago
simple-koji-ci
failure
Build failed for a6f6586c
4 years ago
Zuul
pending
Jobs result is pending
4 years ago