-
Notifications
You must be signed in to change notification settings - Fork 141
Use conda to fetch Node.js for ReadTheDocs #1220
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
Use conda to fetch Node.js for ReadTheDocs #1220
Conversation
Welcome, and thanks for your first contribution here! 👏 It looks like the installation itself works. But then, unfortunately, the build is still run on the system's own node.js. There are some deprecation warnings just before the exception, showing (When you push more commits to this PR, the RTD build should be run again, so you can verify the results yourself.) |
Thanks! I'm guessing RTD spins up a new shell at some point that causes the environment variables to get wiped. I'll have to think about this some more. 🤔 I find it strange that it's not reproducible in the Docker image but I've found mismatches in my day job between what the Docker image does and what RTD does in their pipeline. 🤷 |
Someone mentioned something about Conda/anaconda in an issue on the RTD Docker repo. Maybe that's helpful somehow: |
Sounds good. I'll try to do some more testing without Conda to hopefully make it easier to remove this fix when RTD updates everything. |
Oh yeah, it's finally working! 🎉 From the last commit message:
That bit of hacks is Sorry for all the commits as I worked through this; I can work on squashing them tomorrow. Please checkout the docs from this PR to verify they are working as expected: https://remotestoragejs--1220.org.readthedocs.build/en/1220/ |
ReadTheDocs builds are failing on the main branch due to the need for the latest Node.js. This is a temporary fix by using conda to install a more recent version of Node.js specified in the `environment.yml` file. Even with the Node.js installed by conda, ReadTheDocs does not activate the conda environment, so it does not have immediate access to the new Node.js/npm. Therefore, we have to manipulate the environment variable `PATH` in ``conf.py` to include the directory of the conda `bin` location. Since `sphinx-js` does not use `npx` to run `typedoc`, we have to manually add its location to the `PATH` environment variable as well. By default, the `typedoc` installed to the repository by `npm install` does not have executable permissions, so we have to add them in `conf.py`. Added an auto-update for the copyright. Added a helper script for replicating ReadTheDocs build process. Added documentation on how to replicate ReadTheDocs build process on a local machine.
42e50a5
to
34a08d2
Compare
Fantastic! I followed the new docs about running the RTD build locally in Docker, but getting a Sphinx exception after it having successfully downloaded and installed all the dependencies:
I'm not sure if it needs to be fixed within this PR, as RTD is finally green again, and the docs were built correctly there. Your call, @pjbollinger. |
@raucao Do you mind creating a new issue with a full log of the execution? I'm wondering if the local script needs to be tweaked... Since ReadTheDocs is a check for all PRs, I'd be inclined to merge this and I can address the local issue separately. However, I'm just a drive-by contributor wanting to help out with the CI stuff, so I feel it's more your call than mine. 😅 |
Sure, will do!
Alright, let's do it then. 👍 |
I was checking out this project when I noticed there was issues with ReadTheDocs, so I figured I'd try to provide some assistance. Feel free to use this PR or incorporate it into your existing #1207. Let me know if you have any questions!
ReadTheDocs builds are failing on the main branch due to the need for the latest Node.js. This is a temporary fix by installing a manually specified binary on the documentation building machine.
Locally, this works as expected. When running the Docker container without
update-node-and-npm-without-sudo.sh
results in the same errors found here: https://readthedocs.org/projects/remotestoragejs/builds/13065050/After adding the script to
conf.py
the documentation is able to build normally.Also, I added an auto-update for the copyright.