From 1e7c145f1bd4446e5eafe776e32604bf052dcc2f Mon Sep 17 00:00:00 2001 From: A5rocks Date: Thu, 30 Jan 2025 08:49:54 +0900 Subject: [PATCH 1/2] Install trio in RTD and use importlib.metadata.version --- .readthedocs.yml | 1 + docs/source/conf.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 0604945f9..8b1cff2d5 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -13,6 +13,7 @@ build: python: install: - requirements: docs-requirements.txt + - path: . sphinx: fail_on_warning: true diff --git a/docs/source/conf.py b/docs/source/conf.py index fb8e60cdc..275aee0a5 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -315,9 +315,9 @@ def add_mapping( # built documents. # # The short X.Y version. -import trio +import importlib.metadata -version = trio.__version__ +version = importlib.metadata.version("trio") # The full version, including alpha/beta/rc tags. release = version From ad2d1016d7978644ee3ea5163f55a01d2c6cb008 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Thu, 30 Jan 2025 08:52:15 +0900 Subject: [PATCH 2/2] Try to remove a sys.path update --- docs/source/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 275aee0a5..5d30ec225 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,8 +31,6 @@ # For our local_customization module sys.path.insert(0, os.path.abspath(".")) -# For trio itself -sys.path.insert(0, os.path.abspath("../../src")) # Enable reloading with `typing.TYPE_CHECKING` being True os.environ["SPHINX_AUTODOC_RELOAD_MODULES"] = "1"