all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#22808: Add a function to simplify many of the new python2-foo definitions
@ 2016-02-25 21:14 Christopher Allan Webber
  2016-02-26 23:26 ` Ludovic Courtès
  2019-01-31 14:39 ` bug#22808: Close Andreas Enge
  0 siblings, 2 replies; 6+ messages in thread
From: Christopher Allan Webber @ 2016-02-25 21:14 UTC (permalink / raw)
  To: 22808

Right now we have a lot of these that look very similar:

  (define-public python2-chardet
    (package
      (inherit (package-with-python2
                (strip-python2-variant python-chardet)))
      (native-inputs `(("python2-setuptools" ,python2-setuptools)))))

  (define-public python2-translitcodec
    (package
      (inherit (package-with-python2
                (strip-python2-variant python-translitcodec)))
      (native-inputs `(("python2-setuptools" ,python2-setuptools)))))

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

Time for an abstraction?

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

* bug#22808: Add a function to simplify many of the new python2-foo definitions
  2016-02-25 21:14 bug#22808: Add a function to simplify many of the new python2-foo definitions Christopher Allan Webber
@ 2016-02-26 23:26 ` Ludovic Courtès
  2016-04-26  9:54   ` Ludovic Courtès
  2019-01-31 14:39 ` bug#22808: Close Andreas Enge
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-02-26 23:26 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: 22808

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> Right now we have a lot of these that look very similar:
>
>   (define-public python2-chardet
>     (package
>       (inherit (package-with-python2
>                 (strip-python2-variant python-chardet)))
>       (native-inputs `(("python2-setuptools" ,python2-setuptools)))))

Right, we discussed before adding the python2-setuptools dependency
automatically as part of ‘package-with-python2’.  I think this would be
a good idea, indeed.

We need to see if there are exceptions to this rule.

Any takers?  :-)

Ludo’.

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

* bug#22808: Add a function to simplify many of the new python2-foo definitions
  2016-02-26 23:26 ` Ludovic Courtès
@ 2016-04-26  9:54   ` Ludovic Courtès
  2016-04-26 12:44     ` Efraim Flashner
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-04-26  9:54 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: 22808

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

ludo@gnu.org (Ludovic Courtès) skribis:

> Christopher Allan Webber <cwebber@dustycloud.org> skribis:
>
>> Right now we have a lot of these that look very similar:
>>
>>   (define-public python2-chardet
>>     (package
>>       (inherit (package-with-python2
>>                 (strip-python2-variant python-chardet)))
>>       (native-inputs `(("python2-setuptools" ,python2-setuptools)))))
>
> Right, we discussed before adding the python2-setuptools dependency
> automatically as part of ‘package-with-python2’.  I think this would be
> a good idea, indeed.

What about this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 590 bytes --]

--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -345,6 +345,14 @@ instead of @command{python3}.")))
 (define-public python-wrapper (wrap-python3 python))
 (define-public python-minimal-wrapper (wrap-python3 python-minimal))
 
