Skip to content

Commit

Permalink
Single source package version in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Dec 24, 2023
1 parent fbfc8d9 commit 5adc79a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ build:
commands:
- pip install -U pip
- pip install -U -r docs/requirements.txt
- pip install -e .
- make docs
- mv docs/_build $READTHEDOCS_OUTPUT
5 changes: 1 addition & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import importlib
from datetime import datetime

import tomllib

module = importlib.import_module("django_marina")

with open("../pyproject.toml", "rb") as f:
pyproject = tomllib.load(f)

project = pyproject["project"]["name"]
release = module.__version__
release = pyproject["project"]["version"]
version = ".".join(release.split(".")[:2])
author = ", ".join(author["name"] for author in pyproject["project"]["authors"])
year = datetime.now().year
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ license = {file = "LICENSE"}
name = "django-marina"
readme = "README.md"
requires-python = ">=3.8"
version = "23.6"
version = "23.7.dev0"

[project.urls]
Changelog = "https://github.com/zostera/django-marina/blob/main/CHANGELOG.md"
Expand Down
4 changes: 3 additions & 1 deletion src/django_marina/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "23.6.dev0"
import importlib.metadata

__version__ = importlib.metadata.version(__package__ or __name__)

0 comments on commit 5adc79a

Please sign in to comment.