From 342a748fc58200862b19319ae4e07d3e023febc9 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 9 May 2024 22:22:05 -0400 Subject: [PATCH] docs: fix version import (#191) * docs: fix version import Signed-off-by: Henry Schreiner * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 9745dea..75639f2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,12 +2,12 @@ from __future__ import annotations +import importlib.metadata from datetime import datetime, timezone -from src.pyproject_fmt import __version__ - company, name = "tox-dev", "pyproject-fmt" -release, version = __version__, ".".join(__version__.split(".")[:2]) +release = importlib.metadata.version("pyproject_fmt") +version = ".".join(release.split(".")[:2]) now = datetime.now(tz=timezone.utc) copyright = f"2022-{now.year}, {company}" # noqa: A001 master_doc, source_suffix = "index", ".rst"