Skip to content

Commit

Permalink
feat: support Python 3.9 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki authored Sep 25, 2024
1 parent 753bc1f commit 1de2607
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", 3.11, 3.12]
python-version: [3.9, "3.10", 3.11, 3.12]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.0
rev: 0.4.16
hooks:
- id: uv-lock

- repo: https://github.com/ninoseki/uv-sort
rev: v0.1.0
rev: v0.3.0
hooks:
- id: uv-sort

Expand All @@ -25,10 +25,10 @@ repos:
hooks:
- id: pyupgrade
args:
- --py310-plus
- --py39-plus

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.3
rev: v0.6.7
hooks:
- id: ruff
args:
Expand Down
23 changes: 12 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ name = "uv-dynamic-versioning"
dynamic = ["version"]
description = "Dynamic versioning based on VCS tags for uv/hatch project"
readme = "README.md"
requires-python = ">=3.10,<4.0"
requires-python = ">=3.9,<4.0"
license = { file = "LICENSE" }
keywords = ["uv", "hatch"]
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Hatch",
]
dependencies = [
"dunamai~=1.22.0",
"hatchling~=1.25.0",
"pydantic~=2.9.1",
"returns~=0.23.0",
"tomlkit~=0.13.2",
"dunamai~=1.22.0",
"hatchling~=1.25.0",
"pydantic~=2.9.1",
"returns~=0.23.0",
"tomlkit~=0.13.2",
]

[project.urls]
Expand All @@ -37,11 +38,11 @@ path = "src/uv_dynamic_versioning/__init__.py"

[tool.uv]
dev-dependencies = [
"gitpython~=3.1.43",
"pre-commit~=3.8.0",
"pytest~=8.3.2",
"pytest-pretty~=1.2.0",
"pytest-randomly~=3.15.0",
"gitpython~=3.1.43",
"pre-commit~=3.8.0",
"pytest~=8.3.2",
"pytest-pretty~=1.2.0",
"pytest-randomly~=3.15.0",
]

[tool.ruff.lint]
Expand Down
14 changes: 8 additions & 6 deletions src/uv_dynamic_versioning/schemas.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
from typing import Optional

from dunamai import Pattern, Style, Vcs
from pydantic import BaseModel, Field


class UvDynamicVersioning(BaseModel):
vcs: Vcs = Vcs.Any
metadata: bool | None = None
metadata: Optional[bool] = None
tagged_metadata: bool = Field(default=False, alias="tagged-metadata")
dirty: bool = False
pattern: Pattern = Pattern.Default
pattern_prefix: str | None = Field(default=None, alias="pattern-prefix")
format: str | None = None
style: Style | None = None
pattern_prefix: Optional[str] = Field(default=None, alias="pattern-prefix")
format: Optional[str] = None
style: Optional[Style] = None
latest_tag: bool = False
strict: bool = False
tag_dir: str = Field(default="tags", alias="tag-dir")
tag_branch: str | None = Field(default=None, alias="tag-branch")
tag_branch: Optional[str] = Field(default=None, alias="tag-branch")
full_commit: bool = Field(default=False, alias="full-commit")
ignore_untracked: bool = Field(default=False, alias="ignore-untracked")
bump: bool = False


class Tool(BaseModel):
uv_dynamic_versioning: UvDynamicVersioning | None = Field(
uv_dynamic_versioning: Optional[UvDynamicVersioning] = Field(
default=None, alias="uv-dynamic-versioning"
)

Expand Down
53 changes: 52 additions & 1 deletion uv.lock

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

0 comments on commit 1de2607

Please sign in to comment.