Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ keywords = ["sphinx", "autodoc", "extension", "documentation"]
urls = {Home = "https://github.com/chrisjsewell/sphinx-autodoc2"}
requires-python = ">=3.8"
dependencies = [
"astroid>=2.7,<4",
"astroid>=2.7,<5",
"tomli; python_version<'3.11'",
"typing-extensions"
]
Expand Down
5 changes: 4 additions & 1 deletion src/autodoc2/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from astroid import nodes
from astroid.builder import AstroidBuilder
from astroid.manager import AstroidManager

from . import astroid_utils

Expand All @@ -38,7 +39,9 @@ def analyse_module(
you can use this to record them.
"""
# TODO expose record_external_imports everywhere analyse_module is used
node = AstroidBuilder().file_build(os.fsdecode(file_path), name)
node = AstroidBuilder(manager=AstroidManager()).file_build(
os.fsdecode(file_path), name
)
yield from walk_node(
node, State(node.name.split(".", 1)[0], [], exclude_external_imports)
)
Expand Down