unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Update python-pip to 9.0.1
@ 2017-01-06 18:41 Maxim Cournoyer
  2017-01-09 14:52 ` Ludovic Courtès
  2017-01-14 21:02 ` Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1) Hartmut Goebel
  0 siblings, 2 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2017-01-06 18:41 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

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).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-python-pip-Update-to-9.0.1.patch --]
[-- Type: text/x-patch, Size: 1711 bytes --]

From bfd91a59acdf3105505d7dd8483bb9cb97137cbf Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 2189 bytes --]


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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-01-19 11:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 18:41 [PATCH] Update python-pip to 9.0.1 Maxim Cournoyer
2017-01-09 14:52 ` Ludovic Courtès
2017-01-12 16:44   ` Maxim Cournoyer
2017-01-14 17:43     ` Ludovic Courtès
2017-01-15 17:55       ` Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1) Maxim Cournoyer
2017-01-15 22:10         ` Anomalies in Python search-path Ludovic Courtès
2017-01-16  9:30           ` Hartmut Goebel
2017-01-19 11:48             ` Ludovic Courtès
2017-01-14 21:02 ` Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1) Hartmut Goebel
2017-01-15 19:23   ` Anomalies in Python search-path Maxim Cournoyer
2017-01-16  9:23     ` Hartmut Goebel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).