File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import importlib .metadata
1+ import pathlib
2+
3+
4+ def get_version () -> str :
5+ path = pathlib .Path (__file__ ).parent .parent / "sqlalchemy_utils/__init__.py"
6+ content = path .read_text ()
7+ for line in content .splitlines ():
8+ if line .strip ().startswith ("__version__" ):
9+ _ , _ , version_ = line .partition ("=" )
10+ return version_ .strip ("'\" " )
11+
212
313# -- General configuration -----------------------------------------------------
414
2434project = "SQLAlchemy-Utils"
2535copyright = "2013-2022, Konsta Vesterinen"
2636
27- version = importlib . metadata . version ( "sqlalchemy_utils" )
37+ version = get_version ( )
2838release = version
2939
3040# List of patterns, relative to source directory, that match files and
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ commands = pre-commit run --hook-stage manual --all isort-check
4949[testenv:docs]
5050base_python = py3.12
5151recreate = False
52+ skip_install = True
5253deps = -r requirements/docs/requirements.txt
5354commands = sphinx-build docs/ build/docs
5455
You can’t perform that action at this time.
0 commit comments