Skip to content

Mkdocs builds failing on Python 3.x for Project with Sub-Docs #7374

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

Closed
Breakthrough opened this issue Aug 9, 2020 · 9 comments
Closed

Mkdocs builds failing on Python 3.x for Project with Sub-Docs #7374

Breakthrough opened this issue Aug 9, 2020 · 9 comments

Comments

@Breakthrough
Copy link

Breakthrough commented Aug 9, 2020

Details

For some reason, my Mkdocs project is failing to build on the RTD server using Python 3.x, but works fine with Python 2.x. Locally, I am able to build fine using mkdocs under Python 3.8.

RTD seems to be using Python 3.7.

  • Read the Docs project URL:

https://pyscenedetect.readthedocs.io/en/latest/

https://readthedocs.org/projects/pyscenedetect/

  • Build URL (if applicable):

https://readthedocs.org/projects/pyscenedetect/builds/11627663/
https://readthedocs.org/projects/pyscenedetect/builds/11627858/

  • Read the Docs username (if applicable): Breakthrough

Expected Result

Build should pass. Have executed build locally with latest mkdocs successfully under Python 3.8.3, I get the following output:

$ python -m mkdocs build --clean --site-dir _build/html --config-file mkdocs.yml
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: C:\Users\Breakthrough\Documents\git-repos\PySceneDetect\_build\html
INFO    -  Documentation built in 0.47 seconds

Actual Result

Builds are failing under Python 3.x, but not Python 2.x, with the following error:

Error: `RuntimeError: generator raised StopIteration`

I found mkdocs/mkdocs#1531

@Breakthrough Breakthrough changed the title Mkdocs builds failing on both Python 2.x and 3.x Mkdocs builds failing on Python 3.x Aug 9, 2020
@Breakthrough Breakthrough reopened this Aug 9, 2020
@Breakthrough Breakthrough changed the title Mkdocs builds failing on Python 3.x Mkdocs builds failing on Python 3.x for Project with Sub-Docs Aug 9, 2020
@Breakthrough
Copy link
Author

I'm unfortunately experiencing this again:
https://readthedocs.org/projects/dvr-scan/builds/16028605/

Using same Python version as the server yields the same result. What could there be wrong on my end that might cause this?

@Breakthrough Breakthrough reopened this Feb 9, 2022
@stsewd
Copy link
Member

stsewd commented Feb 9, 2022

@Breakthrough I see two things:

To solve both of those issues, you can use a config file https://docs.readthedocs.io/en/stable/config-file/v2.html and pinning your mkdocs version in your requirements file.

@Breakthrough
Copy link
Author

Hey @stsewd;

Sorry I've changed environments since the original post, I confirmed I was running Python 3.7 locally and on RTD. I also tried adding a config file to see if it resolved the issue, but I still get the same output. To help with further debugging, I created a branch that only changes the Python version from 2.7 -> 3.7 to demonstrate the issue:

Breakthrough/DVR-Scan@e8681fa

And the resulting build output:

https://readthedocs.org/projects/dvr-scan/builds/16040170/

Thanks for the reply, and sorry for some of the confusion there!

@Breakthrough
Copy link
Author

Breakthrough commented Feb 10, 2022

Also I just read that link you provided re: dependencies, and that's a good point, I have mkdocs 1.2.3 locally installed. Is there a way I can tell Readthedocs to use a newer version for Python 3 builds? Sorry I misread your comment, I'll try pinning my dependencies to the same versions and report back. Thanks!

@Breakthrough
Copy link
Author

Breakthrough commented Feb 10, 2022

Building just fine now on RTD once I pin mkdocs to 1.2.3, so I'll make sure to define the requirements explicitly in my .readthedocs.yaml config. Thank you so much for the help @stsewd, and sorry for any confusion there! :)

@Breakthrough
Copy link
Author

Sorry one more question - this approach doesn't seem to be working for another one of my projects that uses subprojects in RTD. I'm able to work around this since the requirements can be specified in the project config from the Web UI, but I'd like to know, is there a way of handling this via .readthedocs.yaml? I couldn't find anything in the docs, wondering if this is supported yet or not.

Thanks!

@humitos
Copy link
Member

humitos commented Feb 14, 2022

I'm able to work around this since the requirements can be specified in the project config from the Web UI, but I'd like to know, is there a way of handling this via .readthedocs.yaml?

Take a look at https://docs.readthedocs.io/en/stable/config-file/v2.html#python. The key you are looking for is python.install.requirements

@Breakthrough
Copy link
Author

Breakthrough commented Feb 14, 2022 via email

@stsewd
Copy link
Member

stsewd commented Feb 14, 2022

@Breakthrough we don't support multiple config files for a repo, but we have an open issue discussing this at #8811.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants