Re: [LTP] [PATCH v4 2/5] doc: Add sphinx to requirements.txt

Petr Vorel
2025-03-31T16:37:47Z

> > Hi Petr,

> > On 3/28/25 10:57, Petr Vorel wrote:
> > > Although that slightly prolongs creating virtualenv, it's probably
> > > better to handle it as the other requirements.

> > > Suggested-by: Andrea Cervesato <andrea.cervesato@suse.com>
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > New in v4.

> > > doc/developers/documentation.rst | 2 --
> > > doc/requirements.txt | 1 +
> > > 2 files changed, 1 insertion(+), 2 deletions(-)

> > > diff --git a/doc/developers/documentation.rst b/doc/developers/documentation.rst
> > > index 27c847e125..a303253693 100644
> > > --- a/doc/developers/documentation.rst
> > > +++ b/doc/developers/documentation.rst
> > > @@ -23,8 +23,6 @@ Before building, make sure you have python3 ``virtualenv`` module installed.
> > > # prepare virtual environment
> > > python3 -m virtualenv .venv
> > > . .venv/bin/activate
> > > -
> > > - pip install sphinx # usually packaged in distros
> > > pip install -r requirements.txt
> > > # build documentation
> > > diff --git a/doc/requirements.txt b/doc/requirements.txt
> > > index 742fb8b4bb..1f4cefb2c6 100644
> > > --- a/doc/requirements.txt
> > > +++ b/doc/requirements.txt
> > > @@ -1,3 +1,4 @@
> > > +sphinx
> > In requirements.txt we usually put the right version of the package that we
> > want to use. We can use the latest, what do you think?

> I hesitated a bit if fixed versions are the best as sooner or later will have to
> be manually updated when it breaks, but sure - we use it anyway for other modules

> -sphinx
> -sphinx-rtd-theme==2.0.0
> +sphinx==8.2.3
> +sphinx-rtd-theme==3.0.2

> In that case I would remove python3-sphinx from apt install command in
> .github/workflows/ci-sphinx-doc.yml to match the command => I'll send v5
> of this change only.

Wait, one thing: we use doc/requirements.txt in .readthedocs.yml. Is it really a
good idea to add there sphinx, when it uses containers? I can test it in a
separate branch, but we discussed some time ago that we should avoid adding
sphinx for readthedocs.

Wouldn't be in the end better to keep 'pip install sphinx' in Makefile instead
(the previous proposal).

Kind regards,
Petr

> Kind regards,
> Petr

> > > sphinx-rtd-theme==2.0.0
> > > linuxdoc==20231020
> > > sphinxcontrib-spelling==7.7.0
> > Andrea