templatepy 0.16.2__tar.gz → 0.16.4__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.
Files changed (46) hide show
  1. {templatepy-0.16.2 → templatepy-0.16.4}/PKG-INFO +1 -1
  2. templatepy-0.16.4/VERSION +1 -0
  3. {templatepy-0.16.2 → templatepy-0.16.4}/pyproject.toml +1 -1
  4. templatepy-0.16.4/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/release.yml +135 -0
  5. templatepy-0.16.2/VERSION +0 -1
  6. templatepy-0.16.2/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/release.yml +0 -85
  7. {templatepy-0.16.2 → templatepy-0.16.4}/.gitignore +0 -0
  8. {templatepy-0.16.2 → templatepy-0.16.4}/CITATION.cff +0 -0
  9. {templatepy-0.16.2 → templatepy-0.16.4}/LICENSE +0 -0
  10. {templatepy-0.16.2 → templatepy-0.16.4}/README.md +0 -0
  11. {templatepy-0.16.2 → templatepy-0.16.4}/copier.yaml +0 -0
  12. {templatepy-0.16.2 → templatepy-0.16.4}/src/templatepy/__init__.py +0 -0
  13. {templatepy-0.16.2 → templatepy-0.16.4}/template/.githooks/fix_commit_msg.py +0 -0
  14. {templatepy-0.16.2 → templatepy-0.16.4}/template/.gitignore +0 -0
  15. {templatepy-0.16.2 → templatepy-0.16.4}/template/.gitleaks.toml +0 -0
  16. {templatepy-0.16.2 → templatepy-0.16.4}/template/.gitlint +0 -0
  17. {templatepy-0.16.2 → templatepy-0.16.4}/template/.pre-commit-config.yaml +0 -0
  18. {templatepy-0.16.2 → templatepy-0.16.4}/template/CITATION.cff +0 -0
  19. {templatepy-0.16.2 → templatepy-0.16.4}/template/CODE_OF_CONDUCT.md +0 -0
  20. {templatepy-0.16.2 → templatepy-0.16.4}/template/CONTRIBUTING.md +0 -0
  21. {templatepy-0.16.2 → templatepy-0.16.4}/template/LICENSE +0 -0
  22. {templatepy-0.16.2 → templatepy-0.16.4}/template/README.md +0 -0
  23. {templatepy-0.16.2 → templatepy-0.16.4}/template/VERSION +0 -0
  24. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/[% if enable_docs_publishing %]docs.yml[% endif %] +0 -0
  25. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/[% if enable_llm_pr_review %]pr-review.yml[% endif %] +0 -0
  26. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/ci.yml +0 -0
  27. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/ISSUE_TEMPLATE/bug_report.md +0 -0
  28. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/ISSUE_TEMPLATE/feature_request.md +0 -0
  29. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/PULL_REQUEST_TEMPLATE.md +0 -0
  30. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/[% if enable_docs_publishing %]docs.yml[% endif %] +0 -0
  31. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/[% if enable_llm_pr_review %]pr-review.yml[% endif %] +0 -0
  32. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/ci.yml +0 -0
  33. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/release.yml +0 -0
  34. {templatepy-0.16.2 → templatepy-0.16.4}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/versioning.yml +0 -0
  35. {templatepy-0.16.2 → templatepy-0.16.4}/template/[[ _copier_conf.answers_file ]] +0 -0
  36. {templatepy-0.16.2 → templatepy-0.16.4}/template/docs/index.md +0 -0
  37. {templatepy-0.16.2 → templatepy-0.16.4}/template/docs/repository-setup.md +0 -0
  38. {templatepy-0.16.2 → templatepy-0.16.4}/template/mkdocs.yml +0 -0
  39. {templatepy-0.16.2 → templatepy-0.16.4}/template/pyproject.toml +0 -0
  40. {templatepy-0.16.2 → templatepy-0.16.4}/template/scripts/setup_branch_protection.sh +0 -0
  41. {templatepy-0.16.2 → templatepy-0.16.4}/template/scripts/setup_repo.sh +0 -0
  42. {templatepy-0.16.2 → templatepy-0.16.4}/template/src/[[ project_slug ]]/__init__.py +0 -0
  43. {templatepy-0.16.2 → templatepy-0.16.4}/template/src/[[ project_slug ]]/py.typed +0 -0
  44. {templatepy-0.16.2 → templatepy-0.16.4}/template/tests/conftest.py +0 -0
  45. {templatepy-0.16.2 → templatepy-0.16.4}/template/tests/integration/test_integration_placeholder.py +0 -0
  46. {templatepy-0.16.2 → templatepy-0.16.4}/template/tests/unit/test_unit_placeholder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: templatepy
