-
Notifications
You must be signed in to change notification settings - Fork 326
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
update ReadTheDocs settings file #2083
base: main
Are you sure you want to change the base?
Conversation
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.
note also the filename changed from readthedocs.yml
to .readthedocs.yaml
, as the RTD interface says that this is the only allowed filename (?! makes me wonder if our existing settings file is even being read?)
formats: | ||
- htmlzip | ||
|
||
# build with latest available ubuntu version | ||
build: | ||
os: ubuntu-20.04 | ||
os: ubuntu-lts-latest |
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 just seems like common sense
tools: | ||
python: "3.10" | ||
python: "3.12" |
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.
ditto, no reason to build on an old Py version
sphinx: | ||
configuration: docs/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.
this bit is now required, and our builds will start failing in January without it.
path: . | ||
extra_requirements: | ||
- doc |
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 is the recommended way to do what we were doing before with path: .[doc]
.readthedocs.yaml
Outdated
sphinx: | ||
configuration: docs/conf.py | ||
# builder: "dirhtml" | ||
fail_on_warning: true |
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 is good practice but will probably not work for us, given the long list of "expected" warnings that our build produces. 🤔 maybe we should revisit how we handle that, e.g., using a nitpick_ignore
in conf.py
instead of writing warnings to file and using a post-build script to check them against our "expected warnings" lists. Let's see what happens.
hmm, hitting
which wasn't happening before, e.g. on recent build https://readthedocs.org/projects/pydata-sphinx-theme/builds/26618254/ I wonder if it's due to the Ubuntu version bump? Will investigate. |
Co-authored-by: Tania Allard <taniar.allard@gmail.com>
.readthedocs.yaml
Outdated
apt_packages: | ||
- graphviz | ||
jobs: | ||
# build the gallery of themes before building the doc | ||
post_install: | ||
- pip install playwright | ||
- playwright install chromium | ||
- sudo playwright install --with-deps chromium |
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.
argh, without sudo
we get a password error:
Switching to root user to install dependencies...
Password: su: Authentication failure
Failed to install browsers
but with sudo
it fails as
/bin/sh: 1: sudo: not found
searching RTD docs for "sudo" is a dead end. Anyone with more RTD config experience want to help me out here?
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 remember using playwright
some time ago in Read the Docs and I installed the dependencies using build.apt_packages
and without using --with-deps
in this command.
Example:
version: 2
# ... other configs
build:
apt_packages:
- libasound2
- libdbus-glib-1-2
jobs:
post_install:
- pip install playwright
- playwright install chromium
It may require a small change, but this is what I remember. If that works for you, we should probably document this approach. Let me know if it works.
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.
thanks for the suggestion. Unfortunately I don't know what to add to apt_packages
because playwright doesn't actually tell us which dependencies are missing:
║ Host system is missing dependencies to run browsers. ║
║ Please install them with the following command: ║
║ ║
║ sudo playwright install-deps
That error wasn't happening prior to this PR so might be a result of the ubuntu version bump (?) but regardless, playwright's install-deps
subcommand is expressly meant for CI usage so it seems a shame to reverse-engineer it here. Is there no way to get sudo
on a post_install
job?
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 know what to add to
apt_packages
because playwright
Have you tried using the dependencies I put in my example?
it seems a shame to reverse-engineer it here
It's not reverse-engineer, it's installing the dependencies required by playwright in an environment without sudo
capabilities.
Is there no way to get
sudo
on apost_install
job?
No, sudo is not available on Read the Docs builders.
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.
ah, sorry! I misunderstood, I didn't realize libasound and libdbus were the actual playwright dependencies (thought it was a generic example demoing apt_packages
). I will try that.
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.
that fixed it! Thanks @humitos and sorry for the misunderstanding before.
This reverts commit 90a5322.
@humitos we've started hitting the rolling doc build fails, and haven't yet managed to get the config changes to work for us. In particular we can't seem to get playwright to install correctly anymore: #2083 (comment) |
This reverts commit 071317b.
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.
@trallard CIs are all green here, this is ready for another look.
nitpicky = True | ||
bad_classes = ( | ||
r".*abc def.*", # urllib.parse.unquote_to_bytes | ||
r"api_sample\.RandomNumberGenerator", | ||
r"bs4\.BeautifulSoup", | ||
r"docutils\.nodes\.Node", | ||
r"matplotlib\.artist\.Artist", # matplotlib xrefs are in the class diagram demo | ||
r"matplotlib\.figure\.Figure", | ||
r"matplotlib\.figure\.FigureBase", | ||
r"pygments\.formatters\.HtmlFormatter", | ||
) | ||
nitpick_ignore_regex = [ | ||
*[("py:class", target) for target in bad_classes], | ||
# we demo some `urllib` docs on our site; don't care that its xrefs fail to resolve | ||
("py:obj", r"urllib\.parse\.(Defrag|Parse|Split)Result(Bytes)?\.(count|index)"), | ||
# the kitchen sink pages include some intentional errors | ||
("token", r"(suite|expression|target)"), | ||
] |
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 captures all of the unavoidable "reference target not found" warnings that sphinx generates when nitpicky
is turned on. Now, if a new bad cross-ref gets introduced, it will show up as a warning, and cause our post-build warnings checker function to fail.
(even with this, there are still ~15 warnings that are always generated, but they're not sphinx xref errors, so can't be dealt with by the nitpicky
system. cf. tests/warning_list.txt
)
warning_file = Path(__file__).parents[1] / "warning_list.txt" | ||
extra_warning_file = Path(__file__).parents[1] / "intermittent_warning_list.txt" |
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.
unrelated simplification, noticed in passing
@@ -108,7 +108,7 @@ extras = {[testenv:docs-no-checks]extras} | |||
deps = | |||
py39-sphinx61-docs: sphinx~=6.1.0 | |||
commands = | |||
sphinx-build -b html docs/ docs/_build/html -v -w warnings.txt {posargs} | |||
sphinx-build -b html docs/ docs/_build/html -nTv -w warnings.txt {posargs} |
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.
-n
forces nitpicky mode. Not strictly necessary, since we set nitpicky=True
in conf.py
now
-T
show full traceback on error.
ReadTheDocs is making some changes that affect us. Will leave self-review to explain the changes.
closes #2101