Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-version-bumpver #59

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,11 @@ pc-run:
# Use Sphinx to build and view the documentation
docs:
uv run sphinx-autobuild -b html "{{SOURCEDIR}}" "{{BUILDDIR}}" {{SPHINXOPTS}}

# Use BumpVer to increase the patch version number. Use just bump -d to view a dry-run.
@bump *ARGS:
uv run bumpver update --patch {{ ARGS }}

# Use BumpVer to increase the minor version number. Use just bump -d to view a dry-run.
@bump-minor *ARGS:
uv run bumpver update --minor {{ ARGS }}
23 changes: 17 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ build-backend = "hatchling.build"

[project]
name = "djpress"
version = "0.11.2"
version = "0.11.3"
description = "A blog application for Django sites, inspired by classic WordPress."
readme = "README.md"
requires-python = ">=3.10"
authors = [{ name = "Stuart Maxwell", email = "[email protected]" }]
dependencies = [
"django>=4.2.0",
"markdown>=3.7",
"tomli>=2.1.0 ; python_full_version < '3.11'",
]
dependencies = ["django>=4.2.0", "markdown>=3.7"]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 3 - Alpha",
Expand Down Expand Up @@ -44,6 +40,9 @@ Documentation = "https://stuartmaxwell.github.io/djpress/"
Repository = "https://github.com/stuartmaxwell/djpress"
Issues = "https://github.com/stuartmaxwell/djpress/issues"

[dependency-groups]
dev = ["bumpver>=2024.1130"]

[project.optional-dependencies]
test = [
"pytest>=8.3.3",
Expand Down Expand Up @@ -94,3 +93,15 @@ python_files = "tests.py test_*.py *_tests.py"
branch = true
include = ["src/djpress/*"]
omit = ["*/tests/*", "*/migrations/*"]

[tool.bumpver]
current_version = "0.11.3"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = ":bookmark: bump version {old_version} -> {new_version}"
commit = true
push = true
tag = true

[tool.bumpver.file_patterns]
"pyproject.toml" = ['version = "{version}"']
"src/djpress/__init__.py" = ['^__version__ = "{version}"$']
21 changes: 1 addition & 20 deletions src/djpress/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
"""djpress module."""

from pathlib import Path

try:
import tomllib
except ImportError:
import tomli as tomllib # Alias tomli as tomllib for compatibility with Python versions < 3.11


def load_version() -> str:
"""Load the version from pyproject.toml."""
# Define the path to pyproject.toml
pyproject_path = Path(__file__).parent.parent.parent / "pyproject.toml"

# Read the version from pyproject.toml
with pyproject_path.open("rb") as f:
pyproject_data = tomllib.load(f)
return pyproject_data["project"]["version"]


__version__ = load_version()
__version__ = "0.11.3"
28 changes: 0 additions & 28 deletions tests/test_init.py

This file was deleted.

43 changes: 41 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.