GNU bug report logs - #40029
Preventing automatic python2 transformation of some packages

Previous Next

Package: guix;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Wed, 11 Mar 2020 18:30:02 UTC

Severity: normal

Done: Marius Bakke <marius <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Marius Bakke <marius <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#40029: closed (Preventing automatic python2 transformation of
 some packages)
Date: Sat, 25 Jul 2020 19:06:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 25 Jul 2020 21:05:32 +0200
with message-id <87zh7nqutf.fsf <at> gnu.org>
and subject line Re: bug#40029: Preventing automatic python2 transformation of some packages
has caused the debbugs.gnu.org bug report #40029,
regarding Preventing automatic python2 transformation of some packages
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
40029: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40029
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Marius Bakke <mbakke <at> fastmail.com>
To: bug-guix <at> gnu.org
Subject: Preventing automatic python2 transformation of some packages
Date: Wed, 11 Mar 2020 19:29:26 +0100
[Message part 3 (text/plain, inline)]
Guix,

'python2-sphinx' is obsolete and increasingly a maintenance burden,
because we need to keep special versions around just to make it build.

The only reason we have this package is because it gets pulled in
automatically when using (package-with-python2 ...) on a Python 3
package that has 'python-sphinx' in inputs.

Most, or all, Python packages do not use Sphinx as runtime library, but
only calls its executables to generate documentation.  Thus, we do not
actually need the Python 2 variant.

I tried fixing this in (guix build-system python) by only transforming
packages whose names start with 'python-', and renaming 'python-sphinx'
to just 'sphinx'.  It was a clever one-liner until I realized that
Python 2 packages now got a variant of 'sphinx' that's built with Python
3 (yay!), but all the *inputs* of this Sphinx variant were transformed
into Python 2!  So it did not actually build in the end.

I'm mostly venting here, but filing the bug so we can target it for the
next 'core-updates' round.  Ideas welcome.

There are some other improvements I'd like to see in
python-build-system, such as automatically calling 'pytest' instead of
the deprecated 'python setup.py test' when pytest is available.
[signature.asc (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: Marius Bakke <marius <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 40029-done <at> debbugs.gnu.org
Subject: Re: bug#40029: Preventing automatic python2 transformation of some
 packages
Date: Sat, 25 Jul 2020 21:05:32 +0200
[Message part 6 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi!
>
> Marius Bakke <mbakke <at> fastmail.com> skribis:
>
>> 'python2-sphinx' is obsolete and increasingly a maintenance burden,
>> because we need to keep special versions around just to make it build.
>>
>> The only reason we have this package is because it gets pulled in
>> automatically when using (package-with-python2 ...) on a Python 3
>> package that has 'python-sphinx' in inputs.
>
> What about this evil hack?
>
> diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
> index 323d5b4457..66306e97fc 100644
> --- a/gnu/packages/sphinx.scm
> +++ b/gnu/packages/sphinx.scm
> @@ -99,7 +99,7 @@
>  for Python projects or other documents consisting of multiple reStructuredText
>  sources.")
>      (license license:bsd-2)
> -    (properties `((python2-variant . ,(delay python2-sphinx))))))
> +    (properties `((python2-variant . ,(delay python-sphinx))))))
>  
>  ;; Sphinx 2 does not support Python 2, so we stick with this older version here.
>  ;; Remove this package once python2-pbcore no longer requires it.
>
> The effect should be that ‘package-with-python2’ always keeps
> ‘python-sphinx’ unchanged.  (It’s a double-edge sword.)

This is brilliant and I can confirm it works.  It never would have
occured to me that this is possible.

'python2-sphinx' will be removed on the next staging cycle.

Thanks!
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.