#115 F36: No longer use the rpm_install prefix to determine RPM-installed packages
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/python-pip f36-drop_rpm_prefix  into  f36

file modified
+7 -5
@@ -21,7 +21,7 @@ 

  

  Name:           python-%{srcname}

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

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        A tool for installing and managing Python packages

  

  # We bundle a lot of libraries with pip, which itself is under MIT license.
@@ -203,10 +203,8 @@ 

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

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

  

- # The python3.10 version that added the rpm_prefix sysconfig install scheme

- # This pip can also function with the previous version,

- # but it would remove RPM-installed packages during sudo pip install --upgrade.

- Requires:       python3-libs >= 3.10.0-2

+ # The python3.10 version that stopped using the rpm_prefix scheme

+ Requires:       python3-libs >= 3.10.6-2

  

  

  %{crypt_compat_recommends 3}
@@ -402,6 +400,10 @@ 

  %{python_wheel_dir}/%{python_wheel_name}

  

  %changelog

+ * Tue Sep 06 2022 Miro Hrončok <mhroncok@redhat.com> - 21.3.1-3

+ - No longer use the rpm_install prefix to determine RPM-installed packages

+ - Related: rhbz#2026979

+ 

  * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 21.3.1-2

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

  

@@ -103,8 +103,8 @@ 

  +        # Prevent uninstalling packages from /usr

  +        try:

  +            if dist_location(dist._dist) in (

- +                    sysconfig.get_path('purelib', scheme='rpm_prefix', vars={'base': sys.base_prefix}),

- +                    sysconfig.get_path('platlib', scheme='rpm_prefix', vars={'base': sys.base_prefix}),

+ +                    sysconfig.get_path('purelib', scheme='posix_prefix', vars={'base': sys.base_prefix}),

+ +                    sysconfig.get_path('platlib', scheme='posix_prefix', vars={'platbase': sys.base_prefix}),

  +                ):

  +                return None

  +        except KeyError:  # this Python doesn't have 'rpm_prefix' scheme yet

In https://src.fedoraproject.org/rpms/python3.11/c/d75ca77a64 the rpm_prefix scheme stopped being interesting.
Instead, we make sure to properly set both {base} and {platbase} variables which was subtly wrong before.

Depends-on: https://src.fedoraproject.org/rpms/python3.10/pull-request/125

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Apparently, https://src.fedoraproject.org/rpms/python3.10/pull-request/124 already being merged but not yet delivered confuses Zuul. I'll open another PR this can depend on.

Build succeeded.

rebased onto 9c645a0

2 years ago

Pull-Request has been merged by churchyard

2 years ago

Build succeeded.