bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-06-25 Thread Maxim Cournoyer
Hey ng0!

ng0  writes:

> Hi Maxim,
>
> great to see this fixed. Weird it bumped into my view after
> almost 3 years.

Yes! Bugs don't really expire, do they? :-)

> I trust that other people will have tested
> it, I'm all over the place and mostly doing NetBSD and GNUnet
> now.

I'm glad to know you're still involved with GNUnet :-)

> Sorry if I have written a reply before, the thread was
> marked as unread here.

No problem! I'll wait a few more days to allow for commenting some more,
then push.

Cheers!

Maxim





bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-06-16 Thread ng0
Hi Maxim,

great to see this fixed. Weird it bumped into my view after
almost 3 years. I trust that other people will have tested
it, I'm all over the place and mostly doing NetBSD and GNUnet
now.
Sorry if I have written a reply before, the thread was
marked as unread here.
Maxim Cournoyer transcribed 3.5K bytes:
> ng0  writes:
> 
> > I think this should not happen with pypi import:
> >
> >   (inputs
> > `(("python-certifi==2016.2.28"
> >,python-certifi==2016.2.28)
> >   ("python-dateutil==2.5.3"
> >,python-dateutil==2.5.3)
> >   ("python-flask-babel==0.11.1"
> >,python-flask-babel==0.11.1)
> >   ("python-flask==0.11.1" ,python-flask==0.11.1)
> >   ("python-lxml==3.6.0" ,python-lxml==3.6.0)
> >   ("python-ndg-httpsclient==0.4.1"
> >,python-ndg-httpsclient==0.4.1)
> >   ("python-pyasn1-modules==0.0.8"
> >,python-pyasn1-modules==0.0.8)
> >   ("python-pyasn1==0.1.9" ,python-pyasn1==0.1.9)
> >   ("python-pygments==2.1.3"
> >,python-pygments==2.1.3)
> >   ("python-pyopenssl==0.15.1"
> >,python-pyopenssl==0.15.1)
> >   ("python-pyyaml==3.11" ,python-pyyaml==3.11)
> >   ("python-requests[socks]==2.10.0"
> >,#{python-requests\x5b;socks\x5d;==2.10.0}#)
> >   ("python-setuptools" ,python-setuptools)))
> >
> >
> > I can understand the version numbers, I can also understand the optional
> > socks building/module of the python-requests, but why does it read like
> > Gobbledygook?  Can't we improve the output here?
> >
> > For version numbers, this is not a format which happened recently which
> > is exclusive for python build system right? This is just bad formated
> > because of the pypi query.
> > I will first try and not pin the application to these version numbers,
> > maybe itjustworks™.
> >
> >
> > To reproduce: "guix import pypi searx"
> 
> This would now give (change to be sent for review soon):
> 
> --8<---cut here---start->8---
> ./pre-inst-env guix import pypi searx
> 
> Starting download of /tmp/guix-file.1wD8K4
> From 
> https://files.pythonhosted.org/packages/75/3f/5941ad2d500ff7cf6f8da1022c78013dcd2207941d533586a8e7bfe699d3/searx-0.15.0.tar.gz...
>  …5.0.tar.gz  1.6MiB  729KiB/s 00:02 [##] 
> 100.0%
> (package
>   (name "python-searx")
>   (version "0.15.0")
>   (source
> (origin
>   (method url-fetch)
>   (uri (pypi-uri "searx" version))
>   (sha256
> (base32
>   "1gmww73q7wydkvlyz73wnr3sybpjn40wha7avnz9ak9m365zcjxf"
>   (build-system python-build-system)
>   (propagated-inputs
> `(("python-certifi" ,python-certifi)
>   ("python-dateutil" ,python-dateutil)
>   ("python-flask" ,python-flask)
>   ("python-flask-babel" ,python-flask-babel)
>   ("python-idna" ,python-idna)
>   ("python-lxml" ,python-lxml)
>   ("python-pygments" ,python-pygments)
>   ("python-pyopenssl" ,python-pyopenssl)
>   ("python-pyyaml" ,python-pyyaml)
>   ("python-requests" ,python-requests)))
>   (native-inputs
> `(("python-babel" ,python-babel)
>   ("python-cov-core" ,python-cov-core)
>   ("python-mock" ,python-mock)
>   ("python-nose2" ,python-nose2)
>   ("python-pep8" ,python-pep8)
>   ("python-plone.testing" ,python-plone.testing)
>   ("python-selenium" ,python-selenium)
>   ("python-splinter" ,python-splinter)
>   ("python-transifex-client"
>,python-transifex-client)
>   ("python-unittest2" ,python-unittest2)
>   ("python-zope.testrunner"
>,python-zope.testrunner)))
>   (home-page "https://github.com/asciimoo/searx;)
>   (synopsis
> "A privacy-respecting, hackable metasearch engine")
>   (description
> "A privacy-respecting, hackable metasearch engine")
>   (license #f))
> --8<---cut here---end--->8---
> 
> 
> 
> 





bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-05-15 Thread Ricardo Wurmus
Hi Maxim,

I would very much like to see your improvements to the pypi importer to
be merged.  Have you been able to separate the independent changes as
suggested by Ludo?

-- 
Ricardo





bug#24450: [PATCHv2] bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-04-01 Thread Ludovic Courtès
Hi Maxim,

T460s laptop  skribis:

> From 37e499d5d5d5f690aa0a065c730e13f6a31dd30d Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer 
> Date: Thu, 28 Mar 2019 23:12:26 -0400
> Subject: [PATCH] import: pypi: Include optional test inputs as native-inputs.
>
> * guix/import/pypi.scm (maybe-inputs): Add INPUT-TYPE argument, and use it.
> (test-section?): New predicate.
> (parse-requires.txt): Collect the optional test inputs, and return them as the
> second element of the returned list.
> (parse-wheel-metadata): Likewise.
> (guess-requirements): Adapt, and hide unzip output.
> (make-pypi-sexp): Likewise, and include the test inputs requirements as native
> inputs in the returned package expression.
>
> * tests/pypi.scm (test-requires.txt): Include a test section in the
> test-requires.txt data.
> (test-requires.txt-beaker): New variable.
> ("parse-requires.txt"): Adapt.
> ("parse-requires.txt - Beaker"): New test.
> ("parse-wheel-metadata, with extras"): Adapt.
> ("parse-wheel-metadata, with extras - Jedi"): Adapt.
> ("pypi->guix-package, no wheel"): Re-indent, and add the expected
> native-inputs.
> ("pypi->guix-package, wheels"): Likewise.
> ("pypi->guix-package, no usable requirement file."): New test.

It seems that the patch does several unrelated things, such as silencing
‘unzip’, improving docstrings, handling inputs other than
‘propagated-inputs’, and correctly parsing wheels.

Could you try to separate these as much as possible to simplify review?

Thank you!

Ludo’.





bug#24450: [PATCH] bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-03-31 Thread Maxim Cournoyer
Hello!

I've yet another commit to add on the top of the current stack of
patches already sent. This one makes it so that the source archive is
searched for the '[...].egg-info/requires.txt' file rather than check
the more common, fixed location.

This makes the importer more useful, as some packages such as
robotframework-sshlibrary use a "src" directory in their hierarchy which
would cause the previous scheme to not find requires.txt.

From cfde6e09f8f8c692fe252d76ed27e8c50a9e5377 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer 
Date: Sat, 30 Mar 2019 23:13:26 -0400
Subject: [PATCH] import: pypi: Scan source archive to find requires.txt file.

* guix/import/pypi.scm (use-modules): Use invoke from (guix build utils).
(guess-requirements)[archive-root-directory]: Remove procedure.
[guess-requirements-from-wheel]: Re-ident.
[guess-requirements-from-source]: Search for the requires.txt file in the
archive instead of using a static, expected location.
* tests/pypi.scm ("pypi->guix-package, no wheel"): Mock the requires.txt at a
non-standard location to test the new feature.
("pypi->guix-package, no usable requirement file."): Adapt.
---
 guix/import/pypi.scm | 65 ++--
 tests/pypi.scm   | 17 +++-
 2 files changed, 37 insertions(+), 45 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 099768f0c8..a2ce14b192 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -36,7 +36,8 @@
   #:use-module ((guix build utils)
 #:select ((package-name->name+version
. hyphen-package-name->name+version)
-  find-files))
+  find-files
+  invoke))
   #:use-module (guix import utils)
   #:use-module ((guix download) #:prefix download:)
   #:use-module (guix import json)
@@ -267,19 +268,6 @@ omitted since these can be difficult or expensive to satisfy."
 of the required packages specified in the requirements.txt file.  ARCHIVE will
 be extracted in a temporary directory."
 
-  (define (archive-root-directory url)
-;; Given the URL of the package's archive, return the name of the directory
-;; that will be created upon decompressing it. If the filetype is not
-;; supported, return #f.
-(if (compressed-file? url)
-(let ((root-directory (file-sans-extension (basename url
-  (if (string=? "tar" (file-extension root-directory))
-  (file-sans-extension root-directory)
-  root-directory))
-(begin
-  (warning (G_ "Unsupported archive format (~a): \
-cannot determine package dependencies") (file-extension url))
-  #f)))
 
   (define (read-wheel-metadata wheel-archive)
 ;; Given WHEEL-ARCHIVE, a ZIP Python wheel archive, return the package's
@@ -305,33 +293,34 @@ cannot determine package dependencies") (file-extension url))
 (call-with-temporary-output-file
  (lambda (temp port)
(if wheel-url
- (and (url-fetch wheel-url temp)
-  (read-wheel-metadata temp))
- #f
+   (and (url-fetch wheel-url temp)
+(read-wheel-metadata temp))
+   #f
 
   (define (guess-requirements-from-source)
 ;; Return the package's requirements by guessing them from the source.
-(let ((dirname (archive-root-directory source-url))
-  (extension (file-extension source-url)))
-  (if (string? dirname)
-  (call-with-temporary-directory
-   (lambda (dir)
- (let* ((pypi-name (string-take dirname (string-rindex dirname #\-)))
-(requires.txt (string-append dirname "/" pypi-name
- ".egg-info" "/requires.txt"))
-(exit-code
- (parameterize ((current-error-port (%make-void-port "rw+"))
-(current-output-port (%make-void-port "rw+")))
-   (if (string=? "zip" extension)
-   (system* "unzip" archive "-d" dir requires.txt)
-   (system* "tar" "xf" archive "-C" dir requires.txt)
-   (if (zero? exit-code)
-   (parse-requires.txt (string-append dir "/" requires.txt))
-   (begin
- (warning
-  (G_ "Failed to extract file: ~a from source.~%")
-  requires.txt)
- (list '() '()))
+(if (compressed-file? source-url)
+(call-with-temporary-directory
+ (lambda (dir)
+   (parameterize ((current-error-port (%make-void-port "rw+"))
+  (current-output-port (%make-void-port "rw+")))
+ (if (string=? "zip" (file-extension source-url))
+ (invoke "unzip" archive "-d" dir)
+ (invoke "tar" "xf" archive "-C" dir)))
+   (let ((requires.txt-files
+  

bug#24450: [PATCHv2] bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-03-29 Thread T460s laptop

The previous 0007 patch had broken the recursive importer.  This
reworked version fixes this.  The rest of the patches stack sent in the
previous message is still good as is.

From 37e499d5d5d5f690aa0a065c730e13f6a31dd30d Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer 
Date: Thu, 28 Mar 2019 23:12:26 -0400
Subject: [PATCH] import: pypi: Include optional test inputs as native-inputs.

* guix/import/pypi.scm (maybe-inputs): Add INPUT-TYPE argument, and use it.
(test-section?): New predicate.
(parse-requires.txt): Collect the optional test inputs, and return them as the
second element of the returned list.
(parse-wheel-metadata): Likewise.
(guess-requirements): Adapt, and hide unzip output.
(make-pypi-sexp): Likewise, and include the test inputs requirements as native
inputs in the returned package expression.

* tests/pypi.scm (test-requires.txt): Include a test section in the
test-requires.txt data.
(test-requires.txt-beaker): New variable.
("parse-requires.txt"): Adapt.
("parse-requires.txt - Beaker"): New test.
("parse-wheel-metadata, with extras"): Adapt.
("parse-wheel-metadata, with extras - Jedi"): Adapt.
("pypi->guix-package, no wheel"): Re-indent, and add the expected
native-inputs.
("pypi->guix-package, wheels"): Likewise.
("pypi->guix-package, no usable requirement file."): New test.
---
 guix/import/pypi.scm | 195 ---
 tests/pypi.scm   | 123 ---
 2 files changed, 222 insertions(+), 96 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index c520213b6a..099768f0c8 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès 
 ;;; Copyright © 2017 Mathieu Othacehe 
 ;;; Copyright © 2018 Ricardo Wurmus 
+;;; Copyright © 2019 Maxim Cournoyer 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,6 +27,7 @@
   #:use-module (ice-9 receive)
   #:use-module ((ice-9 rdelim) #:select (read-line))
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
@@ -106,14 +108,15 @@ package on PyPI."
 ((name version _ ...)
  (string-append name "-" version ".dist-info"
 
-(define (maybe-inputs package-inputs)
+(define (maybe-inputs package-inputs input-type)
   "Given a list of PACKAGE-INPUTS, tries to generate the 'inputs' field of a
-package definition."
+package definition.  INPUT-TYPE, a symbol, is used to populate the name of
+the input field."
   (match package-inputs
 (()
  '())
 ((package-inputs ...)
- `((propagated-inputs (,'quasiquote ,package-inputs))
+ `((,input-type (,'quasiquote ,package-inputs))
 
 (define %requirement-name-regexp
   ;; Regexp to match the requirement name in a requirement specification.
@@ -147,11 +150,21 @@ package definition."
(or (regexp-exec %requirement-name-regexp spec)
(error (G_ "Could not extract requirement name in spec:") spec
 
+(define (test-section? name)
+  "Return #t if the section name contains 'test' or 'dev'."
+  (any (cut string-contains-ci name <>)
+   '("test" "dev")))
+
 (define (parse-requires.txt requires.txt)
-  "Given REQUIRES.TXT, a Setuptools requires.txt file, return a list of
-requirement names."
-  ;; This is a very incomplete parser, which job is to select the non-optional
-  ;; dependencies and strip them out of any version information.
+  "Given REQUIRES.TXT, a Setuptools requires.txt file, return a pair of requirements.
+
+The first element of the pair contains the required dependencies while the
+second the optional test dependencies.  Note that currently, optional,
+non-test dependencies are omitted since these can be difficult or expensive to
+satisfy."
+
+  ;; This is a very incomplete parser, which job is to read in the requirement
+  ;; specification lines, and strip them out of any version information.
   ;; Alternatively, we could implement a PEG parser with the (ice-9 peg)
   ;; library and the requirements grammar defined by PEP-0508
   ;; (https://www.python.org/dev/peps/pep-0508/).
@@ -168,57 +181,89 @@ requirement names."
 
   (call-with-input-file requires.txt
 (lambda (port)
-  (let loop ((result '()))
+  (let loop ((required-deps '())
+ (test-deps '())
+ (inside-test-section? #f)
+ (optional? #f))
 (let ((line (read-line port)))
-  ;; Stop when a section is encountered, as sections contains optional
-  ;; (extra) requirements.  Non-optional requirements must appear
-  ;; before any section is defined.
-  (if (or (eof-object? line) (section-header? line))
+  (if (eof-object? line)
   ;; Duplicates can occur, since the same requirement can be
   ;; listed multiple times with different conditional markers, e.g.
   ;; pytest >= 3 ; python_version >= "3.3"
   ;; pytest < 3 ; 

bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-03-28 Thread Maxim Cournoyer
ng0  writes:

> I think this should not happen with pypi import:
>
>   (inputs
> `(("python-certifi==2016.2.28"
>,python-certifi==2016.2.28)
>   ("python-dateutil==2.5.3"
>,python-dateutil==2.5.3)
>   ("python-flask-babel==0.11.1"
>,python-flask-babel==0.11.1)
>   ("python-flask==0.11.1" ,python-flask==0.11.1)
>   ("python-lxml==3.6.0" ,python-lxml==3.6.0)
>   ("python-ndg-httpsclient==0.4.1"
>,python-ndg-httpsclient==0.4.1)
>   ("python-pyasn1-modules==0.0.8"
>,python-pyasn1-modules==0.0.8)
>   ("python-pyasn1==0.1.9" ,python-pyasn1==0.1.9)
>   ("python-pygments==2.1.3"
>,python-pygments==2.1.3)
>   ("python-pyopenssl==0.15.1"
>,python-pyopenssl==0.15.1)
>   ("python-pyyaml==3.11" ,python-pyyaml==3.11)
>   ("python-requests[socks]==2.10.0"
>,#{python-requests\x5b;socks\x5d;==2.10.0}#)
>   ("python-setuptools" ,python-setuptools)))
>
>
> I can understand the version numbers, I can also understand the optional
> socks building/module of the python-requests, but why does it read like
> Gobbledygook?  Can't we improve the output here?
>
> For version numbers, this is not a format which happened recently which
> is exclusive for python build system right? This is just bad formated
> because of the pypi query.
> I will first try and not pin the application to these version numbers,
> maybe itjustworks™.
>
>
> To reproduce: "guix import pypi searx"

This would now give (change to be sent for review soon):

--8<---cut here---start->8---
./pre-inst-env guix import pypi searx

Starting download of /tmp/guix-file.1wD8K4
>From 
>https://files.pythonhosted.org/packages/75/3f/5941ad2d500ff7cf6f8da1022c78013dcd2207941d533586a8e7bfe699d3/searx-0.15.0.tar.gz...
 …5.0.tar.gz  1.6MiB  729KiB/s 00:02 [##] 100.0%
(package
  (name "python-searx")
  (version "0.15.0")
  (source
(origin
  (method url-fetch)
  (uri (pypi-uri "searx" version))
  (sha256
(base32
  "1gmww73q7wydkvlyz73wnr3sybpjn40wha7avnz9ak9m365zcjxf"
  (build-system python-build-system)
  (propagated-inputs
`(("python-certifi" ,python-certifi)
  ("python-dateutil" ,python-dateutil)
  ("python-flask" ,python-flask)
  ("python-flask-babel" ,python-flask-babel)
  ("python-idna" ,python-idna)
  ("python-lxml" ,python-lxml)
  ("python-pygments" ,python-pygments)
  ("python-pyopenssl" ,python-pyopenssl)
  ("python-pyyaml" ,python-pyyaml)
  ("python-requests" ,python-requests)))
  (native-inputs
`(("python-babel" ,python-babel)
  ("python-cov-core" ,python-cov-core)
  ("python-mock" ,python-mock)
  ("python-nose2" ,python-nose2)
  ("python-pep8" ,python-pep8)
  ("python-plone.testing" ,python-plone.testing)
  ("python-selenium" ,python-selenium)
  ("python-splinter" ,python-splinter)
  ("python-transifex-client"
   ,python-transifex-client)
  ("python-unittest2" ,python-unittest2)
  ("python-zope.testrunner"
   ,python-zope.testrunner)))
  (home-page "https://github.com/asciimoo/searx;)
  (synopsis
"A privacy-respecting, hackable metasearch engine")
  (description
"A privacy-respecting, hackable metasearch engine")
  (license #f))
--8<---cut here---end--->8---





bug#24450: [PATCH] bug#24450: pypi importer outputs strange character series in optional dependency case.

2019-03-28 Thread Maxim Cournoyer
Hello,

ng0  writes:

> I think this should not happen with pypi import:
>
>   (inputs
> `(("python-certifi==2016.2.28"
>,python-certifi==2016.2.28)
>   ("python-dateutil==2.5.3"
>,python-dateutil==2.5.3)
>   ("python-flask-babel==0.11.1"
>,python-flask-babel==0.11.1)
>   ("python-flask==0.11.1" ,python-flask==0.11.1)
>   ("python-lxml==3.6.0" ,python-lxml==3.6.0)
>   ("python-ndg-httpsclient==0.4.1"
>,python-ndg-httpsclient==0.4.1)
>   ("python-pyasn1-modules==0.0.8"
>,python-pyasn1-modules==0.0.8)
>   ("python-pyasn1==0.1.9" ,python-pyasn1==0.1.9)
>   ("python-pygments==2.1.3"
>,python-pygments==2.1.3)
>   ("python-pyopenssl==0.15.1"
>,python-pyopenssl==0.15.1)
>   ("python-pyyaml==3.11" ,python-pyyaml==3.11)
>   ("python-requests[socks]==2.10.0"
>,#{python-requests\x5b;socks\x5d;==2.10.0}#)
>   ("python-setuptools" ,python-setuptools)))
>
>
> I can understand the version numbers, I can also understand the optional
> socks building/module of the python-requests, but why does it read like
> Gobbledygook?  Can't we improve the output here?
>
> For version numbers, this is not a format which happened recently which
> is exclusive for python build system right? This is just bad formated
> because of the pypi query.
> I will first try and not pin the application to these version numbers,
> maybe itjustworks™.
>
>
> To reproduce: "guix import pypi searx"

The following patches fix this, and more!

From 54e44b7397f17910d95dbdb233d23e5c97c095aa Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer 
Date: Thu, 28 Mar 2019 00:26:00 -0400
Subject: [PATCH 1/7] import: pypi: Do not consider requirements.txt files.

* guix/import/pypi.scm (guess-requirements): Update comment.
[guess-requirements-from-source]: Do not attempt to parse the file
requirements.txt.  Streamline logic.
---
 guix/import/pypi.scm | 35 +--
 tests/pypi.scm   | 23 +++
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 3a20fc4b9b..8269aa61d7 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -206,35 +206,26 @@ cannot determine package dependencies"))
   (call-with-temporary-directory
(lambda (dir)
  (let* ((pypi-name (string-take dirname (string-rindex dirname #\-)))
-(req-files (list (string-append dirname "/requirements.txt")
- (string-append dirname "/" pypi-name ".egg-info"
-"/requires.txt")))
-(exit-codes (map (lambda (file-name)
-   (parameterize ((current-error-port (%make-void-port "rw+"))
-  (current-output-port (%make-void-port "rw+")))
- (system* "tar" "xf" tarball "-C" dir file-name)))
- req-files)))
-   ;; Only one of these files needs to exist.
-   (if (any zero? exit-codes)
-   (match (find-files dir)
- ((file . _)
-  (read-requirements file))
- (()
-  (warning (G_ "No requirements file found.\n"
+(requires.txt (string-append dirname "/" pypi-name
+ ".egg-info" "/requires.txt"))
+(exit-code (parameterize ((current-error-port (%make-void-port "rw+"))
+  (current-output-port (%make-void-port "rw+")))
+ (system* "tar" "xf" tarball "-C" dir requires.txt
+   (if (zero? exit-code)
+   (read-requirements (string-append dir "/" requires.txt))
(begin
- (warning (G_ "Failed to extract requirements files\n"))
+ (warning
+  (G_ "Failed to extract file: ~a from source.~%")
+  requires.txt)
  '())
   '(
 
-  ;; First, try to compute the requirements using the wheel, since that is the
-  ;; most reliable option. If a wheel is not provided for this package, try
-  ;; getting them by reading either the "requirements.txt" file or the
-  ;; "requires.txt" from the egg-info directory from the source tarball. Note
-  ;; that "requirements.txt" is not mandatory, so this is likely to fail.
+  ;; First, try to compute the requirements using the wheel, else, fallback to
+  ;; reading the "requires.txt" from the egg-info directory from the source
+  ;; tarball.
   (or (guess-requirements-from-wheel)
   (guess-requirements-from-source)))
 
-
 (define (compute-inputs source-url wheel-url tarball)
   "Given the SOURCE-URL of an already downloaded 

bug#24450: pypi importer outputs strange character series in optional dependency case.

2016-09-16 Thread ng0
I think this should not happen with pypi import:

  (inputs
`(("python-certifi==2016.2.28"
   ,python-certifi==2016.2.28)
  ("python-dateutil==2.5.3"
   ,python-dateutil==2.5.3)
  ("python-flask-babel==0.11.1"
   ,python-flask-babel==0.11.1)
  ("python-flask==0.11.1" ,python-flask==0.11.1)
  ("python-lxml==3.6.0" ,python-lxml==3.6.0)
  ("python-ndg-httpsclient==0.4.1"
   ,python-ndg-httpsclient==0.4.1)
  ("python-pyasn1-modules==0.0.8"
   ,python-pyasn1-modules==0.0.8)
  ("python-pyasn1==0.1.9" ,python-pyasn1==0.1.9)
  ("python-pygments==2.1.3"
   ,python-pygments==2.1.3)
  ("python-pyopenssl==0.15.1"
   ,python-pyopenssl==0.15.1)
  ("python-pyyaml==3.11" ,python-pyyaml==3.11)
  ("python-requests[socks]==2.10.0"
   ,#{python-requests\x5b;socks\x5d;==2.10.0}#)
  ("python-setuptools" ,python-setuptools)))


I can understand the version numbers, I can also understand the optional
socks building/module of the python-requests, but why does it read like
Gobbledygook?  Can't we improve the output here?

For version numbers, this is not a format which happened recently which
is exclusive for python build system right? This is just bad formated
because of the pypi query.
I will first try and not pin the application to these version numbers,
maybe itjustworks™.


To reproduce: "guix import pypi searx"
-- 
  ng0