diff --git a/.readthedocs.yml b/.readthedocs.yml index 6622742e..afe7ba03 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,6 +10,7 @@ sphinx: python: install: + - path: . - requirements: docs/requirements.txt formats: diff --git a/docs/conf.py b/docs/conf.py index 9f48a537..2f51dbd3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,26 +27,19 @@ # # needs_sphinx = '1.0' -import pathlib +import importlib.metadata import re -_docs_path = pathlib.Path(__file__).parent -_version_path = _docs_path / '../aiobotocore/__init__.py' - - -with _version_path.open() as fp: - try: - _version_info = re.search( - r"^__version__ = '" - r"(?P\d+)" - r"\.(?P\d+)" - r"\.(?P\d+)" - r"(?P.*)?'$", - fp.read(), - re.M, - ).groupdict() - except IndexError: - raise RuntimeError('Unable to determine version.') +try: + _version_info = re.fullmatch( + r"(?P\d+)" + r"\.(?P\d+)" + r"\.(?P\d+)" + r"(?P.*)?", + importlib.metadata.version('aiobotocore'), + ).groupdict() +except IndexError: + raise RuntimeError('Unable to determine version.') # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom diff --git a/pyproject.toml b/pyproject.toml index 63cefb4d..06b69c0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ boto3 = [ [project.urls] Repository = "https://github.com/aio-libs/aiobotocore" -Documentation = "https://aiobotocore.readthedocs.io" +Documentation = "https://aiobotocore.aio-libs.org" [tool.setuptools.dynamic] version = { attr = "aiobotocore.__version__" }