diff mbox

gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.

Message ID 20160816181310.23954-1-dannym@scratchpost.org
State New
Headers show

Commit Message

Danny Milosavljevic Aug. 16, 2016, 6:13 p.m. UTC
gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.

* guix/import/pypi.scm (make-pypi-sexp): Modified.
---
 guix/import/pypi.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

non such Aug. 16, 2016, 7:21 p.m. UTC | #1
Hi,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.

Can you be more specific why it is removed? I don't understand the harm
it does or doesn't do when it's included.
Would this not be bad for packages which require setuptools?

> * guix/import/pypi.scm (make-pypi-sexp): Modified.
> ---
>  guix/import/pypi.scm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
> index 343445a..d177d33 100644
> --- a/guix/import/pypi.scm
> +++ b/guix/import/pypi.scm
> @@ -233,7 +233,7 @@ name/variable pairs describing the required inputs of this package."
>    (sort
>      (map (lambda (input)
>             (list input (list 'unquote (string->symbol input))))
> -         (append '("python-setuptools")
> +         (append ;'("python-setuptools")
>                   ;; Argparse has been part of Python since 2.7.
>                   (remove (cut string=? "python-argparse" <>)
>                           (guess-requirements source-url wheel-url tarball))))
> @@ -271,7 +271,8 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
>               (home-page ,home-page)
>               (synopsis ,synopsis)
>               (description ,description)
> -             (license ,(license->symbol license)))))))
> +             (license ,(license->symbol license))
> +             (properties `((python2-variant . ,(delay python2-foobar)))))))))
>  
>  (define (pypi->guix-package package-name)
>    "Fetch the metadata for PACKAGE-NAME from pypi.python.org, and return the
Danny Milosavljevic Aug. 16, 2016, 7:39 p.m. UTC | #2
Hi,

> Can you be more specific why it is removed? I don't understand the harm
> it does or doesn't do when it's included.
> Would this not be bad for packages which require setuptools?

Python 3.4 integrated setuptools into the main distribution. It doesn't require an external python-setuptools. I don't understand why Guix even still has a "python-setuptools" package. (python2-setuptools is OK - but the other one: why?)

New packages are usually Python 3 compatible. Also, the python-build-system defaults to Python 3.

That's why I assume that the package S-Expression printed is for Python 3 (and so do many other Guix parts). There, it doesn't make sense to include setuptools anymore.

Also, it's better if the package expression doesn't include python-setuptools by default because a lazy packager (i.e. me) will just copy & paste it and call it a day. Then the new package depends on python-setuptools even though it doesn't need it at all.

I'm not sure what to do about the Python 2 package expression. I think this function only can return one expression.

If possible, I'd like it to automatically print the Python 2 package expression, for example

(define-public python2-lockfile
  (let ((base (package-with-python2 (strip-python2-variant python-lockfile))))
    (package
      (inherit base)
      (native-inputs `(("python2-setuptools" ,python2-setuptools)
                       ,@(package-native-inputs base))))))

, as well.
Pjotr Prins Aug. 16, 2016, 7:42 p.m. UTC | #3
On Tue, Aug 16, 2016 at 09:39:52PM +0200, Danny Milosavljevic wrote:
> Hi,
> 
> > Can you be more specific why it is removed? I don't understand the harm
> > it does or doesn't do when it's included.
> > Would this not be bad for packages which require setuptools?

Not all python packages require setuptools.

Pj.
Leo Famulari Aug. 16, 2016, 7:59 p.m. UTC | #4
On Tue, Aug 16, 2016 at 08:13:10PM +0200, Danny Milosavljevic wrote:
> gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.

I'm in favor of not automatically adding setuptools to packages created
with the PyPi importer. For the packages that require setuptools,
packagers can add it themselves. I reply to too many patches with
"Please remove setuptools".

I don't understand the importer well enough to comment on this
particular patch.
diff mbox

Patch

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 343445a..d177d33 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -233,7 +233,7 @@  name/variable pairs describing the required inputs of this package."
   (sort
     (map (lambda (input)
            (list input (list 'unquote (string->symbol input))))
-         (append '("python-setuptools")
+         (append ;'("python-setuptools")
                  ;; Argparse has been part of Python since 2.7.
                  (remove (cut string=? "python-argparse" <>)
                          (guess-requirements source-url wheel-url tarball))))
@@ -271,7 +271,8 @@  VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
              (home-page ,home-page)
              (synopsis ,synopsis)
              (description ,description)
-             (license ,(license->symbol license)))))))
+             (license ,(license->symbol license))
+             (properties `((python2-variant . ,(delay python2-foobar)))))))))
 
 (define (pypi->guix-package package-name)
   "Fetch the metadata for PACKAGE-NAME from pypi.python.org, and return the