Skip to content

Commit 3b94a1a

Browse files
authored
Merge pull request #3194 from A5rocks/use-importlib-metadata-for-docs
Use importlib.metadata in docs build
2 parents d7cb2fc + ad2d101 commit 3b94a1a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.readthedocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ build:
1313
python:
1414
install:
1515
- requirements: docs-requirements.txt
16+
- path: .
1617

1718
sphinx:
1819
fail_on_warning: true

docs/source/conf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
# For our local_customization module
3333
sys.path.insert(0, os.path.abspath("."))
34-
# For trio itself
35-
sys.path.insert(0, os.path.abspath("../../src"))
3634

3735
# Enable reloading with `typing.TYPE_CHECKING` being True
3836
os.environ["SPHINX_AUTODOC_RELOAD_MODULES"] = "1"
@@ -315,9 +313,9 @@ def add_mapping(
315313
# built documents.
316314
#
317315
# The short X.Y version.
318-
import trio
316+
import importlib.metadata
319317

320-
version = trio.__version__
318+
version = importlib.metadata.version("trio")
321319
# The full version, including alpha/beta/rc tags.
322320
release = version
323321

0 commit comments

Comments
 (0)