#36 f30: Fix root warning & recommend libcrypt.so.1
Merged 2 months ago by churchyard. Opened 2 months ago by pviktori.
rpms/ pviktori/python-pip f30-libcrypt  into  f30

@@ -11,7 +11,7 @@ 

   from optparse import SUPPRESS_HELP

   

   from pip._vendor import pkg_resources

- @@ -217,6 +219,20 @@ class InstallCommand(RequirementCommand):

+ @@ -217,6 +219,23 @@ class InstallCommand(RequirementCommand):

   

       def run(self, options, args):

           cmdoptions.check_install_build_global(options)

@@ -23,10 +23,13 @@ 

  +

  +        # Check whether we have root privileges and aren't in venv/virtualenv

  +        if os.getuid() == 0 and not is_venv():

+ +            command = path.basename(sys.argv[0])

+ +            if command == "__main__.py":

+ +                command = path.basename(sys.executable) + " -m pip"

  +            logger.warning(

  +                "WARNING: Running pip install with root privileges is "

  +                "generally not a good idea. Try `%s install --user` instead."

- +                % path.basename(sys.argv[0])

+ +                % command

  +            )

  +

           upgrade_strategy = "to-satisfy-only"

file modified
+30 -1

@@ -23,7 +23,7 @@ 

  # When updating, update the bundled libraries versions bellow!

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

  Version:        19.0.3

- Release:        1%{?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.

@@ -155,6 +155,22 @@ 

  Provides: bundled(python%{1}dist(webencodings)) = 0.5.1

  }

  

+ # Some manylinux1 wheels need libcrypt.so.1.

+ # Manylinux1, a common (as of 2019) platform tag for binary wheels, relies

+ # on a glibc version that included ancient crypto functions, which were

+ # moved to libxcrypt and then removed in:

+ #  https://fedoraproject.org/wiki/Changes/FullyRemoveDeprecatedAndUnsafeFunctionsFromLibcrypt

+ # The manylinux1 standard assumed glibc would keep ABI compatibility,

+ # but that's only the case if libcrypt.so.1 (libxcrypt-compat) is around.

+ # This should be solved in the next manylinux standard (but it may be

+ # a long time until manylinux1 is phased out).

+ # See: https://github.com/pypa/manylinux/issues/305

+ # Note that manylinux is only applicable to x86 (both 32 and 64 bits)

+ %global crypt_compat_recommends() %{expand:

+ Recommends: (libcrypt.so.1()(64bit) if python%{1}(x86-64))

+ Recommends: (libcrypt.so.1 if python%{1}(x86-32))

+ }

+ 

  

  %if %{with python2}

  %package -n python2-%{srcname}

@@ -183,6 +199,8 @@ 

  

  %{?python_provide:%python_provide python2-%{srcname}}

  

+ %{crypt_compat_recommends 2}

+ 

  %description -n python2-%{srcname}

  pip is a package management system used to install and manage software packages

  written in Python. Many packages can be found in the Python Package Index

@@ -220,6 +238,8 @@ 

  

  %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

  

+ %{crypt_compat_recommends 3}

+ 

  %description -n python%{python3_pkgversion}-%{srcname}

  pip is a package management system used to install and manage software packages

  written in Python. Many packages can be found in the Python Package Index

@@ -246,6 +266,9 @@ 

  %{bundled 2}

  %{bundled 3}

  

+ %{crypt_compat_recommends 2}

+ %{crypt_compat_recommends 3}

+ 

  %description wheel

  A Python wheel of pip to use with venv.

  %endif

@@ -489,6 +512,12 @@ 

  %endif

  

  %changelog

+ * Mon Jul 15 2019 Petr Viktorin <pviktori@redhat.com> - 19.0.3-3

+ - Recommend libcrypt.so.1 for manylinux1 compatibility

+ 

+ * Mon Jun 10 2019 Miro Hrončok <mhroncok@redhat.com> - 19.0.3-2

+ - Fix root warning when pip is invoked via python -m pip

+ 

  * Wed Mar 06 2019 Miro Hrončok <mhroncok@redhat.com> - 19.0.3-1

  - Update to 19.0.3 (#1679277)