Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #10814 > unrolled thread

sphinx-build vs. Python 3

Started byOndrej Novy <novy@ondrej.org>
First post2018-08-20 10:10 +0200
Last post2018-08-21 22:30 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.debian.maint.python


Contents

  sphinx-build vs. Python 3 Ondrej Novy <novy@ondrej.org> - 2018-08-20 10:10 +0200
    Re: sphinx-build vs. Python 3 Thomas Goirand <zigo@debian.org> - 2018-08-20 12:40 +0200
      Re: sphinx-build vs. Python 3 Ondrej Novy <novy@ondrej.org> - 2018-08-21 10:50 +0200
        Re: sphinx-build vs. Python 3 Thomas Goirand <zigo@debian.org> - 2018-08-21 12:40 +0200
          Re: sphinx-build vs. Python 3 Ondrej Novy <novy@ondrej.org> - 2018-08-21 13:00 +0200
    Re: sphinx-build vs. Python 3 Dmitry Shachnev <mitya57@debian.org> - 2018-08-21 15:10 +0200
      Re: sphinx-build vs. Python 3 Mattia Rizzolo <mattia@debian.org> - 2018-08-21 22:30 +0200

#10814 — sphinx-build vs. Python 3

FromOndrej Novy <novy@ondrej.org>
Date2018-08-20 10:10 +0200
Subjectsphinx-build vs. Python 3
Message-ID<woNq9-3Oq-3@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi,

I have question about sphinx-build and our effort to move to Python 3.

sphinx-build is currently Python 2 or Python 3 according to python-sphinx /
python3-sphinx package installed (with python3 as default if both are
installed by alternative priority).

According to:
https://wiki.debian.org/Python/LibraryStyleGuide#Sphinx_documentation we
should use "python3 -m sphinx" if we want to build docs using Python 3,
because if you run sphinx-build, you can't be sure which version of Sphinx
is run and if you need some Sphinx extension, which we typically installs
only Python 2 or Python 3 version of it.

And my question is:
* should we use "python3 -m sphinx" instead of "sphinx-build" everywhere
where python3-sphinx is in B-D (mass-commit?)
OR
* should we change sphinx-build to be Python3 only? (and broke current
packages build with Python2 Sphinx)

Thanks for your opinions.

-- 
Best regards
 Ondřej Nový

Email: novy@ondrej.org
PGP: 3D98 3C52 EB85 980C 46A5  6090 3573 1255 9D1E 064B

[toc] | [next] | [standalone]


#10817

FromThomas Goirand <zigo@debian.org>
Date2018-08-20 12:40 +0200
Message-ID<woPLj-53M-7@gated-at.bofh.it>
In reply to#10814
On 08/20/2018 09:50 AM, Ondrej Novy wrote:
> Hi,
> 
> I have question about sphinx-build and our effort to move to Python 3.
> 
> sphinx-build is currently Python 2 or Python 3 according to
> python-sphinx / python3-sphinx package installed (with python3 as
> default if both are installed by alternative priority). 
> 
> According
> to: https://wiki.debian.org/Python/LibraryStyleGuide#Sphinx_documentation we
> should use "python3 -m sphinx" if we want to build docs using Python 3,
> because if you run sphinx-build, you can't be sure which version of
> Sphinx is run and if you need some Sphinx extension, which we typically
> installs only Python 2 or Python 3 version of it.
> 
> And my question is:
> * should we use "python3 -m sphinx" instead of "sphinx-build" everywhere
> where python3-sphinx is in B-D (mass-commit?)
> OR
> * should we change sphinx-build to be Python3 only? (and broke current
> packages build with Python2 Sphinx)
> 
> Thanks for your opinions.

If you do the later, then anyway, you'll have to do the former if you
need backports. This bite me a few times with OpenStack already. So, no
mater what the faith of the sphinx-build command, it's always best to
use python3 -m sphinx, IMO.

Cheers,

Thomas Goirand (zigo)

[toc] | [prev] | [next] | [standalone]


#10826

FromOndrej Novy <novy@ondrej.org>
Date2018-08-21 10:50 +0200
Message-ID<wpawp-s7-5@gated-at.bofh.it>
In reply to#10817

[Multipart message — attachments visible in raw view] — view raw

Hi,

po 20. 8. 2018 v 12:37 odesílatel Thomas Goirand <zigo@debian.org> napsal:

> If you do the later, then anyway, you'll have to do the former if you
> need backports. This bite me a few times with OpenStack already. So, no
> mater what the faith of the sphinx-build command, it's always best to
> use python3 -m sphinx, IMO.
>

agree. So:

https://salsa.debian.org/python-team/modules/python-pymysql/commit/b562fc29c311249fcb34639cc2a7d3267dd1f818
(only if python3-sphinx is in B-D)

Any thoughts?

-- 
Best regards
 Ondřej Nový

Email: novy@ondrej.org
PGP: 3D98 3C52 EB85 980C 46A5  6090 3573 1255 9D1E 064B

[toc] | [prev] | [next] | [standalone]


#10827

