Skip to content

Commit 80e4f07

Browse files
feat!: replace commitizen and pre-commit
- add ap-commit hook: checks the commit type against [commit.types] in afterpython.toml and lists the types in the editor template - replace pre-commit with prek (ap prek / ap pc) - ap bump uses uv version instead of cz bump and makes the bump commit and tag itself; stable versions bump patch by default, --minor/--major for the others - releasing (ap bump --release, ap release) only works on the default branch, pushes the branch and tag together, and stops if the remote has commits you don't have - remove commitizen: ap commit, ap cz, cz.toml - ap init creates afterpython.toml from a template
1 parent b7d4ae2 commit 80e4f07

25 files changed

Lines changed: 1185 additions & 1720 deletions

‎afterpython/.pre-commit-config.yaml‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# we need to explicitly pass in --hook-type whenever we run "pre-commit install --hook-type ..."
33
default_install_hook_types:
44
- pre-commit
5+
- prepare-commit-msg
56
- commit-msg
67
- pre-push
78
exclude: ^afterpython/_website/
@@ -25,7 +26,7 @@ repos:
2526
stages:
2627
- pre-commit
2728
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.15.21
29+
rev: v0.16.9
2930
hooks:
3031
- id: ruff-check
3132
stages:
@@ -39,12 +40,18 @@ repos:
3940
args:
4041
- --config
4142
- ./afterpython/ruff.toml
42-
# - repo: https://github.com/commitizen-tools/commitizen
43-
# rev: v4.16.0
44-
# hooks:
45-
# - id: commitizen
46-
# stages:
47-
# - commit-msg
48-
# - id: commitizen-branch
49-
# stages:
50-
# - pre-push
43+
- repo: local
44+
hooks:
45+
# same id twice so that SKIP=ap-commit skips both
46+
- id: ap-commit
47+
name: commit message template
48+
entry: uv run --no-sync ap commit-msg --template
49+
language: system
50+
stages:
51+
- prepare-commit-msg
52+
- id: ap-commit
53+
name: check commit message
54+
entry: uv run --no-sync ap commit-msg
55+
language: system
56+
stages:
57+
- commit-msg

‎afterpython/afterpython.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,17 @@ api_reference = false # set to true to enable the pdoc-generated API reference
1717
# [website.blog]
1818
# thumbnail = "blog_default_thumbnail.png" # inside blog/static/ folder, default thumbnail for blog posts
1919
# featured_post = "blog1.md"
20+
21+
# allowed commit types, e.g. "feat: add X"; add or remove lines freely
22+
[commit.types]
23+
feat = "A new feature"
24+
fix = "A bug fix"
25+
docs = "Documentation only changes"
26+
style = "Formatting, no code meaning change"
27+
refactor = "Neither fixes a bug nor adds a feature"
28+
perf = "Performance improvement"
29+
test = "Adding or fixing tests"
30+
build = "Build system or dependencies"
31+
ci = "CI configuration"
32+
chore = "Other changes that don't modify src or tests"
33+
wip = "Work in progress"

‎afterpython/cz.toml‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎pixi.lock‎

Lines changed: 437 additions & 1001 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pixi.toml‎

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name = "afterpython"
55
platforms = ["win-64", "linux-64", "osx-arm64", "osx-64"]
66
# NOTE: should match with setup-pixi in ci.yml
77
requires-pixi = ">=0.81.0,<0.82.0"
8-
exclude-newer = "14d"
8+
# exclude-newer = "14d"
99

1010
[tasks]
1111

@@ -22,23 +22,19 @@ gh = ">=2.92.0"
2222

2323
# `pixi config set pinning-strategy latest-up` removes the upper bound on the versions of the dependencies
2424
[pypi-dependencies]
25-
click = ">=8.1.8"
25+
click = ">=8.5.0"
2626
trogon = ">=0.6.0"
27-
httpx2 = ">=2.5.0"
28-
tomlkit = ">=0.15.0"
27+
httpx2 = ">=2.13.1"
28+
tomlkit = ">=0.15.1"
2929
ruamel-yaml = ">=0.19.1"
30-
gitpython = ">=3.1.50"
31-
# pygithub = ">=2.8.1"
32-
python-dotenv = ">=1.2.2"
33-
pyproject-metadata = ">=0.11.0"
34-
jupytext = ">=1.19.4"
35-
# jinja2 = ">=3.1.6"
36-
mystmd = ">=1.10.1"
30+
gitpython = ">=3.1.62"
31+
python-dotenv = ">=1.2.3"
32+
pyproject-metadata = ">=0.12.1"
33+
jupytext = ">=1.19.5"
34+
mystmd = ">=1.11.0"
3735
pdoc = ">=16.0.0"
38-
ruff = ">=0.15.21"
39-
pre-commit = ">=4.6.0"
40-
commitizen = ">=4.16.4"
41-
# python-semantic-release = ">=10.5.2"
36+
ruff = ">=0.16.9"
37+
prek = ">=0.5.4"
4238

4339
# [pypi-options.dependency-overrides]
4440
# platformdirs = ">=4.5.0"
@@ -66,7 +62,6 @@ pytest-xdist = ">=3.8.0"
6662
[feature.test.tasks]
6763
test = "pytest -v -n auto"
6864

69-
7065
[feature.py311.dependencies]
7166
python = "3.11.*"
7267

‎pyproject.toml‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,23 @@ classifiers = [
2828
"Programming Language :: Python :: 3.11",
2929
"Programming Language :: Python :: 3.12",
3030
"Programming Language :: Python :: 3.13",
31-
# "Programming Language :: Python :: 3.14",
31+
"Programming Language :: Python :: 3.14",
3232
]
3333
requires-python = ">=3.11"
3434
dependencies = [
35-
"click>=8.1.8",
35+
"click>=8.5.0",
3636
"trogon>=0.6.0",
37-
"httpx2>=2.5.0",
38-
"tomlkit>=0.15.0",
37+
"httpx2>=2.13.1",
38+
"tomlkit>=0.15.1",
3939
"ruamel-yaml>=0.19.1",
40-
"gitpython>=3.1.50",
41-
# "pygithub>=2.8.1",
42-
"python-dotenv>=1.2.2",
43-
"pyproject-metadata>=0.11.0",
44-
"jupytext>=1.19.4",
45-
# "jinja2>=3.1.6",
46-
"mystmd>=1.10.1",
40+
"gitpython>=3.1.62",
41+
"python-dotenv>=1.2.3",
42+
"pyproject-metadata>=0.12.1",
43+
"jupytext>=1.19.5",
44+
"mystmd>=1.11.0",
4745
"pdoc>=16.0.0",
48-
"ruff>=0.15.21",
49-
"pre-commit>=4.6.0",
50-
"commitizen>=4.16.4",
51-
# "python-semantic-release>=10.5.2",
46+
"ruff>=0.16.9",
47+
"prek>=0.5.4",
5248
]
5349

5450
[project.urls]
@@ -64,11 +60,11 @@ pcu = "afterpython.main:run_pcu"
6460
# override-dependencies = ["platformdirs>=4.5.0", "nodeenv>=1.9.1"]
6561

6662
[build-system]
67-
requires = ["uv_build>=0.11.28,<0.12.0"]
63+
requires = ["uv_build>=0.12.19,<0.13.0"]
6864
build-backend = "uv_build"
6965

7066
[tool.uv]
71-
exclude-newer = "14 days"
67+
# exclude-newer = "14 days"
7268

7369
[tool.uv.build-backend]
7470
module-name = "afterpython"

0 commit comments

Comments
 (0)