-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow setting open build env vars in .readthedocs.yml
config file
#6311
Comments
.readthedocs.yml
config file
Other use case: installing packages from custom public indices via $ curl $PIP_FIND_LINKS
<a href="my_special_use_pkg-0.4-py3-none-any.whl">my-special-use-pkg</a> |
Though we have this functionality in our UI, this seems like a great feature for our config file. This is handy for non-secret environment variables, as noted, but also for helping increase the odds of a build being reproducible without extra project configuration. I raised issues with the scope of environment variables defined in our configuration through |
Yes. I think this feature makes sense and can work well together with |
Great! This seems like a great feature to add, I'm putting this on our 2022Q2 roadmap 👍 |
I lied, we didn't get to this in 2022. I'm going to keep this on the backlog for now. |
Also just a note, I think you can probably hack this with something like:
No guarantee it continues to work though 🙃 |
@ericholscher I tested your idea, but it seems it doesn't work as expected 😞 . I quickly tested this at https://readthedocs.org/projects/test-builds/builds/18714592/ I suppose it's because each command is executed with readthedocs.org/readthedocs/doc_builder/environments.py Lines 374 to 379 in fba1428
|
sh only evaluates |
@agjohnson would it be safe to pass |
That is a really good question! I don't know for certain here, it would be worth a test. Executing in a login shell would open the door to using direnv, which I might suggest over a solution like ☝️ It's also possible to author a local |
This is issue is kind of related to #10462. We should consider that case when working on this idea. |
FWIW, I was just looking for this feature. I was trying to set |
@pllim you can define the environment variables for the project in the meanwhile. Read more at https://docs.readthedocs.io/en/stable/environment-variables.html |
Details
Expected Result
I want to be able to set public env vars via
.readthedocs.yml
.Actual Result
I can only do this in the web UI.
Use-case
I have an in-tree Sphinx extension and import paths are set up via
tox
. Since RTD doesn't allow specifying a custom build tool and has a hardcoded command, I had to seek another way of making it importable. I've chosen to set aPYTHONPATH
variable to address this. But I'd prefer an explicit way of doing it.Bonus thoughts
Setting "special" env vars may conflict with RTD's special values. It may be a good idea to enable first-class support for adding custom import location as a YAML sequence in the config and then properly merging it with the existing
PYTHONPATH
.The text was updated successfully, but these errors were encountered: