unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.
@ 2016-08-16 18:13 Danny Milosavljevic
  2016-08-16 19:21 ` ng0
  2016-08-16 19:59 ` Leo Famulari
  0 siblings, 2 replies; 5+ messages in thread
From: Danny Milosavljevic @ 2016-08-16 18:13 UTC (permalink / raw)
  To: guix-devel

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

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-pypi-importer-Remove-python-setuptools-and-hint-.patch --]
[-- Type: text/x-patch; name="0001-gnu-pypi-importer-Remove-python-setuptools-and-hint-.patch", Size: 1152 bytes --]

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

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

* Re: [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.
  2016-08-16 18:13 [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it Danny Milosavljevic
@ 2016-08-16 19:21 ` ng0
  2016-08-16 19:39   ` Danny Milosavljevic
  2016-08-16 19:59 ` Leo Famulari
  1 sibling, 1 reply; 5+ messages in thread
From: ng0 @ 2016-08-16 19:21 UTC (permalink / raw)
  To: Danny Milosavljevic, guix-devel

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

-- 
♥Ⓐ  ng0
For non-prism friendly talk find me on http://www.psyced.org

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

* Re: [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.
  2016-08-16 19:21 ` ng0
@ 2016-08-16 19:39   ` Danny Milosavljevic
  2016-08-16 19:42     ` Pjotr Prins
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2016-08-16 19:39 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel

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.

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

* Re: [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.
  2016-08-16 19:39   ` Danny Milosavljevic
@ 2016-08-16 19:42     ` Pjotr Prins
  0 siblings, 0 replies; 5+ messages in thread
From: Pjotr Prins @ 2016-08-16 19:42 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

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.

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

* Re: [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it.
  2016-08-16 18:13 [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it Danny Milosavljevic
  2016-08-16 19:21 ` ng0
@ 2016-08-16 19:59 ` Leo Famulari
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Famulari @ 2016-08-16 19:59 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

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.

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

end of thread, other threads:[~2016-08-16 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-16 18:13 [PATCH] gnu: pypi importer: Remove python-setuptools and hint on how to re-add it Danny Milosavljevic
2016-08-16 19:21 ` ng0
2016-08-16 19:39   ` Danny Milosavljevic
2016-08-16 19:42     ` Pjotr Prins
2016-08-16 19:59 ` Leo Famulari

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