Subject: bug#40029: closed (Re: bug#40029: Preventing automatic python2 transformation of some packages)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 25 Jul 2020 19:06:02 +0000

Your bug report

#40029: Preventing automatic python2 transformation of some packages

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
40029: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40029
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#40029: Preventing automatic python2 transformation of some packages
From: Marius Bakke <[email-masked]>
To: Ludovic Courtès <[email-masked]>
Cc: [email-masked]
Date: Sat, 25 Jul 2020 21:05:32 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Ludovic Courtès <[email-masked]> writes:

> Hi!
>
> Marius Bakke <[email-masked]> 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!

Subject: Preventing automatic python2 transformation of some packages
From: Marius Bakke <[email-masked]>
To: [email-masked]
Date: Wed, 11 Mar 2020 19:29:26 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.