flatpak / flatpak-docs

Flatpak documentation
https://docs.flatpak.org
Other
79 stars 132 forks source link

Makefile: Use sphinx-build as the default sphinx command #479

Closed bbhtt closed 3 months ago

bbhtt commented 3 months ago

And fallback to sphinx-build-3 only if it does not exist.

The default build instructions now use a python virtual environment and inside that pip installs sphinx-build. Since the <venv>/bin is exported as the first item in $PATH once activated, we can ensure that sphinx-build from venv is used first.

Outside the venv if sphinx-build is not found sphinx-build-3 is tried.

Closes https://github.com/flatpak/flatpak-docs/issues/477

bbhtt commented 3 months ago

we can ensure that sphinx-build from venv is used first.

I know it relies on the venv path being exported and the executable being available there and still has the chance that sphinx-build from host got used when the expectation was to use it from venv (when venv didn't get properly activated etc.).

TingPing commented 3 months ago

I feel like it should be the reverse, if a distro packages both we want -3, and if -3 doesn't exist then the normal one is likely fine.

TingPing commented 3 months ago

Ah I see you want to avoid system versions... This is probably fine then. Users likely wouldn't have both versions installed.

bbhtt commented 3 months ago

Yea the idea was to prefer sphinx from venv first if the venv got activated correctly.

The opposite allows to escape venv if someone has both system packages and venv package installed.

With this it'll try from the venv first if it was activated and modules installed properly.