Skip to content

Commit

Permalink
Merge pull request #756 from kurtmckee/fix-docs
Browse files Browse the repository at this point in the history
Match how Read the Docs builds the documentation
  • Loading branch information
kurtmckee authored Sep 6, 2024
2 parents 7f272de + 391dc52 commit ec84969
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
import importlib.metadata
import pathlib


def get_version() -> str:
path = pathlib.Path(__file__).parent.parent / "sqlalchemy_utils/__init__.py"
content = path.read_text()
for line in content.splitlines():
if line.strip().startswith("__version__"):
_, _, version_ = line.partition("=")
return version_.strip("'\" ")


# -- General configuration -----------------------------------------------------

Expand All @@ -24,7 +34,7 @@
project = "SQLAlchemy-Utils"
copyright = "2013-2022, Konsta Vesterinen"

version = importlib.metadata.version("sqlalchemy_utils")
version = get_version()
release = version

# List of patterns, relative to source directory, that match files and
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ commands = pre-commit run --hook-stage manual --all isort-check
[testenv:docs]
base_python = py3.12
recreate = False
skip_install = True
deps = -r requirements/docs/requirements.txt
commands = sphinx-build docs/ build/docs

Expand Down

0 comments on commit ec84969

Please sign in to comment.