summaryrefslogtreecommitdiff
path: root/sphinx/util
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fix issue with warnings without subtype being incorrectly suppressedSteven Hiscocks2021-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | This fixes an issue with warnings that have been raised with no subtype being suppressed if a suppress warnings value with a subtype has been set. e.g. all `autodoc` warnings should not be suppressed if `autodoc.import_object` is only set to be suppressed.
* | | Merge pull request #9772 from gibsondan/loggingflushTakeshi KOMIYA2021-10-311-0/+5
|\ \ \ | | | | | | | | Closes #9733: Fix for logging handler flushing warnings in the middle of the docs build
| * | | Closes #9733: Fix for logging handler flushing warnings in the middle of the ↵gibsondan2021-10-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build Summary: My project was mysteriously dropping warnings (see https://github.com/sphinx-doc/sphinx/issues/9733 for detailed repro) and I realized that it's becaues it imports libraries like airflow or mlflow that set up loggers automatically when they are imported. This causes this handler to flush even though shouldFlush is set to always return False. A simple workaround is to override flush to be a no-op. Test Plan: Repeat repro steps from #9733 - project now always includes warnings
* | | | Fix #9757: autodoc_inherit_docstrings does not effect to overriden classmethodsTakeshi KOMIYA2021-10-301-1/+3
| |_|/ |/| |
* | | Merge branch '4.x' into 9756_classmethod_not_having_funcTakeshi KOMIYA2021-10-272-3/+3
|\ \ \
| * | | Support docutils-0.18: Consume iterator of Element.traverse()Takeshi KOMIYA2021-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 0.18, Element.traverse() returns an iterator instead of intermediate object. As a result, the return value is always considered as truthy value. And it becomes fragile when the caller modifies the doctree on the loop.
| * | | Make util.typing.restify sanitise unreproducible output (eg. memory addresses)Chris Lamb2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whilst working on the Reproducible Builds effort [0] I noticed that sphinx generates output that is not reproducible, causing a number of packages in Debian to unreproducible. Specifically, when Sphinx locates an alias of an instance when generating 'autodoc' documentation, it uses the raw Python repr(...) of the object and does not sanitise it for memory addresses (etc.) like elsewhere in Sphinx. This can result in documentation like this: -<dd><p>alias of &lt;webob.client.SendRequest object at 0x7fd769189df0&gt;</p> +<dd><p>alias of &lt;webob.client.SendRequest object at 0x7f0f02233df0&gt;</p> Patch attached that uses the object_description method, which was added to fix precisely this kind of issue. I originally filed this in Debian as bug #996948 [1]. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/996948
* | | | Fix #9756: autodoc: Crashed if classmethod does not have __func__ attributeTakeshi KOMIYA2021-10-231-1/+1
|/ / /
* | | Merge branch '4.x' into 9607_incorrect_orig_basesTakeshi KOMIYA2021-09-271-0/+2
|\ \ \
| * | | Close #9664: autodoc: autodoc-process-bases supports reST snippetTakeshi KOMIYA2021-09-231-0/+2
| | |/ | |/| | | | | | | | | | | | | This allows to inject a reST snippet through autodoc-process-bases event. It helps to modify the base classes of any class to the expected mark-up'ed text by custom extension.
* | | Fix #9607: autodoc: Incorrect base class detectionTakeshi KOMIYA2021-09-201-0/+15
|/ / | | | | | | | | | | | | | | | | In case of the descendants of generic class, the value of obj.__orig_bases__ is incorrect because it returns original base arguments for the child of the generic class instead of the target class itself. This uses obj.__dict__ to get the correct __orig_bases__ information.
* | Merge pull request #9640 from tk0miya/9639_support_asyncgenfunctionTakeshi KOMIYA2021-09-181-1/+2
|\ \ | | | | | | Close #9639: autodoc: Support asynchronous generator functions
| * | Close #9639: autodoc: Support asynchronous generator functionsTakeshi KOMIYA2021-09-171-1/+2
| |/
* | Fix #9630: autodoc: Failed to build xrefs if primary_domain is not 'py'Takeshi KOMIYA2021-09-141-34/+34
|/ | | | | | | | Autodoc generates reST code that uses raw `:obj:` and `:class:` xrefs to refer the classes and types. But they're fragile because they assume the primary_domain=='py'. This adds `:py:` prefix to these xrefs to make them robust.
* Merge pull request #9611 from tk0miya/9560_NewType_moduleTakeshi KOMIYA2021-09-111-3/+11
|\ | | | | Close #9560: autodoc: Allow to refer NewType with modname in py310+
| * Close #9560: autodoc: Allow to refer NewType with modname in py310+Takeshi KOMIYA2021-09-051-3/+11
| | | | | | | | | | | | Before 3.10, an instance of NewType has incorrect module name. But it was fixed on 3.10. This starts to use the module info if the interpreter is 3.10+.
* | Fix typos discovered by codespellChristian Clauss2021-09-084-5/+5
|/
* Merge branch '4.x' into 9564-fix_highlighted_code_role_smartquotesTakeshi KOMIYA2021-08-291-0/+2
|\
| * Merge pull request #9590 from tk0miya/9589_AnnotatedTakeshi KOMIYA2021-08-291-0/+2
| |\ | | | | | | Fix #9589: autodoc: typing.Annotated has wrongly been rendered
| | * Fix #9589: autodoc: typing.Annotated has wrongly been renderedTakeshi KOMIYA2021-08-291-0/+2
| | | | | | | | | | | | | | | At the HEAD of 3.10, the implementation of `typing.Annotated` has been changed to have __qualname__.
* | | Check complete ancestry of text nodes for smartquotes eligibility.Justin Turner Arthur2021-08-211-7/+9
|/ / | | | | | | Fixes sphinx-doc/sphinx#9564.
* | Merge pull request #9530 from tacaswell/fix_numpy_class_attributeTakeshi KOMIYA2021-08-111-2/+3
|\ \ | | | | | | FIX: do not try to compute the boolean value of a numpy array
| * | FIX: do not try to compute the boolean value of a numpy arrayThomas A Caswell2021-08-061-2/+3
| | | | | | | | | | | | | | | If there is a numpy array as a class attribute, then `bool(meth)` will raise.
* | | Merge branch '4.1.x' into 4.xTakeshi KOMIYA2021-08-111-8/+6
|\ \ \ | |/ / |/| / | |/
| * Fix #9537: autodoc: Some typing.* objects are brokenTakeshi KOMIYA2021-08-111-2/+4
| | | | | | | | | | At the HEAD of 3.10, the implementation of `typing._GenericAlias` has been changed to have correct _name and __name__.
| * Fix #9504: autodoc: generate incorrect reference to the parent classTakeshi KOMIYA2021-07-311-6/+2
| | | | | | | | | | | | | | | | | | Autodoc generates incorrect references to the parent class the target class inherites the class having `_name` attribute. It conciders the parent is a kind of SpecialForm'ed class by mistake. This uses `isinstance(X, SpecialForm)` to check that. Note: SpecialForm became a class since Python 3.7.
| * Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10Takeshi KOMIYA2021-07-301-6/+6
| | | | | | | | | | | | Recently, `types.Union` was renamed to `types.UnionType` on the HEAD of 3.10 (refs: python/cpython#27342). After this change, sphinx-build has been crashed because of ImportError.
* | Merge branch '4.x' into 4.xJames2021-08-0210-38/+65
|\ \
| * \ Merge branch '4.x' into bugfix/get-type-hintsyanyongyu2021-07-301-6/+6
| |\ \
| | * \ Merge pull request #9513 from tk0miya/9512_types.UnionTypesTakeshi KOMIYA2021-07-301-6/+6
| | |\ \ | | | | | | | | | | Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10
| | | * | Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10Takeshi KOMIYA2021-07-301-6/+6
| | | |/ | | | | | | | | | | | | | | | | | | | | Recently, `types.Union` was renamed to `types.UnionType` on the HEAD of 3.10 (refs: python/cpython#27342). After this change, sphinx-build has been crashed because of ImportError.
| * | | Fix uncatched exception in get type hintsyanyongyu2021-07-291-0/+3
| |/ /
| * | Fix #9481: autosummary: some warnings contain non-existing filenamesTakeshi KOMIYA2021-07-252-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
| * | Merge branch 'sphinx-doc:4.x' into 4.xLouis Maddox2021-07-232-11/+14
| |\ \
| | * \ Merge branch '4.1.x' into 4.xTakeshi KOMIYA2021-07-232-11/+14
| | |\ \ | | | |/
| | | * Fix #9490: autodoc: Some typing.* objects are brokenTakeshi KOMIYA2021-07-231-6/+6
| | | | | | | | | | | | | | | | | | | | At the HEAD of 3.10, the implementation of `typing._SpecialForm` and `typing._BaseGenericAlias` has been changed to support __qualname__.
| | | * Fix #9489: autodoc: Custom types using typing.NewType are brokenTakeshi KOMIYA2021-07-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | At the HEAD of 3.10, the implementation of ``typing.NewType`` has been changed to the class based. To follow the change, this uses ``isinstance`` on ``sphinx.util.inspect:isNewType()`.
| * | | Merge branch 'sphinx-doc:4.x' into 4.xLouis Maddox2021-07-192-2/+16
| |\ \ \ | | |/ /
| | * | Merge pull request #9464 from Gobot1234/4.xTakeshi KOMIYA2021-07-201-1/+4
| | |\ \ | | | | | | | | | | Add support for PEP 585 generics
| | * | | Close #9445: autodoc: Support class propertiesTakeshi KOMIYA2021-07-171-1/+12
| | | |/ | | |/| | | | | | | | | | | | | Since python 3.9, `classmethod` starts to support creating a "class property". This supports to generate document for it.
| * | | Improve sphinx.util.nodes docstringsLouis Maddox2021-07-181-5/+5
| | | |
| * | | Improve sphinx.util.matching docstringsLouis Maddox2021-07-181-2/+4
| | | |
| * | | Improve sphinx.util.logging docstringsLouis Maddox2021-07-181-8/+8
| | | |
| * | | Docstring improvement to sphinx.util.inventoryLouis Maddox2021-07-181-1/+1
| | | |
| * | | Improve sphinx.util.console docstringLouis Maddox2021-07-181-1/+1
| | | |
| * | | Improve sphinx.util docstringsLouis Maddox2021-07-181-2/+2
| |/ /
* | | Appease linterJames2021-08-011-1/+4
| | |
* | | Match formatting of other recursive typesJames2021-08-011-1/+1
| | |
* | | Recursively resolve PEP 585 builtinsJames2021-08-011-1/+4
| |/ |/|
* | Respond to feedbackJames2021-07-181-1/+2
| |