+(define (package-with-python2+setuptools p)
+  (let ((base (package-with-python2 (strip-python2-variant p))))
+    (package
+      (inherit base)
+      (native-inputs `(("python2-setuptools" ,python2-setuptools)
+                       ,@(package-native-inputs base))))))
+
+\f
 (define-public python-psutil
   (package
     (name "python-psutil")

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


Then we need to change all the occurrences of this pattern to use this
new procedure.

Thoughts?

Ludo’.

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

* bug#22808: Add a function to simplify many of the new python2-foo definitions
  2016-04-26  9:54   ` Ludovic Courtès
@ 2016-04-26 12:44     ` Efraim Flashner
  2016-04-26 13:09       ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Efraim Flashner @ 2016-04-26 12:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 22808

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

On Tue, Apr 26, 2016 at 11:54:28AM +0200, Ludovic Courtès wrote:
> ludo@gnu.org (Ludovic Courtès) skribis:
> 
> > Christopher Allan Webber <cwebber@dustycloud.org> skribis:
> >
> >> Right now we have a lot of these that look very similar:
> >>
> >>   (define-public python2-chardet
> >>     (package
> >>       (inherit (package-with-python2
> >>                 (strip-python2-variant python-chardet)))
> >>       (native-inputs `(("python2-setuptools" ,python2-setuptools)))))
> >
> > Right, we discussed before adding the python2-setuptools dependency
> > automatically as part of ‘package-with-python2’.  I think this would be
> > a good idea, indeed.
> 
> What about this:
> 

> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -345,6 +345,14 @@ instead of @command{python3}.")))
>  (define-public python-wrapper (wrap-python3 python))
>  (define-public python-minimal-wrapper (wrap-python3 python-minimal))
>  
> +(define (package-with-python2+setuptools p)
> +  (let ((base (package-with-python2 (strip-python2-variant p))))
> +    (package
> +      (inherit base)
> +      (native-inputs `(("python2-setuptools" ,python2-setuptools)
> +                       ,@(package-native-inputs base))))))
> +
> +\f
>  (define-public python-psutil
>    (package
>      (name "python-psutil")

> 
> Then we need to change all the occurrences of this pattern to use this
> new procedure.
> 
> Thoughts?
> 
> Ludo’.

Would we still need the properties field in python-foo?

What would this mean for packages that need python2-setuptools and other
python2- specific packages? Specifically, would all the calls to
package-native-inputs cause a slowdown in computing the package?

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* bug#22808: Add a function to simplify many of the new python2-foo definitions
  2016-04-26 12:44     ` Efraim Flashner
@ 2016-04-26 13:09       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-04-26 13:09 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 22808

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Tue, Apr 26, 2016 at 11:54:28AM +0200, Ludovic Courtès wrote:
>> ludo@gnu.org (Ludovic Courtès) skribis:

[...]

>> What about this:
>> 
>
>> --- a/gnu/packages/python.scm
>> +++ b/gnu/packages/python.scm
>> @@ -345,6 +345,14 @@ instead of @command{python3}.")))
>>  (define-public python-wrapper (wrap-python3 python))
>>  (define-public python-minimal-wrapper (wrap-python3 python-minimal))
>>  
>> +(define (package-with-python2+setuptools p)
>> +  (let ((base (package-with-python2 (strip-python2-variant p))))
>> +    (package
>> +      (inherit base)
>> +      (native-inputs `(("python2-setuptools" ,python2-setuptools)
>> +                       ,@(package-native-inputs base))))))
>> +
>> +\f
>>  (define-public python-psutil
>>    (package
>>      (name "python-psutil")
>
>> 
>> Then we need to change all the occurrences of this pattern to use this
>> new procedure.
>> 
>> Thoughts?
>> 
>> Ludo’.
>
> Would we still need the properties field in python-foo?

Yes.

> What would this mean for packages that need python2-setuptools and other
> python2- specific packages? Specifically, would all the calls to
> package-native-inputs cause a slowdown in computing the package?

It wouldn’t change anything, since this exact same pattern is already
used in many different places in python.scm (search for
“python2-setuptools” and you’ll see :-)).  It would simply allow us to
factorize it.

Ludo’.

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

* bug#22808: Close
  2016-02-25 21:14 bug#22808: Add a function to simplify many of the new python2-foo definitions Christopher Allan Webber
  2016-02-26 23:26 ` Ludovic Courtès
@ 2019-01-31 14:39 ` Andreas Enge
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Enge @ 2019-01-31 14:39 UTC (permalink / raw)
  To: 22808-done

This seems to be solved using package-with-python2.

Andreas

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

end of thread, other threads:[~2019-01-31 14:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-25 21:14 bug#22808: Add a function to simplify many of the new python2-foo definitions Christopher Allan Webber
2016-02-26 23:26 ` Ludovic Courtès
2016-04-26  9:54   ` Ludovic Courtès
2016-04-26 12:44     ` Efraim Flashner
2016-04-26 13:09       ` Ludovic Courtès
2019-01-31 14:39 ` bug#22808: Close Andreas Enge

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.