-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Some warnings contain non-existing paths #9481
Comments
Hmm... it's strange.
Unfortunately, I can't reproduce the error with the reported procedure.
Could you check the procedure please? It would be nice if you create a minimal reproducible example :-) |
Right, I'm finding other problems with sktime now, and in any case the project is too big. I'll try to send a smaller reproducer. |
Hah, the problem I'm having is #7989 again :) I think I'll focus on that one first. |
Here is a simple reproducer: https://github.com/astrojuanlu/sphinx-autosummary-tracebacks/tree/weird-paths (.venv) $ pip install -r requirements.txt
(.venv) $ python -c "from test_pkg import A; print(A)"
<class 'test_pkg.A'>
(.venv) $ make html
Running Sphinx v4.1.1
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [config changed ('autosummary_generate')] 2 added, 0 changed, 0 removed
reading sources... [100%] index
/home/juanlu/Projects/RTD/tmp/sphinx-autosummary-tracebacks/source/index.rst.rst:13: WARNING: autosummary: stub file not found 'test_pkg.A'. Check your autosummary_generate setting.
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/juanlu/Projects/RTD/tmp/sphinx-autosummary-tracebacks/source/autogen/test_pkg.A.rst: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 2 warnings.
The HTML pages are in build/html.
(.venv) $ python -m sphinx -W -b html source/ build/html
Running Sphinx v4.1.1
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [100%] index
Warning, treated as error:
/home/juanlu/Projects/RTD/tmp/sphinx-autosummary-tracebacks/source/index.rst.rst:13:autosummary: stub file not found 'test_pkg.A'. Check your autosummary_generate setting. |
…filenames `SphinxDirective.get_source_info()` returns the pair of fullpath of source and current line number. But our logging module expects one of these: * A string consists of fullpath and current line number * A pair of docname and current line number To show correct location for warnings, this adds `get_location()` method that returns the former one. Note: This also modifies C/C++ domains.
Fix #9481: autosummary: some warnings contain non-existing filenames
Describe the bug
While investigating sktime/sktime#1181, I noticed that the warnings (turned into errors) contained some weird paths:
Rather than
/home/juanlu/Projects/RTD/tmp/sktime/docs/source/source/api_reference/classification.rst.rst
, it should say/home/juanlu/Projects/RTD/tmp/sktime/docs/source/api_reference/classification.rst
(notice the extrasource/
segment and extra.rst
extension).After some debugging, I traced it to this function call:
happening in these lines:
sphinx/sphinx/util/logging.py
Lines 487 to 490 in f9941b9
How to Reproduce
Expected behavior
The error should contain an actual path, in this case
/home/juanlu/Projects/RTD/tmp/sktime/docs/source/api_reference/classification.rst
.Your project
https://github.com/alan-turing-institute/sktime
Screenshots
No response
OS
Linux
Python version
3.7
Sphinx version
3.2.1
Sphinx extensions
sphinx.ext.autodoc, sphinx.ext.autosummary, others
Extra tools
No response
Additional context
sktime/sktime#1181
The text was updated successfully, but these errors were encountered: