public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Antonin Godard <antonin.godard@bootlin.com>,
	foss@0leil.net, docs@lists.yoctoproject.org
Subject: Re: [docs] [PATCH v4 1/3] use a venv for installing packages with pip
Date: Mon, 23 Feb 2026 18:33:54 +0100	[thread overview]
Message-ID: <e41bdc41-be0f-4c85-bcbd-e00b10433336@cherry.de> (raw)
In-Reply-To: <DGHXUDE510VH.1JG9S6P90SNTG@bootlin.com>

Hi Antonin,

On 2/18/26 9:18 AM, Antonin Godard wrote:
> Hi,
> 
> On Mon Feb 16, 2026 at 12:26 PM CET, Quentin Schulz via lists.yoctoproject.org wrote:
> [...]
>> diff --git a/documentation/tools/host_packages_scripts/pip3_docs.sh b/documentation/tools/host_packages_scripts/pip3_docs.sh
>> index 907ecec55..9aa7f16fb 100644
>> --- a/documentation/tools/host_packages_scripts/pip3_docs.sh
>> +++ b/documentation/tools/host_packages_scripts/pip3_docs.sh
>> @@ -1 +1,3 @@
>> -sudo pip3 install sphinx sphinx_rtd_theme pyyaml sphinx-copybutton
>> +python3 -m venv --clear --system-site-packages /tmp/yocto-venv
> 
> I find /tmp a bit odd for installing a virtual environment (at least, from a
> user perspective, as I can understand why you did this for the container).
> 
> Maybe you can add a comment above this line saying:
> 
> # change "/tmp/yocto-venv" to "./yocto-venv" if you want a persistent virtual environment
> 
> ?
> 

I can do yet another sed in Containerfile to avoid telling the user to 
do that and just have the path different in the container (see what we 
do for zypper install commands). I tried mounting the volume 
(yocto-docs) as an overlay within the container (:O in podman) but that 
didn't work, so we have to have the venv outside of the mounting point.

> Also maybe, s/yocto-venv/yocto-docs-venv/?
> 

I was about to interject that because we use --system-site-packages, we 
could still run bitbake from within the venv and thus renaming it is 
unnecessary, but then I tried building the docs locally on my f43 system 
and this series doesn't actually work.

It complains about not being able to find sphinxcontrib.rsvgconverter 
plugin while it definitely is installed!

Then I remembered having a somewhat similar issue in my Python 
pet-project when I had the same package installed twice, once 
system-wide and once in a venv... Turns out that a package which 
installs a command/script doesn't seem to work with venv (at least with 
my sample pool of... 2). It would always use the system's when using the 
command (and it'd be fine with python3 -m <package> as far as I remember).
sphinx-build actually is a script, c.f. 
https://github.com/sphinx-doc/sphinx/blob/master/pyproject.toml#L99. So 
when our Makefile calls sphinx-build, it may very well be calling the 
system package if there's one and not the command for the sphinx within 
the venv. This results in not being able to find the modules installed 
in the venv (that is, sphinxcontrib.rsvgconverter). But Quentin, you 
would say, simply replace sphinx-build with python3 -m sphinx and all 
shall be well! Now the sphinx Python module used is indeed the one from 
the venv, but it cannot find the system modules anymore. If anyone has 
any idea what's going on, let me know but I don't think I'll investigate 
this further.

Instead, I'll NOT pass --system-site-packages to venv such that we only 
have packages from PyPI (which means, not being able to run BitBake from 
that venv). Now... this still doesn't resolve the issue of sphinx-build 
calling the module from the system if it exists... So I plan to change 
sphinx-build to python3 -m sphinx in our Makefile to work-around that. 
Any objection? Did I miss something or get something wrong maybe?

Cheers,
Quentin


  reply	other threads:[~2026-02-23 17:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 11:26 [PATCH v4 0/3] migrate Debian/Ubuntu to pip packages for docs + fix epub and latexpdf targets not finding glob images Quentin Schulz
2026-02-16 11:26 ` [PATCH v4 1/3] use a venv for installing packages with pip Quentin Schulz
2026-02-18  8:18   ` [docs] " Antonin Godard
2026-02-23 17:33     ` Quentin Schulz [this message]
2026-02-24  8:28       ` Antonin Godard
2026-02-24 12:52         ` Quentin Schulz
2026-02-24 13:55           ` Quentin Schulz
2026-02-24 14:03             ` Antonin Godard
2026-02-16 11:26 ` [PATCH v4 2/3] consistently use pip packages for all distros Quentin Schulz
2026-02-16 11:26 ` [PATCH v4 3/3] convert SVGs to PDF and PNG using sphinxcontrib.rsvgconverter plugin Quentin Schulz
2026-02-16 14:26 ` [PATCH v4 0/3] migrate Debian/Ubuntu to pip packages for docs + fix epub and latexpdf targets not finding glob images Antonin Godard
2026-03-02  9:53 ` Antonin Godard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e41bdc41-be0f-4c85-bcbd-e00b10433336@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=antonin.godard@bootlin.com \
    --cc=docs@lists.yoctoproject.org \
    --cc=foss@0leil.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox