readthedocs / readthedocs.org

The source code that powers readthedocs.org
https://readthedocs.org/
MIT License
8.05k stars 3.59k forks source link

Add Ability to ask for latest Python 3.X runtime to build docs #7814

Closed cooperlees closed 3 years ago

cooperlees commented 3 years ago

Details

Expected Result

I'd love to be able to change my "Python Interpreter" to be latest 3.x as opposed to the current behavior of the stable version (which happens to be 3.7 it seems)

i.e. I wish to remove the following from my readthedocs.yml:

diff --git a/.readthedocs.yml b/.readthedocs.yml
index f92a6f7..5ca6231 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -16,7 +16,6 @@ formats:
   - epub

 python:
-  version: 3.7
   install:
     - method: pip
       path: .

image

Actual Result

Today if we remove python.version 3.8 we go back to 3.7. I'd rather select to default to latest runtime please.

ericholscher commented 3 years ago

We really don’t want the python version to change when you haven’t specified one, if at all possible. A good, more explicit solution would be to have a “latest“ option, which would do this. I’m not sure we want to support this though, because it will make builds less stable and confuse most users who set it.

cooperlees commented 3 years ago

Totally agree with being explicit. If that didn’t come across I’d love an explicit way to opt into this behavior. I was expecting in the web ui to set that behavior, but love it in the yaml even more!

I prefer the break more forward fix CI life and would rather not have to watch some feed to always update the version once you support it.

stsewd commented 3 years ago

Totally agree with being explicit. If that didn’t come across I’d love an explicit way to opt into this behavior. I was expecting in the web ui to set that behavior, but love it in the yaml even more!

This was possible some time ago, but we changed it, I think this was changed when we introduced python 3.8 to avoid breaking builds. https://github.com/readthedocs/readthedocs.org/pull/6653

From the description of the PR the original plan was to update it to use the latest available version eventually. I think we are good to do that now. @ericholscher what do you think?

ericholscher commented 3 years ago

I think this goes into our larger discussion about how to manage requirements and not break builds. I still think "always build with the same versions of dependencies going forward" is the best default. We can then give users an option to configure another way of handling it (eg. always use the latest version of all dependencies, eg. run pip install -U).

cooperlees commented 3 years ago

My main ask here is that user can choose to stay with latest cpython here automatically once read The Docs deems it ready. I feel pip doc building dependencies should be controlled by Read The Docs code / automation.

My main pain here was I moved https://github.com/pypa/bandersnatch to be >=3.8 only and read the docs failed due to being built with 3.7 to generate the API docs.

stsewd commented 3 years ago

This is now possible with our new config options

https://github.com/readthedocs/readthedocs.org/pull/8453 https://github.com/readthedocs/readthedocs.org/pull/8478/files

Docs to be updated.