Skip to content

Commit

Permalink
Merge branch 'master' into 623-better-constant-kind
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlatr authored Sep 8, 2023
2 parents 5166081 + 44a1a39 commit 52d866d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
tox -e test
- name: Run unit tests with latest Twisted version
if: matrix.python-version != '3.6' && matrix.python-version != 'pypy-3.6'
if: matrix.python-version != '3.7' && matrix.python-version != '3.6' && matrix.python-version != 'pypy-3.6'
run: |
tox -e test-latest-twisted
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ in development
* Improve the class hierarchy such that it links top level names with intersphinx when possible.
* Add highlighting when clicking on "View In Hierarchy" link from class page.
* Recognize variadic generics type variables (PEP 646).
* Fix support for introspection of cython3 generated modules.

pydoctor 23.4.1
^^^^^^^^^^^^^^^
Expand Down
7 changes: 5 additions & 2 deletions pydoctor/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,11 @@ def _introspectThing(self, thing: object, parent: CanContainImportsDocumentable,
for k, v in thing.__dict__.items():
if (isinstance(v, func_types)
# In PyPy 7.3.1, functions from extensions are not
# instances of the abstract types in func_types
or (hasattr(v, "__class__") and v.__class__.__name__ == 'builtin_function_or_method')):
# instances of the abstract types in func_types, it will have the type 'builtin_function_or_method'.
# Additionnaly cython3 produces function of type 'cython_function_or_method',
# so se use a heuristic on the class name as a fall back detection.
or (hasattr(v, "__class__") and
v.__class__.__name__.endswith('function_or_method'))):
f = self.Function(self, k, parent)
f.parentMod = parentMod
f.docstring = v.__doc__
Expand Down
4 changes: 2 additions & 2 deletions pydoctor/sphinx_ext/build_apidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def on_build_finished(app: Sphinx, exception: Exception) -> None:

runs = app.config.pydoctor_args
placeholders = {
'outdir': app.outdir,
'outdir': str(app.outdir),
}

if not isinstance(runs, Mapping):
Expand Down Expand Up @@ -86,7 +86,7 @@ def on_builder_inited(app: Sphinx) -> None:
raise ConfigError("Missing 'pydoctor_args'.")

placeholders = {
'outdir': app.outdir,
'outdir': str(app.outdir),
}

runs = config.pydoctor_args
Expand Down
5 changes: 2 additions & 3 deletions pydoctor/templatewriter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Render pydoctor data as HTML."""
from typing import Any, Iterable, Iterator, Optional, Union, cast, TYPE_CHECKING
from typing import Any, Iterable, Iterator, Optional, Union, TYPE_CHECKING
if TYPE_CHECKING:
from typing_extensions import Protocol, runtime_checkable
else:
Expand Down Expand Up @@ -38,8 +38,7 @@ def parse_xml(text: str) -> minidom.Document:
Create a L{minidom} representaton of the XML string.
"""
try:
# TODO: submit a PR to typeshed to add a return type for parseString()
return cast(minidom.Document, minidom.parseString(text))
return minidom.parseString(text)
except Exception as e:
raise ValueError(f"Failed to parse template as XML: {e}") from e

Expand Down
2 changes: 1 addition & 1 deletion pydoctor/test/test_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_generate_empty_functional() -> None:
@contextmanager
def openFileForWriting(path: str) -> Iterator[io.BytesIO]:
yield output
inv_writer._openFileForWriting = openFileForWriting # type: ignore[assignment]
inv_writer._openFileForWriting = openFileForWriting # type: ignore

inv_writer.generate(subjects=[], basepath='base-path')

Expand Down
7 changes: 5 additions & 2 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ version: 2
sphinx:
fail_on_warning: false

build:
os: ubuntu-22.04
tools:
python: "3.11"

python:
version: 3.8
system_packages: false
install:
- method: pip
path: .
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ test =
coverage
pytest
hypothesis
cython-test-exception-raiser==1.0.0
cython-test-exception-raiser
bs4
Sphinx>=3.5
Sphinx<7.0.0
pytest-subtests

[options.entry_points]
Expand Down

0 comments on commit 52d866d

Please sign in to comment.