diff options
| -rw-r--r-- | PKG-INFO | 27 | ||||
| -rw-r--r-- | debian/changelog | 10 | ||||
| -rw-r--r-- | debian/control | 2 | ||||
| -rw-r--r-- | debian/patches/0002-Mark-tests-needing-internet-access.patch | 4 | ||||
| -rw-r--r-- | docs/src/release_notes.rst | 4 | ||||
| -rw-r--r-- | pyproject.toml | 4 | ||||
| -rw-r--r-- | src/sphinx_codeautolink.egg-info/PKG-INFO | 27 | ||||
| -rw-r--r-- | src/sphinx_codeautolink.egg-info/SOURCES.txt | 1 | ||||
| -rw-r--r-- | src/sphinx_codeautolink/__init__.py | 2 | ||||
| -rw-r--r-- | src/sphinx_codeautolink/extension/__init__.py | 2 | ||||
| -rw-r--r-- | src/sphinx_codeautolink/extension/block.py | 3 | ||||
| -rw-r--r-- | tests/extension/ref/lexer_Python.txt | 13 | ||||
| -rw-r--r-- | tests/extension/src/future_project.py | 2 |
13 files changed, 44 insertions, 57 deletions
@@ -1,31 +1,9 @@ -Metadata-Version: 2.2 +Metadata-Version: 2.4 Name: sphinx-codeautolink -Version: 0.17.4 +Version: 0.17.5 Summary: Automatic links from code examples to reference documentation. Author-email: Felix Hildén <felix.hilden@gmail.com> Maintainer-email: Felix Hildén <felix.hilden@gmail.com> -License: MIT License - - Copyright (c) 2021-2025 Felix Hildén - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - Project-URL: homepage, https://pypi.org/project/sphinx-codeautolink Project-URL: download, https://pypi.org/project/sphinx-codeautolink Project-URL: source, https://github.com/felix-hilden/sphinx-codeautolink @@ -51,6 +29,7 @@ Requires-Dist: sphinx>=3.2.0 Requires-Dist: beautifulsoup4>=4.8.1 Provides-Extra: ipython Requires-Dist: ipython!=8.7.0; extra == "ipython" +Dynamic: license-file sphinx-codeautolink =================== diff --git a/debian/changelog b/debian/changelog index 8bcb4a9..b6433d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +python-sphinx-codeautolink (0.17.5-1) unstable; urgency=medium + + * Team upload. + * New upstream release. + * Bump required python3-setuptools version to 77.0. + * Refresh 0002-Mark-tests-needing-internet-access.patch. + * Upload to unstable. + + -- Dmitry Shachnev <mitya57@debian.org> Sat, 23 Aug 2025 00:15:12 +0300 + python-sphinx-codeautolink (0.17.4-2) experimental; urgency=medium * Team upload. diff --git a/debian/control b/debian/control index ef6781b..ff849c1 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Debian Python Team <team+python@tracker.debian.org> Uploaders: Michael R. Crusoe <crusoe@debian.org> Build-Depends: debhelper-compat (= 13), pybuild-plugin-pyproject, - python3-setuptools, + python3-setuptools (>= 77.0), python3-all, python3-sphinx, python3-bs4, diff --git a/debian/patches/0002-Mark-tests-needing-internet-access.patch b/debian/patches/0002-Mark-tests-needing-internet-access.patch index 48a744b..372d604 100644 --- a/debian/patches/0002-Mark-tests-needing-internet-access.patch +++ b/debian/patches/0002-Mark-tests-needing-internet-access.patch @@ -8,10 +8,10 @@ Forwarded: not-needed 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/extension/__init__.py b/tests/extension/__init__.py -index bf3613c..63784aa 100644 +index 0279bee..eed5007 100644 --- a/tests/extension/__init__.py +++ b/tests/extension/__init__.py -@@ -30,7 +30,13 @@ codeautolink_warn_on_failed_resolve = True +@@ -31,7 +31,13 @@ codeautolink_warn_on_no_backreference = False any_whitespace = re.compile(r"\s*") ref_tests = [(p.name, p) for p in Path(__file__).with_name("ref").glob("*.txt")] diff --git a/docs/src/release_notes.rst b/docs/src/release_notes.rst index ff13835..caf8571 100644 --- a/docs/src/release_notes.rst +++ b/docs/src/release_notes.rst @@ -8,6 +8,10 @@ These release notes are based on sphinx-codeautolink adheres to `Semantic Versioning <https://semver.org>`_. +0.17.5 (2025-07-09) +------------------- +- Add ``Python`` to default lexers (:issue:`194`) + 0.17.4 (2025-03-07) ------------------- - Fix backreference links using relative URIs (:issue:`190`) diff --git a/pyproject.toml b/pyproject.toml index 6e6a8c6..7111bc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] -requires = ["setuptools>=61.0", "wheel"] +requires = ["setuptools>=77.0", "wheel"] build-backend = "setuptools.build_meta" [project] name = "sphinx-codeautolink" description = "Automatic links from code examples to reference documentation." readme = "readme_pypi.rst" -license = {file = "LICENSE"} +license-files = ["LICENSE"] dynamic = ["version"] requires-python = ">=3.10" diff --git a/src/sphinx_codeautolink.egg-info/PKG-INFO b/src/sphinx_codeautolink.egg-info/PKG-INFO index d322883..44ed718 100644 --- a/src/sphinx_codeautolink.egg-info/PKG-INFO +++ b/src/sphinx_codeautolink.egg-info/PKG-INFO @@ -1,31 +1,9 @@ -Metadata-Version: 2.2 +Metadata-Version: 2.4 Name: sphinx-codeautolink -Version: 0.17.4 +Version: 0.17.5 Summary: Automatic links from code examples to reference documentation. Author-email: Felix Hildén <felix.hilden@gmail.com> Maintainer-email: Felix Hildén <felix.hilden@gmail.com> -License: MIT License - - Copyright (c) 2021-2025 Felix Hildén - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - Project-URL: homepage, https://pypi.org/project/sphinx-codeautolink Project-URL: download, https://pypi.org/project/sphinx-codeautolink Project-URL: source, https://github.com/felix-hilden/sphinx-codeautolink @@ -51,6 +29,7 @@ Requires-Dist: sphinx>=3.2.0 Requires-Dist: beautifulsoup4>=4.8.1 Provides-Extra: ipython Requires-Dist: ipython!=8.7.0; extra == "ipython" +Dynamic: license-file sphinx-codeautolink =================== diff --git a/src/sphinx_codeautolink.egg-info/SOURCES.txt b/src/sphinx_codeautolink.egg-info/SOURCES.txt index 6d719fb..9c55018 100644 --- a/src/sphinx_codeautolink.egg-info/SOURCES.txt +++ b/src/sphinx_codeautolink.egg-info/SOURCES.txt @@ -83,6 +83,7 @@ tests/extension/ref/custom_block_imported.txt tests/extension/ref/empty_project.txt tests/extension/ref/inventory_map_is_needed.txt tests/extension/ref/inventory_map_not_needed.txt +tests/extension/ref/lexer_Python.txt tests/extension/ref/lexer_bazel.txt tests/extension/ref/lexer_default.txt tests/extension/ref/lexer_default_fail.txt diff --git a/src/sphinx_codeautolink/__init__.py b/src/sphinx_codeautolink/__init__.py index 46929f0..3dec57a 100644 --- a/src/sphinx_codeautolink/__init__.py +++ b/src/sphinx_codeautolink/__init__.py @@ -8,7 +8,7 @@ from .extension import SphinxCodeAutoLink, backref, directive from .extension.block import clean_ipython, clean_pycon from .extension.translation import MESSAGE_CATALOG_NAME -__version__ = "0.17.4" +__version__ = "0.17.5" def setup(app: Sphinx): diff --git a/src/sphinx_codeautolink/extension/__init__.py b/src/sphinx_codeautolink/extension/__init__.py index f691b2e..80bd611 100644 --- a/src/sphinx_codeautolink/extension/__init__.py +++ b/src/sphinx_codeautolink/extension/__init__.py @@ -52,7 +52,7 @@ def print_exceptions(*, append_source: bool = False): source = doctree["source"] msg = f"in document `{source}`" if e.args: - e.args = (e.args[0] + f" ({msg})",) + e.args[1:] + e.args = (e.args[0] + f" ({msg})", *e.args[1:]) else: e.args = (f"Unexpected error {msg}",) raise diff --git a/src/sphinx_codeautolink/extension/block.py b/src/sphinx_codeautolink/extension/block.py index a1ffc95..233af40 100644 --- a/src/sphinx_codeautolink/extension/block.py +++ b/src/sphinx_codeautolink/extension/block.py @@ -21,6 +21,7 @@ from .directive import ConcatMarker, PrefaceMarker, SkipMarker BUILTIN_BLOCKS = { "default": None, "python": None, + "Python": None, "python3": None, "py": None, "py3": None, @@ -88,7 +89,7 @@ def _exclude_ipython_output(source: str) -> str: def clean_ipython(source: str) -> tuple[str, str]: """Clean up IPython magics and console syntax to pure Python.""" - from IPython.core.inputtransformer2 import TransformerManager + from IPython.core.inputtransformer2 import TransformerManager # noqa: PLC0415 clean = _exclude_ipython_output(source) return source, TransformerManager().transform_cell(clean) diff --git a/tests/extension/ref/lexer_Python.txt b/tests/extension/ref/lexer_Python.txt new file mode 100644 index 0000000..cb52bc0 --- /dev/null +++ b/tests/extension/ref/lexer_Python.txt @@ -0,0 +1,13 @@ +test_project +test_project.bar +# split +# split +Test project +============ + +.. code-block:: Python + + import test_project + test_project.bar() + +.. automodule:: test_project diff --git a/tests/extension/src/future_project.py b/tests/extension/src/future_project.py index fb579e3..4952c09 100644 --- a/tests/extension/src/future_project.py +++ b/tests/extension/src/future_project.py @@ -10,7 +10,7 @@ class Foo: attr: str = "test" -def optional() -> Optional[Foo]: # noqa: UP007 +def optional() -> Optional[Foo]: # noqa: UP045 """Return optional type.""" |
