-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Readthedoc feature #15
Conversation
I want to add this... seems like it is necessary to add the .readthedocs.yaml file, and that is enough(?) @redeboer |
Fancy! Not sure if RTD is really needed. Usually it is used for packages that need versioning (so a page per version, e.g. https://qrules.rtfd.io/0.10.1). Another benefit is PR previews. If you don't need those, GitHub Pages suffices. (GH has the benefit that it can cache e.g. notebook results and sympy caches.) |
But let's discuss tomorrow, there is something to say for using RTD ✨ |
Yup actually I wanna have PR preview, that's why I wanna add it :) |
OK, now I understand. Maybe "rtd" is not necessarily appropriate here, but I'll decide later and make this work first. Seems like it is Okish |
Have a look at the log output. The config is looking for |
Interestingly... I see at some point the readthedoc is okay but the Github pages failed :( |
Man.... Finally now in this version both the GitHub documentation and RTD are working :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
There are some files that seem redundant to me, have a look at the comments ;)
docs/requirements.txt
Outdated
@@ -0,0 +1,4 @@ | |||
linkify-it-py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this duplication of dependencies. Indeed RTD by default expects dependencies to be defined through pip requiremente files, but you can define custom build steps. In this case to specify you want to run pixi shell
before the build process. Have a look at e.g. https://github.com/ComPWA/ampform for how a custom build (in that case with pip constraint files) looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... right now kinda stuck in here 🐥
pyproject.toml
Outdated
@@ -0,0 +1,8 @@ | |||
[build-system] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this required by rtd? If so, I would convert pixi.toml
to pyproject.toml
https://pixi.sh/latest/advanced/pyproject_toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed and it works.
.readthedocs.yaml
Outdated
post_install: | ||
- curl -fsSL https://pixi.sh/install.sh | bash | ||
- export PATH="$HOME/.pixi/bin:$PATH" && pixi install | ||
- pixi shell -c "pixi install && sphinx-build -T -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, RTD runs its own sphinx-build
command (hence pre_build
, post_build
, not build itself). So just running pixi shell
should suffice 🤞 If it doesn't, this may be a more tricky issue to solve...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw pixi install
is not needed, at most pixi shell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, RTD runs its own
sphinx-build
command (hencepre_build
,post_build
, not build itself). So just runningpixi shell
should suffice 🤞 If it doesn't, this may be a more tricky issue to solve...
Seems like it doesn't, maybe tricky? What if the pixi shell
an interactive shell which is not supported in the ReadTheDocs environment, maybe?
e.g. this issue in RTD build indicates that it probably can't start an interactive shell there:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build-docs.sh
Outdated
@@ -0,0 +1,3 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file can be removed, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup originally just testing
pixi.toml
Outdated
myst-nb = ">=1.1.0,<1.2" | ||
myst-parser = ">=3.0.1,<3.1" | ||
nbsphinx = ">=0.9.4,<0.10" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use myst-nb
instead of nbsphinx
(that's a different notebook renderer). That also removes the need for myst-parser
, maybe also that linkify-md thing, because those are indirect dependencies of myst-nb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, why are dependency changes required in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added them when I added RTD from their example
pixi.toml
Outdated
sphinx-autobuild = ">=2024.4.16,<2024.5" | ||
sphinx_rtd_theme = ">=2.0.0,<2.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you selecting that in conf.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I have
docs/index.md
Outdated
|
||
Investigation of the N\* Resonances in the GlueX Experiment | ||
|
||
> **Note:** This project is under active development. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a MyST admonition here
docs/conf.py
Outdated
"sphinx.ext.napoleon", | ||
"sphinx.ext.viewcode", | ||
] | ||
html_theme = "sphinx_rtd_theme" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This theme change is not required on RTD. Also works with what you had before.
Hmm seems that this is a bit more complicated then expected. I think the best way forward is to convert pixi.toml to pyproject.toml, so that the dependencies can be installed through |
@shenvitor check this new |
This comment has been minimized.
This comment has been minimized.
I think you can replace the entire Forget the last line with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
Make it now have both GitHub documentation and RTD build