Skip to content
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

[Bug]: Extension error (sphinx.ext.linkcode) while building docs #24574

Closed
sajjad-ali60 opened this issue Dec 1, 2022 · 6 comments · Fixed by #24592
Closed

[Bug]: Extension error (sphinx.ext.linkcode) while building docs #24574

sajjad-ali60 opened this issue Dec 1, 2022 · 6 comments · Fixed by #24592

Comments

@sajjad-ali60
Copy link

sajjad-ali60 commented Dec 1, 2022

Bug summary

while building documentation the execution throws the below error and exit

Extension error (sphinx.ext.linkcode):
Handler <function doctree_read at 0x0000026E71784700> for event 'doctree-read' threw an exception (exception: path is on mount 'C:', start on mount 'E:')
make: *** [Makefile:39: html] Error 2

here is the log of make html

Code for reproduction

followed the documentation for writing matplotlib docs

Actual outcome

reading sources... [ 47%] api/backend_cairo_api
Extension error (sphinx.ext.linkcode):
Handler <function doctree_read at 0x0000026E71784700> for event 'doctree-read' threw an exception (exception: path is on mount 'C:', start on mount 'E:')
make: *** [Makefile:39: html] Error 2

Expected outcome

it should print successfully build documentation and shows the html files in build/html folder

Additional information

requirements.txt file
gcc version : 12.2.0
clang version : 14.0.6
VC++ compiler tools version : 14.34.31933

Operating system

Windows 10 Pro Version 22H2

Matplotlib Version

3.7.0.dev817+g9b7c902fd72e

Matplotlib Backend

agg

Python version

3.10.8

Jupyter version

not installed

Installation

from source (.tar.gz)

@QuLogic
Copy link
Member

QuLogic commented Dec 1, 2022

You need to run with O=-T to get a full traceback from Sphinx.

@sajjad-ali60
Copy link
Author

sajjad-ali60 commented Dec 1, 2022

You need to run with O=-T to get a full traceback from Sphinx.

here is the traceback from Sphinx with make O=-T html

Building Documentation for Matplotlib: 3.7.0.dev817+g9b7c902fd72e
fatal: not a git repository (or any of the parent directories): .git

Sphinx error:
Builder name O not registered or available through entry point

@story645
Copy link
Member

story645 commented Dec 1, 2022

On windows you gotta do:

 set O=-T & make html

https://matplotlib.org/devdocs/devel/documenting_mpl.html#building-the-docs

@timhoffm timhoffm added the Community support Users in need of help. label Dec 1, 2022
@tacaswell
Copy link
Member

tacaswell commented Dec 2, 2022

That is a pretty unique error message, so I think it is coming from https://github.com/python/cpython/blob/0547a981ae413248b21a6bb0cb62dda7d236fe45/Lib/ntpath.py#L780-L782 which is in relpath. Which suggests that two paths sphinx expected to be relative to each other are on diffrenet drives which (I think) is something you can not express on windows?

Without information about how everything is checked out and installed I am not sure if there is anything do to help and suspect it is unlikely that there is anything we can do in Matplotlib (other than document to not do what ever it is that is causing this situation).

@sajjad-ali60
Copy link
Author

sajjad-ali60 commented Dec 3, 2022

On windows you gotta do:

 set O=-T & make html

https://matplotlib.org/devdocs/devel/documenting_mpl.html#building-the-docs

ok my bad. i saw the documentation there was written just like that.
now here is the traceback from sphinix with set O=-T & make html

@QuLogic QuLogic added Documentation: build and removed Community support Users in need of help. labels Dec 3, 2022
@QuLogic
Copy link
Member

QuLogic commented Dec 3, 2022

You can work around this by setting link_github = True to False in doc/conf.py.

@QuLogic QuLogic added this to the v3.6.3 milestone Dec 3, 2022
QuLogic added a commit to QuLogic/matplotlib that referenced this issue Dec 3, 2022
This may happen if Python is installed on C: and Matplotlib is installed
on some other drive. As the point of this extension is to create GitHub
links for Matplotlib *only*, we should ignore all paths that cannot be
relativized to it.

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

Successfully merging a pull request may close this issue.

5 participants