version-bumper 0.1.3__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- version_bumper-0.3.2/.github/workflows/ci.yml +135 -0
- version_bumper-0.3.2/.github/workflows/coverage-badge.yml +77 -0
- version_bumper-0.3.2/.github/workflows/docs.yml +68 -0
- version_bumper-0.3.2/.github/workflows/release.yml +122 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/.gitignore +3 -1
- {version_bumper-0.1.3 → version_bumper-0.3.2}/.pre-commit-config.yaml +12 -24
- version_bumper-0.3.2/.pymarkdown.json +47 -0
- version_bumper-0.3.2/.python-versions +4 -0
- version_bumper-0.3.2/.python-versions.license +3 -0
- version_bumper-0.3.2/.shellcheckrc +5 -0
- version_bumper-0.3.2/CHANGELOG.md +218 -0
- version_bumper-0.3.2/DEV-README.md +719 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/PKG-INFO +126 -84
- {version_bumper-0.1.3 → version_bumper-0.3.2}/README.md +94 -56
- version_bumper-0.3.2/Taskfile.yml +275 -0
- version_bumper-0.3.2/docs/DEV-README.md +1 -0
- version_bumper-0.3.2/docs/index.md +1 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/pyproject.toml +49 -227
- version_bumper-0.3.2/scripts/custom_argparse.py +488 -0
- version_bumper-0.3.2/scripts/dev-metrics.py +1558 -0
- version_bumper-0.3.2/scripts/generate_test_docs.py +190 -0
- version_bumper-0.3.2/scripts/metrics_cc_filter.py +79 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/scripts/run-mypy-all-python-versions.sh +6 -4
- {version_bumper-0.1.3 → version_bumper-0.3.2}/scripts/swap_build_system.py +21 -16
- version_bumper-0.3.2/src/version_bumper/__init__.py +52 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/__main__.py +44 -41
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/__init__.py +2 -2
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/application_settings.py +2 -2
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/config_file.py +46 -30
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/info_control.py +19 -10
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/json_config_file.py +10 -4
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/logger_control.py +31 -25
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/toml_config_file.py +10 -4
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/commands.py +85 -40
- version_bumper-0.3.2/src/version_bumper/py.typed +0 -0
- version_bumper-0.3.2/src/version_bumper/pyproject.py +119 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/version.py +157 -109
- version_bumper-0.3.2/taskfiles/Taskfile-docs.yml +91 -0
- version_bumper-0.3.2/taskfiles/Taskfile-env.yml +72 -0
- version_bumper-0.3.2/taskfiles/Taskfile-format.yml +65 -0
- version_bumper-0.3.2/taskfiles/Taskfile-git.yml +37 -0
- version_bumper-0.3.2/taskfiles/Taskfile-lint.yml +257 -0
- version_bumper-0.3.2/taskfiles/Taskfile-metrics.yml +80 -0
- version_bumper-0.3.2/taskfiles/Taskfile-release.yml +209 -0
- version_bumper-0.3.2/taskfiles/Taskfile-test.yml +68 -0
- version_bumper-0.3.2/taskfiles/Taskfile-version.yml +132 -0
- version_bumper-0.3.2/taskfiles/helpers/task-docs-helper.py +119 -0
- version_bumper-0.3.2/taskfiles/helpers/task-env-helper.py +127 -0
- version_bumper-0.3.2/taskfiles/helpers/task-format-helper.py +157 -0
- version_bumper-0.3.2/taskfiles/helpers/task-helper.py +169 -0
- version_bumper-0.3.2/taskfiles/helpers/task-lint-helper.py +429 -0
- version_bumper-0.3.2/taskfiles/helpers/task-metrics-helper.py +58 -0
- version_bumper-0.3.2/taskfiles/helpers/task-version-helper.py +80 -0
- version_bumper-0.3.2/tests/conftest.py +35 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/test_app_version.py +7 -25
- version_bumper-0.3.2/tests/test_commands.py +157 -0
- version_bumper-0.3.2/tests/test_config_file.py +155 -0
- version_bumper-0.3.2/tests/test_info_control.py +36 -0
- version_bumper-0.3.2/tests/test_logger_control.py +55 -0
- version_bumper-0.3.2/tests/test_main.py +395 -0
- version_bumper-0.3.2/tests/test_pyproject.py +155 -0
- version_bumper-0.3.2/tests/test_version.py +393 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tox.ini +1 -1
- version_bumper-0.3.2/uv.lock +3181 -0
- version_bumper-0.3.2/uv.lock.license +3 -0
- version_bumper-0.3.2/zensical.toml +64 -0
- version_bumper-0.1.3/.hgignore +0 -17
- version_bumper-0.1.3/.idea/.gitignore +0 -8
- version_bumper-0.1.3/.idea/inspectionProfiles/Project_Default.xml +0 -29
- version_bumper-0.1.3/.idea/inspectionProfiles/profiles_settings.xml +0 -7
- version_bumper-0.1.3/.idea/misc.xml +0 -7
- version_bumper-0.1.3/.idea/modules.xml +0 -8
- version_bumper-0.1.3/.idea/ruff.xml +0 -7
- version_bumper-0.1.3/.idea/vcs.xml +0 -6
- version_bumper-0.1.3/.idea/version_bumper.iml +0 -18
- version_bumper-0.1.3/.idea/workspace.xml +0 -615
- version_bumper-0.1.3/DEV-README.md +0 -883
- version_bumper-0.1.3/Taskfile.yaml +0 -410
- version_bumper-0.1.3/docs/DEV-README.md +0 -592
- version_bumper-0.1.3/docs/index.md +0 -262
- version_bumper-0.1.3/mkdocs.yml +0 -80
- version_bumper-0.1.3/scripts/gen_ref_pages.py +0 -42
- version_bumper-0.1.3/scripts/metrics_cc_filter.py +0 -57
- version_bumper-0.1.3/src/version_bumper/__init__.py +0 -29
- version_bumper-0.1.3/src/version_bumper/pyproject.py +0 -62
- version_bumper-0.1.3/taskfiles/hatch-vars.yaml +0 -16
- version_bumper-0.1.3/taskfiles/hatch.yaml +0 -82
- version_bumper-0.1.3/taskfiles/poetry-vars.yaml +0 -16
- version_bumper-0.1.3/taskfiles/poetry.yaml +0 -78
- version_bumper-0.1.3/taskfiles/setuptools-vars.yaml +0 -16
- version_bumper-0.1.3/taskfiles/setuptools.yaml +0 -85
- version_bumper-0.1.3/taskfiles/uv-vars.yaml +0 -16
- version_bumper-0.1.3/taskfiles/uv.yaml +0 -69
- version_bumper-0.1.3/tests/test_commands.py +0 -98
- version_bumper-0.1.3/tests/test_config_file.py +0 -96
- version_bumper-0.1.3/tests/test_info_control.py +0 -42
- version_bumper-0.1.3/tests/test_main.py +0 -529
- version_bumper-0.1.3/tests/test_pyproject.py +0 -65
- version_bumper-0.1.3/tests/test_version.py +0 -330
- {version_bumper-0.1.3 → version_bumper-0.3.2}/.cruft.json +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/.cruft.json.license +0 -0
- /version_bumper-0.1.3/poetry.lock.license → /version_bumper-0.3.2/.pymarkdown.json.license +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/LICENSES/MIT.txt +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/scripts/fail_on_regex_match.sh +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/scripts/latest_pypi_version.sh +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/scripts/venv_runner.sh +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/src/version_bumper/clibones/config_file_base.py +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/config_1.toml +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/config_2.toml +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/config_3.toml +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/config_4.toml +0 -0
- {version_bumper-0.1.3 → version_bumper-0.3.2}/tests/good_pyproject.toml +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Roy Wright
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
# CI: runs on every push to main and on every pull request, and is called by the release
|
|
6
|
+
# workflow to check the tagged commit before it is published.
|
|
7
|
+
# - lint: every pre-commit hook (ruff, ruff-format, mypy for each Python version,
|
|
8
|
+
# prettier, codespell, reuse, ...), failing on any change a hook would make
|
|
9
|
+
# - complexity: task metrics:complexity (no function above complexity 5)
|
|
10
|
+
# - docs: task docs:build, which fails on any zensical warning (--strict), such as a
|
|
11
|
+
# broken link or a docstring cross-reference that does not resolve
|
|
12
|
+
# - test: the tests under every Python version in .python-versions, failing below
|
|
13
|
+
# the coverage floor in pyproject.toml; on main, the first version's coverage
|
|
14
|
+
# report is saved for the README's coverage badge (coverage-badge.yml)
|
|
15
|
+
|
|
16
|
+
name: CI
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
branches: [main]
|
|
21
|
+
pull_request:
|
|
22
|
+
workflow_call:
|
|
23
|
+
inputs:
|
|
24
|
+
ref:
|
|
25
|
+
description: "The git ref to check out, ex: a release tag"
|
|
26
|
+
required: true
|
|
27
|
+
type: string
|
|
28
|
+
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
|
|
32
|
+
env:
|
|
33
|
+
REF: ${{ inputs.ref || github.sha }}
|
|
34
|
+
|
|
35
|
+
jobs:
|
|
36
|
+
lint:
|
|
37
|
+
name: Lint (pre-commit)
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v7
|
|
41
|
+
with:
|
|
42
|
+
ref: ${{ env.REF }}
|
|
43
|
+
persist-credentials: false
|
|
44
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
45
|
+
- name: Install
|
|
46
|
+
run: |
|
|
47
|
+
uv sync --locked --all-extras
|
|
48
|
+
# pre-commit's python hooks run on python3.12 (default_language_version)
|
|
49
|
+
uv python install 3.12
|
|
50
|
+
- uses: actions/cache@v6
|
|
51
|
+
with:
|
|
52
|
+
path: ~/.cache/pre-commit
|
|
53
|
+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
54
|
+
- name: Run pre-commit
|
|
55
|
+
run: uv run --no-sync pre-commit run --all-files --show-diff-on-failure
|
|
56
|
+
|
|
57
|
+
complexity:
|
|
58
|
+
name: Complexity
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v7
|
|
62
|
+
with:
|
|
63
|
+
ref: ${{ env.REF }}
|
|
64
|
+
persist-credentials: false
|
|
65
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
66
|
+
- uses: go-task/setup-task@v2
|
|
67
|
+
with:
|
|
68
|
+
repo-token: ${{ github.token }}
|
|
69
|
+
- name: Install
|
|
70
|
+
run: uv sync --locked --all-extras
|
|
71
|
+
- name: Check complexity
|
|
72
|
+
run: task metrics:complexity
|
|
73
|
+
|
|
74
|
+
docs:
|
|
75
|
+
name: Docs
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v7
|
|
79
|
+
with:
|
|
80
|
+
ref: ${{ env.REF }}
|
|
81
|
+
persist-credentials: false
|
|
82
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
83
|
+
- uses: go-task/setup-task@v2
|
|
84
|
+
with:
|
|
85
|
+
repo-token: ${{ github.token }}
|
|
86
|
+
- name: Install
|
|
87
|
+
run: uv sync --locked --all-extras
|
|
88
|
+
- name: Build the docs (zensical --strict fails on any warning)
|
|
89
|
+
run: task docs:build
|
|
90
|
+
|
|
91
|
+
python-versions:
|
|
92
|
+
name: Read .python-versions
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
outputs:
|
|
95
|
+
versions: ${{ steps.read.outputs.versions }}
|
|
96
|
+
steps:
|
|
97
|
+
- uses: actions/checkout@v7
|
|
98
|
+
with:
|
|
99
|
+
ref: ${{ env.REF }}
|
|
100
|
+
persist-credentials: false
|
|
101
|
+
- id: read
|
|
102
|
+
run: |
|
|
103
|
+
versions=$(python3 -c 'import json, re, sys; print(json.dumps(re.findall(r"^\d+\.\d+", sys.stdin.read(), re.M)))' < .python-versions)
|
|
104
|
+
echo "versions=${versions}" >> "$GITHUB_OUTPUT"
|
|
105
|
+
echo "Testing with: ${versions}"
|
|
106
|
+
|
|
107
|
+
test:
|
|
108
|
+
name: Test (Python ${{ matrix.python }})
|
|
109
|
+
needs: python-versions
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
strategy:
|
|
112
|
+
fail-fast: false
|
|
113
|
+
matrix:
|
|
114
|
+
python: ${{ fromJSON(needs.python-versions.outputs.versions) }}
|
|
115
|
+
steps:
|
|
116
|
+
- uses: actions/checkout@v7
|
|
117
|
+
with:
|
|
118
|
+
ref: ${{ env.REF }}
|
|
119
|
+
persist-credentials: false
|
|
120
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
121
|
+
- name: Install
|
|
122
|
+
run: uv sync --locked --all-extras --python ${{ matrix.python }}
|
|
123
|
+
- name: Test (fails below the coverage floor in pyproject.toml)
|
|
124
|
+
run:
|
|
125
|
+
uv run --no-sync pytest --cov=version_bumper --cov-report=term-missing
|
|
126
|
+
--cov-report=json:coverage.json
|
|
127
|
+
# coverage-badge.yml publishes this as the README's coverage badge
|
|
128
|
+
- if:
|
|
129
|
+
github.event_name == 'push' && github.ref == 'refs/heads/main' &&
|
|
130
|
+
strategy.job-index == 0
|
|
131
|
+
uses: actions/upload-artifact@v7
|
|
132
|
+
with:
|
|
133
|
+
name: coverage
|
|
134
|
+
path: coverage.json
|
|
135
|
+
if-no-files-found: error
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Roy Wright
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
# Coverage badge: after CI passes on a push to main, turn its coverage report into a
|
|
6
|
+
# shields.io endpoint file (https://shields.io/badges/endpoint-badge) and force-push it
|
|
7
|
+
# to the "badges" branch, which holds only that file. The README's badge reads it from
|
|
8
|
+
# https://raw.githubusercontent.com/royw/version_bumper/badges/coverage.json
|
|
9
|
+
#
|
|
10
|
+
# This is a separate workflow, not a job in ci.yml, because it needs write access and
|
|
11
|
+
# the release workflow calls ci.yml with read access only.
|
|
12
|
+
|
|
13
|
+
name: Coverage badge
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
workflow_run:
|
|
17
|
+
workflows: [CI]
|
|
18
|
+
types: [completed]
|
|
19
|
+
branches: [main]
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
|
|
24
|
+
concurrency:
|
|
25
|
+
group: coverage-badge
|
|
26
|
+
cancel-in-progress: true
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
badge:
|
|
30
|
+
name: Update coverage badge
|
|
31
|
+
if:
|
|
32
|
+
github.event.workflow_run.conclusion == 'success' &&
|
|
33
|
+
github.event.workflow_run.event == 'push' &&
|
|
34
|
+
github.event.workflow_run.head_repository.full_name == github.repository
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
permissions:
|
|
37
|
+
actions: read # download the coverage report from the CI run
|
|
38
|
+
contents: write # push the badges branch
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v8
|
|
41
|
+
with:
|
|
42
|
+
name: coverage
|
|
43
|
+
run-id: ${{ github.event.workflow_run.id }}
|
|
44
|
+
github-token: ${{ github.token }}
|
|
45
|
+
- name: Write the badge file
|
|
46
|
+
run: |
|
|
47
|
+
python3 - <<'EOF'
|
|
48
|
+
import json
|
|
49
|
+
|
|
50
|
+
with open("coverage.json") as f:
|
|
51
|
+
totals = json.load(f)["totals"]
|
|
52
|
+
percent = totals["percent_covered"]
|
|
53
|
+
colors = [(100, "brightgreen"), (90, "green"), (80, "yellowgreen"), (70, "yellow"), (0, "red")]
|
|
54
|
+
color = next(name for floor, name in colors if percent >= floor)
|
|
55
|
+
badge = {
|
|
56
|
+
"schemaVersion": 1,
|
|
57
|
+
"label": "coverage",
|
|
58
|
+
"message": f"{totals['percent_covered_display']}%",
|
|
59
|
+
"color": color,
|
|
60
|
+
}
|
|
61
|
+
with open("badge.json", "w") as f:
|
|
62
|
+
json.dump(badge, f)
|
|
63
|
+
print(badge)
|
|
64
|
+
EOF
|
|
65
|
+
- uses: actions/checkout@v7
|
|
66
|
+
with:
|
|
67
|
+
path: repo
|
|
68
|
+
- name: Push the badges branch
|
|
69
|
+
working-directory: repo
|
|
70
|
+
run: |
|
|
71
|
+
git switch --orphan badges
|
|
72
|
+
mv ../badge.json coverage.json
|
|
73
|
+
git add coverage.json
|
|
74
|
+
git -c user.name="github-actions[bot]" \
|
|
75
|
+
-c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
|
|
76
|
+
commit --quiet -m "coverage badge for ${{ github.event.workflow_run.head_sha }}"
|
|
77
|
+
git push --force origin badges
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Roy Wright
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
# Docs: after CI passes on a push to main, build the docs site (task docs:build) and
|
|
6
|
+
# deploy it to GitHub Pages: https://royw.github.io/version_bumper/
|
|
7
|
+
# It can also be run by hand (Actions → Docs → Run workflow) to redeploy main.
|
|
8
|
+
#
|
|
9
|
+
# One-time setup: Settings → Pages → Build and deployment → Source: GitHub Actions.
|
|
10
|
+
|
|
11
|
+
name: Docs
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
workflow_run:
|
|
15
|
+
workflows: [CI]
|
|
16
|
+
types: [completed]
|
|
17
|
+
branches: [main]
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
|
|
23
|
+
# one deployment at a time; a newer push replaces a queued one, but never cancels a
|
|
24
|
+
# deployment that is already running
|
|
25
|
+
concurrency:
|
|
26
|
+
group: pages
|
|
27
|
+
cancel-in-progress: false
|
|
28
|
+
|
|
29
|
+
jobs:
|
|
30
|
+
build:
|
|
31
|
+
name: Build
|
|
32
|
+
if:
|
|
33
|
+
github.event_name == 'workflow_dispatch' ||
|
|
34
|
+
(github.event.workflow_run.conclusion == 'success' &&
|
|
35
|
+
github.event.workflow_run.event == 'push' &&
|
|
36
|
+
github.event.workflow_run.head_repository.full_name == github.repository)
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
|
+
with:
|
|
41
|
+
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
|
|
42
|
+
persist-credentials: false
|
|
43
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
44
|
+
- uses: go-task/setup-task@v2
|
|
45
|
+
with:
|
|
46
|
+
repo-token: ${{ github.token }}
|
|
47
|
+
- name: Install
|
|
48
|
+
run: uv sync --locked --all-extras
|
|
49
|
+
- name: Build the docs
|
|
50
|
+
run: task docs:build
|
|
51
|
+
- uses: actions/configure-pages@v6
|
|
52
|
+
- uses: actions/upload-pages-artifact@v5
|
|
53
|
+
with:
|
|
54
|
+
path: site/
|
|
55
|
+
|
|
56
|
+
deploy:
|
|
57
|
+
name: Deploy to GitHub Pages
|
|
58
|
+
needs: build
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
environment:
|
|
61
|
+
name: github-pages
|
|
62
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
63
|
+
permissions:
|
|
64
|
+
pages: write
|
|
65
|
+
id-token: write
|
|
66
|
+
steps:
|
|
67
|
+
- id: deployment
|
|
68
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Roy Wright
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
# Release workflow: `task release:tag` pushes a vX.Y.Z tag, which runs this workflow to
|
|
6
|
+
# 1. check the tagged commit with the CI workflow (lint, complexity, and the tests
|
|
7
|
+
# under every Python version in .python-versions),
|
|
8
|
+
# 2. build the wheel and sdist, checking the tag matches the project version,
|
|
9
|
+
# 3. publish them to PyPI (trusted publishing, no API token),
|
|
10
|
+
# 4. create the GitHub release, with the CHANGELOG section as its notes.
|
|
11
|
+
#
|
|
12
|
+
# It can also be run by hand (Actions → Release → Run workflow) for a tag that already
|
|
13
|
+
# exists, ex: one pushed before this workflow was added.
|
|
14
|
+
#
|
|
15
|
+
# One-time setup:
|
|
16
|
+
# - on pypi.org, add a trusted publisher to the version_bumper project:
|
|
17
|
+
# owner royw, repository version_bumper, workflow release.yml, environment pypi
|
|
18
|
+
# - on GitHub, create the "pypi" environment (Settings → Environments); optionally
|
|
19
|
+
# add yourself as a required reviewer so each publish waits for approval.
|
|
20
|
+
|
|
21
|
+
name: Release
|
|
22
|
+
|
|
23
|
+
on:
|
|
24
|
+
push:
|
|
25
|
+
tags: ["v*"]
|
|
26
|
+
workflow_dispatch:
|
|
27
|
+
inputs:
|
|
28
|
+
tag:
|
|
29
|
+
description: "Existing tag to release, ex: v0.3.0"
|
|
30
|
+
required: true
|
|
31
|
+
type: string
|
|
32
|
+
|
|
33
|
+
permissions:
|
|
34
|
+
contents: read
|
|
35
|
+
|
|
36
|
+
concurrency:
|
|
37
|
+
group: release-${{ inputs.tag || github.ref_name }}
|
|
38
|
+
cancel-in-progress: false
|
|
39
|
+
|
|
40
|
+
env:
|
|
41
|
+
TAG: ${{ inputs.tag || github.ref_name }}
|
|
42
|
+
|
|
43
|
+
jobs:
|
|
44
|
+
ci:
|
|
45
|
+
name: CI
|
|
46
|
+
uses: ./.github/workflows/ci.yml
|
|
47
|
+
with:
|
|
48
|
+
ref: ${{ inputs.tag || github.ref_name }}
|
|
49
|
+
|
|
50
|
+
build:
|
|
51
|
+
name: Build
|
|
52
|
+
needs: ci
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v7
|
|
56
|
+
with:
|
|
57
|
+
ref: ${{ env.TAG }}
|
|
58
|
+
persist-credentials: false
|
|
59
|
+
- uses: astral-sh/setup-uv@v10.4.2 # setup-uv publishes no major-version tag
|
|
60
|
+
- name: Check the tag matches the project version
|
|
61
|
+
run: |
|
|
62
|
+
version=$(uv run --no-project python -c \
|
|
63
|
+
'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
|
|
64
|
+
if [ "v${version}" != "${TAG}" ]; then
|
|
65
|
+
echo "::error::Tag ${TAG} does not match the project version ${version}"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
- name: Build
|
|
69
|
+
run: uv build
|
|
70
|
+
- uses: actions/upload-artifact@v7
|
|
71
|
+
with:
|
|
72
|
+
name: dist
|
|
73
|
+
path: dist/
|
|
74
|
+
if-no-files-found: error
|
|
75
|
+
|
|
76
|
+
publish-pypi:
|
|
77
|
+
name: Publish to PyPI
|
|
78
|
+
needs: build
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
environment:
|
|
81
|
+
name: pypi
|
|
82
|
+
url: https://pypi.org/p/version_bumper
|
|
83
|
+
permissions:
|
|
84
|
+
id-token: write # trusted publishing
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/download-artifact@v8
|
|
87
|
+
with:
|
|
88
|
+
name: dist
|
|
89
|
+
path: dist/
|
|
90
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
91
|
+
|
|
92
|
+
github-release:
|
|
93
|
+
name: Create GitHub release
|
|
94
|
+
needs: publish-pypi
|
|
95
|
+
runs-on: ubuntu-latest
|
|
96
|
+
permissions:
|
|
97
|
+
contents: write
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v7
|
|
100
|
+
with:
|
|
101
|
+
ref: ${{ env.TAG }}
|
|
102
|
+
persist-credentials: false
|
|
103
|
+
- uses: actions/download-artifact@v8
|
|
104
|
+
with:
|
|
105
|
+
name: dist
|
|
106
|
+
path: dist/
|
|
107
|
+
- name: Release notes from CHANGELOG.md
|
|
108
|
+
run: |
|
|
109
|
+
version="${TAG#v}"
|
|
110
|
+
awk -v heading="## [${version}]" \
|
|
111
|
+
'index($0, heading) == 1 {found=1; next} found && /^## \[/ {exit} found {print}' \
|
|
112
|
+
CHANGELOG.md > notes.md
|
|
113
|
+
if [ ! -s notes.md ]; then
|
|
114
|
+
echo "::error::No [${version}] section in CHANGELOG.md"
|
|
115
|
+
exit 1
|
|
116
|
+
fi
|
|
117
|
+
- name: Create release
|
|
118
|
+
env:
|
|
119
|
+
GH_TOKEN: ${{ github.token }}
|
|
120
|
+
run:
|
|
121
|
+
gh release create "${TAG}" dist/* --verify-tag --title "${TAG}"
|
|
122
|
+
--notes-file notes.md
|
|
@@ -11,7 +11,7 @@ site/
|
|
|
11
11
|
.nox/
|
|
12
12
|
.reuse/
|
|
13
13
|
.coverage
|
|
14
|
-
|
|
14
|
+
coverage.xml
|
|
15
15
|
**/__pycache__/*.pyc
|
|
16
16
|
reuse.spdx
|
|
17
17
|
**/*_cache/
|
|
@@ -21,3 +21,5 @@ taskfiles/front-end*.yaml
|
|
|
21
21
|
**/requirements*.txt*
|
|
22
22
|
src/*.egg-info
|
|
23
23
|
REUSE.toml
|
|
24
|
+
docs/generated/
|
|
25
|
+
coverage.json
|
|
@@ -12,26 +12,27 @@ ci:
|
|
|
12
12
|
|
|
13
13
|
repos:
|
|
14
14
|
- repo: https://github.com/fsfe/reuse-tool
|
|
15
|
-
rev:
|
|
15
|
+
rev: v6.3.0
|
|
16
16
|
hooks:
|
|
17
17
|
- id: reuse
|
|
18
18
|
exclude: ^(\.vscode/|uv\.lock$)
|
|
19
19
|
|
|
20
20
|
- repo: https://github.com/asottile/pyupgrade
|
|
21
|
-
rev: v3.
|
|
21
|
+
rev: v3.22.0
|
|
22
22
|
hooks:
|
|
23
23
|
- id: pyupgrade
|
|
24
24
|
|
|
25
25
|
- repo: https://github.com/adamchainz/blacken-docs
|
|
26
|
-
rev: "1.
|
|
26
|
+
rev: "1.20.0"
|
|
27
27
|
hooks:
|
|
28
28
|
- id: blacken-docs
|
|
29
29
|
additional_dependencies: [black==24.*]
|
|
30
30
|
|
|
31
31
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
32
|
-
rev: "
|
|
32
|
+
rev: "v6.0.0"
|
|
33
33
|
hooks:
|
|
34
34
|
- id: check-added-large-files
|
|
35
|
+
exclude: ^uv\.lock$
|
|
35
36
|
- id: check-case-conflict
|
|
36
37
|
- id: check-merge-conflict
|
|
37
38
|
- id: check-symlinks
|
|
@@ -56,11 +57,11 @@ repos:
|
|
|
56
57
|
rev: "v4.0.0-alpha.8"
|
|
57
58
|
hooks:
|
|
58
59
|
- id: prettier
|
|
59
|
-
types_or: [yaml,
|
|
60
|
+
types_or: [yaml, html, css, scss, javascript, json]
|
|
60
61
|
args: [--prose-wrap=always]
|
|
61
62
|
|
|
62
63
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
63
|
-
rev: "v0.5
|
|
64
|
+
rev: "v0.17.5"
|
|
64
65
|
hooks:
|
|
65
66
|
- id: ruff
|
|
66
67
|
args: ["--fix", "--show-fixes"]
|
|
@@ -78,9 +79,10 @@ repos:
|
|
|
78
79
|
types: [python]
|
|
79
80
|
|
|
80
81
|
- repo: https://github.com/codespell-project/codespell
|
|
81
|
-
rev: "v2.3
|
|
82
|
+
rev: "v2.4.3"
|
|
82
83
|
hooks:
|
|
83
84
|
- id: codespell
|
|
85
|
+
exclude: ^uv\.lock$
|
|
84
86
|
|
|
85
87
|
# - repo: https://github.com/shellcheck-py/shellcheck-py
|
|
86
88
|
# rev: "v0.10.0.1"
|
|
@@ -93,31 +95,17 @@ repos:
|
|
|
93
95
|
name: Disallow improper capitalization
|
|
94
96
|
language: pygrep
|
|
95
97
|
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
|
|
96
|
-
exclude: ^(\.pre-commit-config\.yaml
|
|
98
|
+
exclude: ^(\.pre-commit-config\.yaml|.*Taskfile.*\.ya?ml|.*\.md)$
|
|
97
99
|
|
|
98
100
|
- repo: https://github.com/abravalheri/validate-pyproject
|
|
99
|
-
rev: "v0.
|
|
101
|
+
rev: "v0.27"
|
|
100
102
|
hooks:
|
|
101
103
|
- id: validate-pyproject
|
|
102
104
|
additional_dependencies: ["validate-pyproject-schema-store[all]"]
|
|
103
105
|
|
|
104
106
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
105
|
-
rev: "0.
|
|
107
|
+
rev: "0.39.0"
|
|
106
108
|
hooks:
|
|
107
109
|
- id: check-dependabot
|
|
108
110
|
- id: check-github-workflows
|
|
109
111
|
- id: check-readthedocs
|
|
110
|
-
|
|
111
|
-
- repo: local
|
|
112
|
-
hooks:
|
|
113
|
-
- id: task_pre_commit
|
|
114
|
-
name: task_pre_commit
|
|
115
|
-
entry: task pre-commit
|
|
116
|
-
pass_filenames: false
|
|
117
|
-
language: python
|
|
118
|
-
# use your preferred Python version
|
|
119
|
-
language_version: python3.12
|
|
120
|
-
types: [python]
|
|
121
|
-
verbose: true
|
|
122
|
-
additional_dependencies:
|
|
123
|
-
- check-pyproject@git+https://github.com/royw/check_pyproject.git
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": {
|
|
3
|
+
"line-length": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"line_length": 120,
|
|
6
|
+
"code_block_line_length": 120
|
|
7
|
+
},
|
|
8
|
+
"no-duplicate-heading": {
|
|
9
|
+
"enabled": false
|
|
10
|
+
},
|
|
11
|
+
"md013": {
|
|
12
|
+
"enabled": false
|
|
13
|
+
},
|
|
14
|
+
"md022": {
|
|
15
|
+
"enabled": false
|
|
16
|
+
},
|
|
17
|
+
"md024": {
|
|
18
|
+
"enabled": false,
|
|
19
|
+
"siblings_only": true
|
|
20
|
+
},
|
|
21
|
+
"md026": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"punctuation": ".,;:!?"
|
|
24
|
+
},
|
|
25
|
+
"md033": {
|
|
26
|
+
"enabled": true
|
|
27
|
+
},
|
|
28
|
+
"md034": {
|
|
29
|
+
"enabled": true
|
|
30
|
+
},
|
|
31
|
+
"md036": {
|
|
32
|
+
"enabled": false
|
|
33
|
+
},
|
|
34
|
+
"md041": {
|
|
35
|
+
"enabled": false
|
|
36
|
+
},
|
|
37
|
+
"md042": {
|
|
38
|
+
"enabled": true
|
|
39
|
+
},
|
|
40
|
+
"md045": {
|
|
41
|
+
"enabled": true
|
|
42
|
+
},
|
|
43
|
+
"md047": {
|
|
44
|
+
"enabled": true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|