guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Update python-pip to 9.0.1


From: Maxim Cournoyer
Subject: [PATCH] Update python-pip to 9.0.1
Date: Fri, 06 Jan 2017 10:41:11 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello Guix!

This is my 2nd and hopefully correct attempt at updating python-pip to
9.0.1. Test inputs were removed as the tarball available from pypi is
stripped from any test.

It also incorporates suggestions that were previously made [1]; for
example we no longer need to use setuptools as an input since our Python
package definitions were recently updated to always be built with
pip/setuptools (the ensurepip flag).

>From bfd91a59acdf3105505d7dd8483bb9cb97137cbf Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <address@hidden>
Date: Mon, 28 Nov 2016 16:30:07 -0800
Subject: [PATCH] gnu: python-pip: Update to 9.0.1

* gnu/packages/python.scm (python-pip, python2-pip): Update to 9.0.1.
---
 gnu/packages/python.scm | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 5faebae3d9..028cda6292 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -6773,26 +6773,21 @@ library.")
 (define-public python-pip
   (package
     (name "python-pip")
-    (version "8.0.2")
+    (version "9.0.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pip" version))
        (sha256
         (base32
-         "08cm8d4228fj0qnrysy3qv1a6022zr3dcs25amd14lgxil6vvx26"))))
+         "03clr9c1dih5n9c00c592zzvf6r1ffimywkaq9agcqdllzhl7wh9"))))
     (build-system python-build-system)
-    (native-inputs
-      `(;; Tests
-        ("python-virtualenv" ,python-virtualenv)
-        ("python-mock" ,python-mock)
-        ("python-pytest" ,python-pytest)
-        ("python-scripttest" ,python-scripttest)))
+    (arguments
+     '(#:tests? #f))          ; there are no tests in the pypi archive.
     (home-page "https://pip.pypa.io/";)
-    (synopsis
-      "Package manager for Python software")
+    (synopsis "Package manager for Python software")
     (description
-      "Pip is a package manager for Python software, that finds packages on the
+     "Pip is a package manager for Python software, that finds packages on the
 Python Package Index (PyPI).")
     (license license:expat)))
 
-- 
2.11.0

One thing which I discovered while testing pip on Guix was that
depending on how you use Python on Guix the PYTHONPATH differs:

# PYTHONPATH in an environment
$ guix environment python-wrapper
[env]$ python3 -c 'import sys; print(sys.path)'
['',
'/gnu/store/ar7k7ds90ikxv40a6lif6jv2g39l7mls-profile/lib/python3.5/site-packages',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python35.zip',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/plat-linux',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/lib-dynload',
'/home/maxim/.local/lib/python3.5/site-packages',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/site-packages']
[env]$ pip install --user --upgrade setuptools
Collecting setuptools
  Using cached setuptools-32.3.1-py2.py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-20.10.1


# PYTHONPATH when installed in your user profile
$ guix package -i python-wrapper
$ python3 -c 'import sys; print(sys.path)'
['',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python35.zip',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/plat-linux',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/lib-dynload',
'/home/maxim/.local/lib/python3.5/site-packages',
'/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/site-packages']
$ pip3 uninstall setuptools
...
$ pip3 --user --upgrade setuptools
Collecting setuptools
  Using cached setuptools-32.3.1-py2.py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-32.3.1


Conclusion: When using python in a "guix environment", the *system*
site-packages directory appears _before_ the *user* site-packages
directory in the PYTHONPATH, which is wrong and causes pip to not work
as intended. [2]

[1] https://lists.gnu.org/archive/html/guix-devel/2016-11/msg01242.html
[2] https://pip.pypa.io/en/stable/user_guide/#user-installs

Thanks,

Maxim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]