FromThomas Goirand <zigo@debian.org>
Date2018-08-21 12:40 +0200
Message-ID<wpceR-1uj-1@gated-at.bofh.it>
In reply to#10826
On 08/21/2018 10:26 AM, Ondrej Novy wrote:
> Hi,
> 
> po 20. 8. 2018 v 12:37 odesílatel Thomas Goirand <zigo@debian.org
> <mailto:zigo@debian.org>> napsal:
> 
>     If you do the later, then anyway, you'll have to do the former if you
>     need backports. This bite me a few times with OpenStack already. So, no
>     mater what the faith of the sphinx-build command, it's always best to
>     use python3 -m sphinx, IMO.
> 
> 
> agree. So:
> 
> https://salsa.debian.org/python-team/modules/python-pymysql/commit/b562fc29c311249fcb34639cc2a7d3267dd1f818
> (only if python3-sphinx is in B-D)
> 
> Any thoughts?

On top of this, I generally also do PYTHON=python3, just in case the
Sphinx doc needs to invoke the interpreter...

Cheers,

Thomas Goirand (zigo)

[toc] | [prev] | [next] | [standalone]


#10828

FromOndrej Novy <novy@ondrej.org>
Date2018-08-21 13:00 +0200
Message-ID<wpcye-1Aw-5@gated-at.bofh.it>
In reply to#10827

[Multipart message — attachments visible in raw view] — view raw

Hi,

út 21. 8. 2018 v 12:37 odesílatel Thomas Goirand <zigo@debian.org> napsal:

> On top of this, I generally also do PYTHON=python3, just in case the
> Sphinx doc needs to invoke the interpreter...
>

i don't think this is good idea. If Sphinx doc needs to invoke interpreter,
it should do it in more smart way. Overriding default is not solution, just
fix that docs source code.

-- 
Best regards
 Ondřej Nový

Email: novy@ondrej.org
PGP: 3D98 3C52 EB85 980C 46A5  6090 3573 1255 9D1E 064B

[toc] | [prev] | [next] | [standalone]


#10829

FromDmitry Shachnev <mitya57@debian.org>
Date2018-08-21 15:10 +0200
Message-ID<wpeA2-2YE-1@gated-at.bofh.it>
In reply to#10814

[Multipart message — attachments visible in raw view] — view raw

Hi Ondřej!

On Mon, Aug 20, 2018 at 09:50:25AM +0200, Ondrej Novy wrote:
> Hi,
>
> I have question about sphinx-build and our effort to move to Python 3.
>
> sphinx-build is currently Python 2 or Python 3 according to python-sphinx /
> python3-sphinx package installed (with python3 as default if both are
> installed by alternative priority).
>
> According to:
> https://wiki.debian.org/Python/LibraryStyleGuide#Sphinx_documentation we
> should use "python3 -m sphinx" if we want to build docs using Python 3,
> because if you run sphinx-build, you can't be sure which version of Sphinx
> is run and if you need some Sphinx extension, which we typically installs
> only Python 2 or Python 3 version of it.

That wiki page was written before I changed Sphinx scripts to use Python 3
by default. That happened only recently, the relevant upload reached
unstable on July 5th 2018.

If you depend on python3-sphinx (>= 1.7.5-4~) then most likely the scripts
will be using Python 3. The opposite will happen only if the user manually
updated the alternative, and this won’t be the case on a sane build
environment.

> And my question is:
> * should we use "python3 -m sphinx" instead of "sphinx-build" everywhere
> where python3-sphinx is in B-D (mass-commit?)

This won’t hurt, but as I said it won’t make any difference on the current
unstable. It will make difference only when building against an older version
of sphinx (e.g. backports) *and* with installed python-sphinx.

> * should we change sphinx-build to be Python3 only? (and broke current
> packages build with Python2 Sphinx)

I would like to do this in the future, but currently there will be too
many broken packages:

https://lintian.debian.org/tags/build-depends-on-python-sphinx-only.html
lists 386 packages.

--
Dmitry Shachnev

[toc] | [prev] | [next] | [standalone]


#10830

FromMattia Rizzolo <mattia@debian.org>
Date2018-08-21 22:30 +0200
Message-ID<wplrP-712-1@gated-at.bofh.it>
In reply to#10829

[Multipart message — attachments visible in raw view] — view raw

On Tue, Aug 21, 2018 at 04:03:20PM +0300, Dmitry Shachnev wrote:
> If you depend on python3-sphinx (>= 1.7.5-4~) then most likely the scripts
> will be using Python 3. The opposite will happen only if the user manually
> updated the alternative, and this won’t be the case on a sane build
> environment.

I'm not so sure about this.  I don't remember Policy specifying whether
a build process can make assumptions on the configuration of possible
alternatives, and at any rate I wouldn't bet my build process on that:
after all you talk about "sane build environment", but I don't remember
any kind of consensus that said building on your dirty daily system is
not supported.

I'm personally biased as a member of the Reproducible Builds team that
believe any possible variable in the environment must not affect the
build result, this sounds like yet another one to me.

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web