Closed dviererbe closed 1 month ago
In the meantime, here is a work around (not a long term solution!) to remove the dependency on apt-get
and distro-info
:
diff --git a/Makefile.sp b/Makefile.sp
index b85f6b4..8bf1321 100644
--- a/Makefile.sp
+++ b/Makefile.sp
@@ -51,8 +51,6 @@ sp-pa11y-install:
}
sp-install: $(VENVDIR)
- sudo apt-get update
- sudo apt-get install --assume-yes distro-info
sp-run: sp-install
. $(VENV); sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
diff --git a/conf.py b/conf.py
index 16f8522..ca667d5 100644
--- a/conf.py
+++ b/conf.py
@@ -112,8 +112,7 @@ if 'custom_rst_epilog' in locals():
if 'custom_manpages_url' in locals():
manpages_url = custom_manpages_url
else:
- manpages_distribution = subprocess.check_output("distro-info --stable",
- text=True, shell=True).strip()
+ manpages_distribution = "noble"
manpages_url = ("https://manpages.ubuntu.com/manpages/"
f"{manpages_distribution}/en/"
"man{section}/{page}.{section}.html")
Ideas for a long term solution that does not depend on apt-get
for the above mentioned problem:
distro-info --stable
ourselves)python3-distro-info
package (see https://launchpad.net/ubuntu/+source/distro-info) which contains a python module that could be used in the python script directly, but it is not in the pip store, so we could look into publishing this module there and adding it to the requirements.txt fileThis could also be a solution for #231
cc: @ru-fu @tigarmo
Unfortunately #226 needs to be reverted - the starter pack must be usable on non-Ubuntu systems. All Unix-like systems within reason should be supported (other Linuxes, macOS).
Unfortunately #226 needs to be reverted - the starter pack must be usable on non-Ubuntu systems. All Unix-like systems within reason should be supported (other Linuxes, macOS).
Hi @evildmp , would the workaround suggested here be acceptable for now? Instead of completely reverting the PR. https://github.com/canonical/sphinx-docs-starter-pack/issues/232#issuecomment-2126650323
Thanks!
How about running the commands in a container, as a work-around?
I have the feeling we're overengineering this a LOT.
First question: How many projects does that actually affect? I personally didn't even know about the :manpage:
role before https://github.com/canonical/sphinx-docs-starter-pack/issues/224 was raised.
I'm not saying this isn't a useful role, but if this affects one or two of our doc projects only, the solution can be added to custom_conf.py
and doesn't need to go into the starter pack at all.
And if we want it in the starter pack, I think it would actually be better to have a version variable in the configuration. I could imagine doc sets that are released in different versions for different releases, so they would need custom URLs anyway.
Unfortunately #226 needs to be reverted - the starter pack must be usable on non-Ubuntu systems. All Unix-like systems within reason should be supported (other Linuxes, macOS).
To clarify: The basic functionality (building and previewing documentation locally) must be supported on all Unix-like systems. Additional functionality like documentation checks can rely on tools that are not available everywhere (for example, the woke snap) if there is no easily available solution otherwise. This is acceptable because the checks run on GitHub anyway, and while we want to make it possible to run them locally to save time, not being able to do so won't block updating the docs.
I'll open a PR with a suggestion for a fix (moving the manpages URL to custom_conf).
I was approached today that the make file does not work on mac and that there are other non-Ubuntu users who want to work with the starter pack.
The particular issue that failed the make file was my recent change #226, because on mac there is no
apt-get
command and nodistro-info
package.I would like to raise the question with you here: Are non-Ubuntu systems supported?
If the answer is yes: