templatepy 0.16.2__tar.gz → 0.16.3__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 (45) hide show
  1. {templatepy-0.16.2 → templatepy-0.16.3}/PKG-INFO +1 -1
  2. templatepy-0.16.3/VERSION +1 -0
  3. {templatepy-0.16.2 → templatepy-0.16.3}/pyproject.toml +1 -1
  4. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/release.yml +42 -4
  5. templatepy-0.16.2/VERSION +0 -1
  6. {templatepy-0.16.2 → templatepy-0.16.3}/.gitignore +0 -0
  7. {templatepy-0.16.2 → templatepy-0.16.3}/CITATION.cff +0 -0
  8. {templatepy-0.16.2 → templatepy-0.16.3}/LICENSE +0 -0
  9. {templatepy-0.16.2 → templatepy-0.16.3}/README.md +0 -0
  10. {templatepy-0.16.2 → templatepy-0.16.3}/copier.yaml +0 -0
  11. {templatepy-0.16.2 → templatepy-0.16.3}/src/templatepy/__init__.py +0 -0
  12. {templatepy-0.16.2 → templatepy-0.16.3}/template/.githooks/fix_commit_msg.py +0 -0
  13. {templatepy-0.16.2 → templatepy-0.16.3}/template/.gitignore +0 -0
  14. {templatepy-0.16.2 → templatepy-0.16.3}/template/.gitleaks.toml +0 -0
  15. {templatepy-0.16.2 → templatepy-0.16.3}/template/.gitlint +0 -0
  16. {templatepy-0.16.2 → templatepy-0.16.3}/template/.pre-commit-config.yaml +0 -0
  17. {templatepy-0.16.2 → templatepy-0.16.3}/template/CITATION.cff +0 -0
  18. {templatepy-0.16.2 → templatepy-0.16.3}/template/CODE_OF_CONDUCT.md +0 -0
  19. {templatepy-0.16.2 → templatepy-0.16.3}/template/CONTRIBUTING.md +0 -0
  20. {templatepy-0.16.2 → templatepy-0.16.3}/template/LICENSE +0 -0
  21. {templatepy-0.16.2 → templatepy-0.16.3}/template/README.md +0 -0
  22. {templatepy-0.16.2 → templatepy-0.16.3}/template/VERSION +0 -0
  23. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/[% if enable_docs_publishing %]docs.yml[% endif %] +0 -0
  24. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/[% if enable_llm_pr_review %]pr-review.yml[% endif %] +0 -0
  25. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['forgejo','both'] %].forgejo[% endif %]/workflows/ci.yml +0 -0
  26. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/ISSUE_TEMPLATE/bug_report.md +0 -0
  27. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/ISSUE_TEMPLATE/feature_request.md +0 -0
  28. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/PULL_REQUEST_TEMPLATE.md +0 -0
  29. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/[% if enable_docs_publishing %]docs.yml[% endif %] +0 -0
  30. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/[% if enable_llm_pr_review %]pr-review.yml[% endif %] +0 -0
  31. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/ci.yml +0 -0
  32. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/release.yml +0 -0
  33. {templatepy-0.16.2 → templatepy-0.16.3}/template/[% if ci_platform in ['github','both'] %].github[% endif %]/workflows/versioning.yml +0 -0
  34. {templatepy-0.16.2 → templatepy-0.16.3}/template/[[ _copier_conf.answers_file ]] +0 -0
  35. {templatepy-0.16.2 → templatepy-0.16.3}/template/docs/index.md +0 -0
  36. {templatepy-0.16.2 → templatepy-0.16.3}/template/docs/repository-setup.md +0 -0
  37. {templatepy-0.16.2 → templatepy-0.16.3}/template/mkdocs.yml +0 -0
  38. {templatepy-0.16.2 → templatepy-0.16.3}/template/pyproject.toml +0 -0
  39. {templatepy-0.16.2 → templatepy-0.16.3}/template/scripts/setup_branch_protection.sh +0 -0
  40. {templatepy-0.16.2 → templatepy-0.16.3}/template/scripts/setup_repo.sh +0 -0
  41. {templatepy-0.16.2 → templatepy-0.16.3}/template/src/[[ project_slug ]]/__init__.py +0 -0
  42. {templatepy-0.16.2 → templatepy-0.16.3}/template/src/[[ project_slug ]]/py.typed +0 -0
  43. {templatepy-0.16.2 → templatepy-0.16.3}/template/tests/conftest.py +0 -0
  44. {templatepy-0.16.2 → templatepy-0.16.3}/template/tests/integration/test_integration_placeholder.py +0 -0
  45. {templatepy-0.16.2 → templatepy-0.16.3}/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.3
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.3
@@ -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.3"
55
55
  version_files = ["VERSION"]
56
56
  tag_format = "v$version"
57
57
  update_changelog_on_bump = false
@@ -36,6 +36,7 @@ jobs:
36
36
  - uses: actions/checkout@v4
37
37
  with:
38
38
  fetch-depth: 0
39
+ token: ${{ secrets.VERSION_PUSH_TOKEN || github.token }}
39
40
 
40
41
  - name: Configure git identity
41
42
  run: |
@@ -48,17 +49,54 @@ jobs:
48
49
 
49
50
  - name: Bump version
50
51
  id: bump
52
+ env:
53
+ FJ_TOKEN: ${{ secrets.VERSION_PUSH_TOKEN || github.token }}
51
54
  run: |
52
- uvx --from commitizen cz bump --yes || EXIT=$?
55
+ uvx --from commitizen cz bump --files-only --yes || EXIT=$?
53
56
  if [ "${EXIT:-0}" -eq 21 ] || [ "${EXIT:-0}" -eq 6 ]; then
54
57
  echo "No bumpable commits since last tag — skipping."
55
58
  echo "skipped=true" >> "$GITHUB_OUTPUT"
56
59
  exit 0
57
60
  fi
58
61
  [ "${EXIT:-0}" -eq 0 ] || exit $EXIT
59
- VERSION=$(cat VERSION)
60
- git push origin HEAD:main
61
- git push origin "v${VERSION}"
62
+ VERSION="$(cat VERSION)"
63
+ TAG="v${VERSION}"
64
+ # Forgejo 15.0.9: a git push from Actions to a PROTECTED main is attributed to
65
+ # the internal Actions user (uid -2), which the pre-receive hook cannot resolve,
66
+ # so it is refused before the push whitelist is consulted. Commit via the
67
+ # contents API instead - it creates the commit server-side and resolves the
68
+ # author from the token, so a whitelisted write token lands the bump. Set
69
+ # VERSION_PUSH_TOKEN (a repo:write token on main's push whitelist) when main is
70
+ # protected; otherwise the automatic token works. Tag the RETURNED commit sha.
71
+ CHANGED="$(git diff --name-only)"
72
+ [ -n "$CHANGED" ] || { echo "cz bump changed no files"; exit 1; }
73
+ python3 - "$TAG" $CHANGED <<'PY'
74
+ import base64, json, os, sys, urllib.request
75
+
76
+ tag, paths = sys.argv[1], sys.argv[2:]
77
+ api = f"{os.environ['GITHUB_SERVER_URL']}/api/v1/repos/{os.environ['GITHUB_REPOSITORY']}"
78
+ tok = os.environ["FJ_TOKEN"]
79
+
80
+ def req(method, path, body=None):
81
+ data = json.dumps(body).encode() if body is not None else None
82
+ r = urllib.request.Request(
83
+ api + path, data=data, method=method,
84
+ headers={"Authorization": f"token {tok}", "Content-Type": "application/json"},
85
+ )
86
+ with urllib.request.urlopen(r) as resp:
87
+ raw = resp.read()
88
+ return json.loads(raw) if raw else None
89
+
90
+ files = []
91
+ for p in paths:
92
+ info = req("GET", f"/contents/{p}?ref=main")
93
+ content = base64.b64encode(open(p, "rb").read()).decode()
94
+ files.append({"operation": "update", "path": p, "content": content, "sha": info["sha"]})
95
+ resp = req("POST", "/contents", {"branch": "main", "message": f"bump: {tag}", "files": files})
96
+ sha = resp["commit"]["sha"]
97
+ req("POST", "/tags", {"tag_name": tag, "target": sha})
98
+ print(f"committed {sha} and tagged {tag}")
99
+ PY
62
100
  echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
63
101
 
64
102
  - name: Build
templatepy-0.16.2/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.16.2
File without changes
File without changes
File without changes
File without changes
File without changes