3
- Version: 0.16.2
3
+ Version: 0.16.4
4
4
  Summary: Copier template for modern Python packages
5
5
  Project-URL: Homepage, https://github.com/larsrollik/templatepy
6
6
  Project-URL: Documentation, https://larsrollik.github.io/templatepy
@@ -0,0 +1 @@
1
+ 0.16.4
@@ -51,7 +51,7 @@ include = ["src", "copier.yaml", "template", "CITATION.cff", "README.md", "VERSI
51
51
 
52
52
  [tool.commitizen]
53
53
  version_provider = "commitizen"
54
- version = "0.16.2"
54
+ version = "0.16.4"
55
55
  version_files = ["VERSION"]
56
56
  tag_format = "v$version"
57
57
  update_changelog_on_bump = false
@@ -0,0 +1,135 @@
1
+ # Forgejo Actions.
2
+ #
3
+ # THIRD-PARTY ACTIONS ARE REFERENCED BY ABSOLUTE URL, and that is not a style
4
+ # choice. On Forgejo a bare `uses: owner/action@ref` is fetched from the
5
+ # INSTANCE's actions mirror (`DEFAULT_ACTIONS_URL`), not from GitHub - and the
6
+ # mirrors carry different subsets. Measured 2026-10-24 with `git ls-remote`:
7
+ #
8
+ # code.forgejo.org data.forgejo.org
9
+ # actions/checkout resolves resolves
10
+ # astral-sh/setup-uv MISSING resolves
11
+ # softprops/action-gh-release MISSING MISSING
12
+ #
13
+ # So a bare third-party reference works on one instance and fails on another,
14
+ # and the failure is a `git ls-remote` error naming the actions host - which
15
+ # reads as a network fault rather than as a missing mirror entry. An absolute
16
+ # URL depends on nothing an instance happens to mirror this month.
17
+ #
18
+ # `actions/*` stays BARE on purpose: Forgejo mirrors that family deliberately,
19
+ # so a bare reference there also works on an instance with no route to GitHub.
20
+ name: Release
21
+
22
+ on:
23
+ push:
24
+ branches: [main]
25
+ workflow_dispatch:
26
+
27
+ permissions:
28
+ contents: write
29
+
30
+ # Serialise per branch so back-to-back merges cannot race on the bump. Two parallel
31
+ # runs would both bump from the same tip and compute the same next version; the second
32
+ # one's contents-API call then carries a stale blob sha and is refused. cancel-in-progress
33
+ # is deliberately false: cancelling mid-run can leave main bumped with no tag.
34
+ concurrency:
35
+ group: release-${{ github.ref }}
36
+ cancel-in-progress: false
37
+
38
+ jobs:
39
+ release:
40
+ name: Bump, build, publish
41
+ runs-on: ubuntu-latest
42
+ if: "!startsWith(github.event.head_commit.message, 'bump:')"
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ with:
46
+ fetch-depth: 0
47
+ token: ${{ secrets.VERSION_PUSH_TOKEN || github.token }}
48
+
49
+ - name: Configure git identity
50
+ run: |
51
+ git config user.name "forgejo-actions[bot]"
52
+ git config user.email "forgejo-actions[bot]@noreply"
53
+
54
+ - uses: https://github.com/astral-sh/setup-uv@v7
55
+ with:
56
+ python-version: "[[ python_requires ]]"
57
+
58
+ - name: Bump version
59
+ id: bump
60
+ env:
61
+ FJ_TOKEN: ${{ secrets.VERSION_PUSH_TOKEN || github.token }}
62
+ run: |
63
+ uvx --from commitizen cz bump --files-only --yes || EXIT=$?
64
+ if [ "${EXIT:-0}" -eq 21 ] || [ "${EXIT:-0}" -eq 6 ]; then
65
+ echo "No bumpable commits since last tag — skipping."
66
+ echo "skipped=true" >> "$GITHUB_OUTPUT"
67
+ exit 0
68
+ fi
69
+ [ "${EXIT:-0}" -eq 0 ] || exit $EXIT
70
+ VERSION="$(cat VERSION)"
71
+ TAG="v${VERSION}"
72
+ # Forgejo 15.0.9: a git push from Actions to a PROTECTED main is attributed to
73
+ # the internal Actions user (uid -2), which the pre-receive hook cannot resolve,
74
+ # so it is refused before the push whitelist is consulted. Commit via the
75
+ # contents API instead - it creates the commit server-side and resolves the
76
+ # author from the token, so a whitelisted write token lands the bump. Set
77
+ # VERSION_PUSH_TOKEN (a repo:write token on main's push whitelist) is REQUIRED,
78
+ # not only when main is protected: measured on Forgejo 15.0.9, the AUTOMATIC
79
+ # Actions token cannot commit through the contents API at all - with
80
+ # permissions: contents: write declared, and on a branch whose rule permits
81
+ # ordinary pushes. There is no automatic-token fallback.
82
+ # Tag the RETURNED commit sha.
83
+ CHANGED="$(git diff --name-only)"
84
+ [ -n "$CHANGED" ] || { echo "cz bump changed no files"; exit 1; }
85
+ python3 - "$TAG" $CHANGED <<'PY'
86
+ import base64, json, os, sys, urllib.request
87
+
88
+ tag, paths = sys.argv[1], sys.argv[2:]
89
+ api = f"{os.environ['GITHUB_SERVER_URL']}/api/v1/repos/{os.environ['GITHUB_REPOSITORY']}"
90
+ tok = os.environ["FJ_TOKEN"]
91
+
92
+ def req(method, path, body=None):
93
+ data = json.dumps(body).encode() if body is not None else None
94
+ r = urllib.request.Request(
95
+ api + path, data=data, method=method,
96
+ headers={"Authorization": f"token {tok}", "Content-Type": "application/json"},
97
+ )
98
+ with urllib.request.urlopen(r) as resp:
99
+ raw = resp.read()
100
+ return json.loads(raw) if raw else None
101
+
102
+ files = []
103
+ for p in paths:
104
+ info = req("GET", f"/contents/{p}?ref=main")
105
+ content = base64.b64encode(open(p, "rb").read()).decode()
106
+ files.append({"operation": "update", "path": p, "content": content, "sha": info["sha"]})
107
+ resp = req("POST", "/contents", {"branch": "main", "message": f"bump: {tag}", "files": files})
108
+ sha = resp["commit"]["sha"]
109
+ req("POST", "/tags", {"tag_name": tag, "target": sha})
110
+ print(f"committed {sha} and tagged {tag}")
111
+ PY
112
+ echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
113
+
114
+ - name: Build
115
+ if: steps.bump.outputs.skipped != 'true'
116
+ run: uv build
117
+
118
+ - name: Create Forgejo release
119
+ if: steps.bump.outputs.skipped != 'true'
120
+ env:
121
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122
+ VERSION: ${{ steps.bump.outputs.version }}
123
+ run: |
124
+ curl -s -X POST "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
125
+ -H "Authorization: token ${GITHUB_TOKEN}" \
126
+ -H "Content-Type: application/json" \
127
+ -d "{\"tag_name\": \"v${VERSION}\", \"name\": \"v${VERSION}\", \"body\": \"Release v${VERSION}\"}"
128
+ [% if enable_pypi_publishing %]
129
+
130
+ - name: Publish to PyPI
131
+ if: steps.bump.outputs.skipped != 'true'
132
+ env:
133
+ UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
134
+ run: uv publish
135
+ [% endif %]
templatepy-0.16.2/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.16.2
@@ -1,85 +0,0 @@
1
- # Forgejo Actions.
2
- #
3
- # THIRD-PARTY ACTIONS ARE REFERENCED BY ABSOLUTE URL, and that is not a style
4
- # choice. On Forgejo a bare `uses: owner/action@ref` is fetched from the
5
- # INSTANCE's actions mirror (`DEFAULT_ACTIONS_URL`), not from GitHub - and the
6
- # mirrors carry different subsets. Measured 2026-10-24 with `git ls-remote`:
7
- #
8
- # code.forgejo.org data.forgejo.org
9
- # actions/checkout resolves resolves
10
- # astral-sh/setup-uv MISSING resolves
11
- # softprops/action-gh-release MISSING MISSING
12
- #
13
- # So a bare third-party reference works on one instance and fails on another,
14
- # and the failure is a `git ls-remote` error naming the actions host - which
15
- # reads as a network fault rather than as a missing mirror entry. An absolute
16
- # URL depends on nothing an instance happens to mirror this month.
17
- #
18
- # `actions/*` stays BARE on purpose: Forgejo mirrors that family deliberately,
19
- # so a bare reference there also works on an instance with no route to GitHub.
20
- name: Release
21
-
22
- on:
23
- push:
24
- branches: [main]
25
- workflow_dispatch:
26
-
27
- permissions:
28
- contents: write
29
-
30
- jobs:
31
- release:
32
- name: Bump, build, publish
33
- runs-on: ubuntu-latest
34
- if: "!startsWith(github.event.head_commit.message, 'bump:')"
35
- steps:
36
- - uses: actions/checkout@v4
37
- with:
38
- fetch-depth: 0
39
-
40
- - name: Configure git identity
41
- run: |
42
- git config user.name "forgejo-actions[bot]"
43
- git config user.email "forgejo-actions[bot]@noreply"
44
-
45
- - uses: https://github.com/astral-sh/setup-uv@v7
46
- with:
47
- python-version: "[[ python_requires ]]"
48
-
49
- - name: Bump version
50
- id: bump
51
- run: |
52
- uvx --from commitizen cz bump --yes || EXIT=$?
53
- if [ "${EXIT:-0}" -eq 21 ] || [ "${EXIT:-0}" -eq 6 ]; then
54
- echo "No bumpable commits since last tag — skipping."
55
- echo "skipped=true" >> "$GITHUB_OUTPUT"
56
- exit 0
57
- fi
58
- [ "${EXIT:-0}" -eq 0 ] || exit $EXIT
59
- VERSION=$(cat VERSION)
60
- git push origin HEAD:main
61
- git push origin "v${VERSION}"
62
- echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
63
-
64
- - name: Build
65
- if: steps.bump.outputs.skipped != 'true'
66
- run: uv build
67
-
68
- - name: Create Forgejo release
69
- if: steps.bump.outputs.skipped != 'true'
70
- env:
71
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72
- VERSION: ${{ steps.bump.outputs.version }}
73
- run: |
74
- curl -s -X POST "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
75
- -H "Authorization: token ${GITHUB_TOKEN}" \
76
- -H "Content-Type: application/json" \
77
- -d "{\"tag_name\": \"v${VERSION}\", \"name\": \"v${VERSION}\", \"body\": \"Release v${VERSION}\"}"
78
- [% if enable_pypi_publishing %]
79
-
80
- - name: Publish to PyPI
81
- if: steps.bump.outputs.skipped != 'true'
82
- env:
83
- UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
84
- run: uv publish
85
- [% endif %]
File without changes
File without changes
File without changes
File without changes
File without changes