dependency-support-policy 0.1.0__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 (81) hide show
  1. dependency_support_policy-0.1.0/.coderabbit.yaml +3 -0
  2. dependency_support_policy-0.1.0/.editorconfig +22 -0
  3. dependency_support_policy-0.1.0/.github/ISSUE_TEMPLATE/bug-report.md +60 -0
  4. dependency_support_policy-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  5. dependency_support_policy-0.1.0/.github/ISSUE_TEMPLATE/feature-request.md +45 -0
  6. dependency_support_policy-0.1.0/.github/pull_request_template.md +11 -0
  7. dependency_support_policy-0.1.0/.github/workflows/ci.yml +289 -0
  8. dependency_support_policy-0.1.0/.github/workflows/codeql.yml +31 -0
  9. dependency_support_policy-0.1.0/.github/workflows/documentation.yml +50 -0
  10. dependency_support_policy-0.1.0/.github/workflows/draft_release.yml +51 -0
  11. dependency_support_policy-0.1.0/.github/workflows/publish_testpypi.yml +85 -0
  12. dependency_support_policy-0.1.0/.github/workflows/release.yml +72 -0
  13. dependency_support_policy-0.1.0/.github/workflows/scheduled_release.yml +156 -0
  14. dependency_support_policy-0.1.0/.github/workflows/semantic_pull_release.yml +23 -0
  15. dependency_support_policy-0.1.0/.github/workflows/support_floor_update.yml +59 -0
  16. dependency_support_policy-0.1.0/.github/zizmor.yml +18 -0
  17. dependency_support_policy-0.1.0/.gitignore +27 -0
  18. dependency_support_policy-0.1.0/.markdownlint.yaml +45 -0
  19. dependency_support_policy-0.1.0/.pre-commit-config.yaml +82 -0
  20. dependency_support_policy-0.1.0/.prettierignore +5 -0
  21. dependency_support_policy-0.1.0/.prettierrc.yaml +7 -0
  22. dependency_support_policy-0.1.0/CODE_OF_CONDUCT.md +130 -0
  23. dependency_support_policy-0.1.0/CONTRIBUTING.md +56 -0
  24. dependency_support_policy-0.1.0/LICENSE +28 -0
  25. dependency_support_policy-0.1.0/PKG-INFO +253 -0
  26. dependency_support_policy-0.1.0/README.md +230 -0
  27. dependency_support_policy-0.1.0/SECURITY.md +21 -0
  28. dependency_support_policy-0.1.0/action.yml +175 -0
  29. dependency_support_policy-0.1.0/cliff.toml +105 -0
  30. dependency_support_policy-0.1.0/docs/contributing.md +1 -0
  31. dependency_support_policy-0.1.0/docs/index.md +44 -0
  32. dependency_support_policy-0.1.0/docs/reference/index.md +44 -0
  33. dependency_support_policy-0.1.0/docs/security.md +1 -0
  34. dependency_support_policy-0.1.0/docs/user-guide/ci-recommendations.md +51 -0
  35. dependency_support_policy-0.1.0/docs/user-guide/cli.md +79 -0
  36. dependency_support_policy-0.1.0/docs/user-guide/configuration.md +62 -0
  37. dependency_support_policy-0.1.0/docs/user-guide/ecosystem-packages.md +70 -0
  38. dependency_support_policy-0.1.0/docs/user-guide/github-action.md +71 -0
  39. dependency_support_policy-0.1.0/docs/user-guide/limitations.md +22 -0
  40. dependency_support_policy-0.1.0/docs/user-guide/lockfile.md +20 -0
  41. dependency_support_policy-0.1.0/docs/user-guide/renovate.md +56 -0
  42. dependency_support_policy-0.1.0/docs/user-guide/support-window-model.md +65 -0
  43. dependency_support_policy-0.1.0/examples/workflows/pr-compliance-check.yml +26 -0
  44. dependency_support_policy-0.1.0/examples/workflows/scheduled-floor-update.yml +45 -0
  45. dependency_support_policy-0.1.0/examples/workflows/update-with-lockfile.yml +49 -0
  46. dependency_support_policy-0.1.0/pyproject.toml +126 -0
  47. dependency_support_policy-0.1.0/renovate.json +52 -0
  48. dependency_support_policy-0.1.0/src/dependency_support_policy/__init__.py +12 -0
  49. dependency_support_policy-0.1.0/src/dependency_support_policy/__main__.py +8 -0
  50. dependency_support_policy-0.1.0/src/dependency_support_policy/cli.py +220 -0
  51. dependency_support_policy-0.1.0/src/dependency_support_policy/config.py +195 -0
  52. dependency_support_policy-0.1.0/src/dependency_support_policy/dates.py +31 -0
  53. dependency_support_policy-0.1.0/src/dependency_support_policy/errors.py +23 -0
  54. dependency_support_policy-0.1.0/src/dependency_support_policy/lockfile.py +45 -0
  55. dependency_support_policy-0.1.0/src/dependency_support_policy/planner.py +248 -0
  56. dependency_support_policy-0.1.0/src/dependency_support_policy/policies.py +86 -0
  57. dependency_support_policy-0.1.0/src/dependency_support_policy/pyproject_edit.py +140 -0
  58. dependency_support_policy-0.1.0/src/dependency_support_policy/python_releases.py +55 -0
  59. dependency_support_policy-0.1.0/src/dependency_support_policy/registry.py +146 -0
  60. dependency_support_policy-0.1.0/src/dependency_support_policy/requirements.py +204 -0
  61. dependency_support_policy-0.1.0/tests/__init__.py +0 -0
  62. dependency_support_policy-0.1.0/tests/conftest.py +47 -0
  63. dependency_support_policy-0.1.0/tests/data/action/compliant/pyproject.toml +5 -0
  64. dependency_support_policy-0.1.0/tests/data/action/dep-update/pyproject.toml +7 -0
  65. dependency_support_policy-0.1.0/tests/data/action/invalid-config/pyproject.toml +7 -0
  66. dependency_support_policy-0.1.0/tests/data/action/python-update/pyproject.toml +5 -0
  67. dependency_support_policy-0.1.0/tests/data/action/with-lock/pyproject.toml +7 -0
  68. dependency_support_policy-0.1.0/tests/data/action/with-lock/uv.lock +28 -0
  69. dependency_support_policy-0.1.0/tests/smoke_test.py +74 -0
  70. dependency_support_policy-0.1.0/tests/test_cli.py +196 -0
  71. dependency_support_policy-0.1.0/tests/test_config.py +121 -0
  72. dependency_support_policy-0.1.0/tests/test_dates.py +47 -0
  73. dependency_support_policy-0.1.0/tests/test_lockfile.py +70 -0
  74. dependency_support_policy-0.1.0/tests/test_planner.py +247 -0
  75. dependency_support_policy-0.1.0/tests/test_policies.py +62 -0
  76. dependency_support_policy-0.1.0/tests/test_pyproject_edit.py +145 -0
  77. dependency_support_policy-0.1.0/tests/test_python_releases.py +40 -0
  78. dependency_support_policy-0.1.0/tests/test_registry.py +143 -0
  79. dependency_support_policy-0.1.0/tests/test_requirements.py +140 -0
  80. dependency_support_policy-0.1.0/uv.lock +886 -0
  81. dependency_support_policy-0.1.0/zensical.toml +95 -0
@@ -0,0 +1,3 @@
1
+ reviews:
2
+ auto_review:
3
+ enabled: false
@@ -0,0 +1,22 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 4
10
+
11
+ [*.py]
12
+ indent_size = 4
13
+ max_line_length = 120
14
+
15
+ [*.{yml,yaml,json,md}]
16
+ indent_size = 4
17
+
18
+ [*.toml]
19
+ indent_size = 2
20
+
21
+ [Makefile]
22
+ indent_style = tab
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: 🐛 Bug Report
3
+ about: Create a report to help us improve
4
+ title: '[BUG]: '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## 📝 Description
10
+
11
+ A clear and concise description of what the bug is.
12
+
13
+ ## 🚀 Reproduction Steps
14
+
15
+ Steps to reproduce the behavior:
16
+
17
+ 1. '...'
18
+ 2. '...'
19
+ 3. '...'
20
+
21
+ ## 💻 Minimal Reproducible Example
22
+
23
+ Please provide the smallest `pyproject.toml` (and configuration) that
24
+ demonstrates the issue, plus the exact CLI command or workflow snippet:
25
+
26
+ ```toml
27
+ # pyproject.toml
28
+ ```
29
+
30
+ ```bash
31
+ dependency-support-policy check --reference-date 2026-01-01
32
+ ```
33
+
34
+ ## 📋 Expected Behavior
35
+
36
+ A clear and concise description of what you expected to happen (e.g. the
37
+ floor you expected the policy to compute).
38
+
39
+ ## 💥 Actual Behavior / Output
40
+
41
+ Add the CLI output, change-plan JSON, or workflow log here **after redacting
42
+ secrets** (API keys, tokens, credentials, private URLs/paths, personal data).
43
+ If this is a potential security vulnerability, do **not** post it publicly;
44
+ use the Security reporting channel instead.
45
+
46
+ ```text
47
+
48
+ ```
49
+
50
+ ## 🛠 Environment Information
51
+
52
+ - **Python Version:** (e.g., 3.13)
53
+ - **Package / Action Version:** (e.g., 0.1.0 or the `uses:` ref)
54
+ - **uv Version:** (e.g., 0.9.0, if lockfile handling is involved)
55
+ - **Operating System:** (e.g., Windows 11, Ubuntu 22.04, macOS)
56
+ - **Where it runs:** (CLI locally, GitHub Actions, other CI)
57
+
58
+ ## 📎 Additional Context
59
+
60
+ Add any other context about the problem here (e.g., screenshots, logs).
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: 🛡️ Security Vulnerability
4
+ url: https://github.com/isaac-cf-wong/dependency-support-policy-action/security/advisories/new
5
+ about: Please report security vulnerabilities privately here, not as public issues.
6
+ - name: 💬 Questions & Discussions
7
+ url: https://github.com/isaac-cf-wong/dependency-support-policy-action/discussions
8
+ about: Please ask and answer questions here.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: ✨ Feature Request
3
+ about: Suggest an idea or improvement for this project
4
+ title: '[FEATURE]: '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## 🎯 Problem Statement
10
+
11
+ Is your feature request related to a problem? Please describe.
12
+
13
+ > _Ex: "I need a support policy with a fixed number of minor series instead
14
+ > of a time window..."_
15
+
16
+ ## 💡 Proposed Solution
17
+
18
+ A clear and concise description of what you want to happen. Describe the new
19
+ functionality or the change to existing behavior.
20
+
21
+ ## 💻 Proposed Configuration / Usage Example
22
+
23
+ If applicable, show how you would imagine using the feature — CLI flags,
24
+ `[tool.dependency-support-policy]` keys, or action inputs:
25
+
26
+ ```yaml
27
+ - uses: isaac-cf-wong/dependency-support-policy-action@v1
28
+ with:
29
+ # how you'd like to use the new feature
30
+ ```
31
+
32
+ ## 🌈 Use Case & Benefits
33
+
34
+ Why is this feature important to you and other users? How does it improve the
35
+ project?
36
+
37
+ ## 🔄 Alternatives Considered
38
+
39
+ A clear and concise description of any alternative solutions or workarounds
40
+ you've considered.
41
+
42
+ ## ⚠️ Additional Context
43
+
44
+ Add any other context, screenshots, or links to similar implementations in
45
+ other tools here.
@@ -0,0 +1,11 @@
1
+ # Description
2
+
3
+ <!-- What does this PR change, and why? -->
4
+
5
+ ## Checklist
6
+
7
+ - [ ] PR title follows [Conventional Commits](https://www.conventionalcommits.org/)
8
+ - [ ] `uv run pre-commit run --all-files` passes
9
+ - [ ] `uv run pytest` passes (new behaviour is covered by tests)
10
+ - [ ] `uv run mypy src` passes
11
+ - [ ] Documentation updated where relevant
@@ -0,0 +1,289 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+ workflow_call:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ zizmor:
15
+ # pre-commit.ci cannot run the zizmor hook (language: system), so the
16
+ # workflow security audit runs here instead.
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
25
+ with:
26
+ python-version: '3.13'
27
+ enable-cache: 'true'
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --group dev --frozen
31
+
32
+ - name: Run zizmor
33
+ run: uv run --frozen zizmor .github/workflows action.yml
34
+
35
+ test:
36
+ strategy:
37
+ matrix:
38
+ # Locked, minimum (lowest-direct), and latest (highest)
39
+ # resolutions run on ubuntu; macos runs highest only, on the
40
+ # assumption that resolution behaviour is OS-independent.
41
+ python-version: ['3.12', '3.13', '3.14']
42
+ os: [ubuntu-latest]
43
+ resolution: [locked, lowest-direct, highest]
44
+ include:
45
+ - os: macos-latest
46
+ python-version: '3.12'
47
+ resolution: highest
48
+ - os: macos-latest
49
+ python-version: '3.13'
50
+ resolution: highest
51
+ - os: macos-latest
52
+ python-version: '3.14'
53
+ resolution: highest
54
+ runs-on: ${{ matrix.os }}
55
+ steps:
56
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
57
+ with:
58
+ persist-credentials: false
59
+
60
+ - name: Install uv
61
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
62
+ with:
63
+ python-version: ${{ matrix.python-version }}
64
+ enable-cache: 'true'
65
+
66
+ - name: Install dependencies
67
+ env:
68
+ RESOLUTION: ${{ matrix.resolution }}
69
+ run: |
70
+ case "$RESOLUTION" in
71
+ locked) uv sync --group dev --frozen ;;
72
+ lowest-direct) uv sync --group dev --upgrade --resolution lowest-direct ;;
73
+ highest) uv sync --group dev --upgrade ;;
74
+ esac
75
+
76
+ - name: Run tests with pytest
77
+ run: uv run --no-sync pytest
78
+
79
+ typecheck:
80
+ runs-on: ubuntu-latest
81
+ steps:
82
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
83
+ with:
84
+ persist-credentials: false
85
+
86
+ - name: Install uv
87
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
88
+ with:
89
+ python-version: '3.13'
90
+ enable-cache: 'true'
91
+
92
+ - name: Install dependencies
93
+ run: uv sync --group dev --frozen
94
+
95
+ - name: Run mypy
96
+ run: uv run --frozen mypy src
97
+
98
+ build:
99
+ runs-on: ubuntu-latest
100
+ steps:
101
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
102
+ with:
103
+ persist-credentials: false
104
+
105
+ - name: Install uv
106
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
107
+ with:
108
+ python-version: '3.13'
109
+ enable-cache: 'true'
110
+
111
+ - name: Build distributions
112
+ run: uv build
113
+
114
+ action-compliant:
115
+ name: action test / compliant project
116
+ runs-on: ubuntu-latest
117
+ steps:
118
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
119
+ with:
120
+ persist-credentials: false
121
+
122
+ - name: Run action (check mode)
123
+ id: policy
124
+ uses: ./
125
+ with:
126
+ mode: check
127
+ working-directory: tests/data/action/compliant
128
+ reference-date: '2025-01-01'
129
+
130
+ - name: Assert no drift reported
131
+ env:
132
+ CHANGED: ${{ steps.policy.outputs.changed }}
133
+ PY_CHANGED: ${{ steps.policy.outputs.python-floor-changed }}
134
+ run: |
135
+ test "$CHANGED" = "false"
136
+ test "$PY_CHANGED" = "false"
137
+
138
+ action-dep-update:
139
+ name: action test / dependency floor update
140
+ runs-on: ubuntu-latest
141
+ steps:
142
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
143
+ with:
144
+ persist-credentials: false
145
+
146
+ - name: Run action (update mode)
147
+ id: policy
148
+ uses: ./
149
+ with:
150
+ mode: update
151
+ working-directory: tests/data/action/dep-update
152
+ reference-date: '2025-01-01'
153
+
154
+ - name: Assert dependency floor updated
155
+ env:
156
+ CHANGED: ${{ steps.policy.outputs.changed }}
157
+ PY_CHANGED: ${{ steps.policy.outputs.python-floor-changed }}
158
+ FLOORS: ${{ steps.policy.outputs.dependency-floors-changed }}
159
+ FILES: ${{ steps.policy.outputs.files-changed }}
160
+ run: |
161
+ test "$CHANGED" = "true"
162
+ test "$PY_CHANGED" = "false"
163
+ echo "$FLOORS" | jq -e '.[] | select(.name == "numpy" and .new == "1.25.0")'
164
+ echo "$FILES" | jq -e '. == ["pyproject.toml"]'
165
+ grep -F '"numpy>=1.25.0", # comment must survive' tests/data/action/dep-update/pyproject.toml
166
+
167
+ action-python-update:
168
+ name: action test / python floor update
169
+ runs-on: ubuntu-latest
170
+ steps:
171
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
172
+ with:
173
+ persist-credentials: false
174
+
175
+ - name: Run action (update mode)
176
+ id: policy
177
+ uses: ./
178
+ with:
179
+ mode: update
180
+ working-directory: tests/data/action/python-update
181
+ reference-date: '2025-01-01'
182
+
183
+ - name: Assert python floor updated
184
+ env:
185
+ CHANGED: ${{ steps.policy.outputs.changed }}
186
+ PY_CHANGED: ${{ steps.policy.outputs.python-floor-changed }}
187
+ PLAN: ${{ steps.policy.outputs.plan }}
188
+ run: |
189
+ test "$CHANGED" = "true"
190
+ test "$PY_CHANGED" = "true"
191
+ echo "$PLAN" | jq -e '.python_change.new_requires_python == ">=3.11"'
192
+ grep -F 'requires-python = ">=3.11"' tests/data/action/python-update/pyproject.toml
193
+
194
+ action-with-lock:
195
+ name: action test / uv.lock regeneration
196
+ runs-on: ubuntu-latest
197
+ steps:
198
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
199
+ with:
200
+ persist-credentials: false
201
+
202
+ - name: Run action (update mode with lock)
203
+ id: policy
204
+ uses: ./
205
+ with:
206
+ mode: update
207
+ working-directory: tests/data/action/with-lock
208
+ reference-date: '2025-01-01'
209
+ lock: minimal
210
+
211
+ - name: Assert lockfile regenerated and consistent
212
+ env:
213
+ FILES: ${{ steps.policy.outputs.files-changed }}
214
+ run: |
215
+ echo "$FILES" | jq -e '. == ["pyproject.toml", "uv.lock"]'
216
+ grep -F '"numpy>=1.25.0"' tests/data/action/with-lock/pyproject.toml
217
+ ! grep -F 'version = "1.24.4"' tests/data/action/with-lock/uv.lock
218
+ uv lock --check --project tests/data/action/with-lock
219
+
220
+ action-check-outdated:
221
+ name: action test / check-only mode
222
+ runs-on: ubuntu-latest
223
+ steps:
224
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
225
+ with:
226
+ persist-credentials: false
227
+
228
+ - name: Run action (check mode, expected to fail)
229
+ id: check
230
+ continue-on-error: true
231
+ uses: ./
232
+ with:
233
+ mode: check
234
+ working-directory: tests/data/action/dep-update
235
+ reference-date: '2025-01-01'
236
+
237
+ - name: Run action (check mode, fail-on-outdated disabled)
238
+ id: check-soft
239
+ uses: ./
240
+ with:
241
+ mode: check
242
+ working-directory: tests/data/action/dep-update
243
+ reference-date: '2025-01-01'
244
+ fail-on-outdated: 'false'
245
+
246
+ - name: Assert check semantics
247
+ env:
248
+ CHECK_OUTCOME: ${{ steps.check.outcome }}
249
+ CHECK_CHANGED: ${{ steps.check.outputs.changed }}
250
+ SOFT_CHANGED: ${{ steps.check-soft.outputs.changed }}
251
+ run: |
252
+ test "$CHECK_OUTCOME" = "failure"
253
+ test "$CHECK_CHANGED" = "true"
254
+ test "$SOFT_CHANGED" = "true"
255
+ # check mode must not modify the repository
256
+ git diff --exit-code tests/data/action/dep-update
257
+
258
+ action-invalid-config:
259
+ name: action test / invalid configuration
260
+ runs-on: ubuntu-latest
261
+ steps:
262
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
263
+ with:
264
+ persist-credentials: false
265
+
266
+ - name: Run action (invalid config, expected to fail)
267
+ id: invalid
268
+ continue-on-error: true
269
+ uses: ./
270
+ with:
271
+ mode: check
272
+ working-directory: tests/data/action/invalid-config
273
+ reference-date: '2025-01-01'
274
+
275
+ - name: Run action (invalid mode, expected to fail)
276
+ id: bad-mode
277
+ continue-on-error: true
278
+ uses: ./
279
+ with:
280
+ mode: destroy
281
+ working-directory: tests/data/action/compliant
282
+
283
+ - name: Assert failures
284
+ env:
285
+ INVALID_OUTCOME: ${{ steps.invalid.outcome }}
286
+ BAD_MODE_OUTCOME: ${{ steps.bad-mode.outcome }}
287
+ run: |
288
+ test "$INVALID_OUTCOME" = "failure"
289
+ test "$BAD_MODE_OUTCOME" = "failure"
@@ -0,0 +1,31 @@
1
+ name: CodeQL
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+ workflow_call:
9
+
10
+ permissions:
11
+ security-events: write
12
+
13
+ jobs:
14
+ codeql:
15
+ name: codeql
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
19
+ with:
20
+ persist-credentials: false
21
+
22
+ - name: Initialize CodeQL
23
+ uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
24
+ with:
25
+ languages: python
26
+
27
+ - name: Autobuild
28
+ uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
29
+
30
+ - name: Perform CodeQL Analysis
31
+ uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4
@@ -0,0 +1,50 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 15
21
+ environment:
22
+ name: github-pages
23
+ url: ${{ steps.deployment.outputs.page_url }}
24
+ steps:
25
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
31
+ with:
32
+ python-version: '3.13'
33
+ enable-cache: 'true'
34
+
35
+ - name: Install dependencies
36
+ run: uv sync --group docs --frozen
37
+
38
+ - run: uv run --frozen zensical build
39
+
40
+ - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
41
+ with:
42
+ path: site
43
+ # Attempt-scoped so "Re-run failed jobs" does not leave two
44
+ # same-named artifacts in the run, which deploy-pages rejects.
45
+ name: github-pages-${{ github.run_attempt }}
46
+
47
+ - id: deployment
48
+ uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
49
+ with:
50
+ artifact_name: github-pages-${{ github.run_attempt }}
@@ -0,0 +1,51 @@
1
+ name: Draft Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: read
10
+
11
+ concurrency:
12
+ group: draft-release
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ draft-release:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
20
+ with:
21
+ fetch-depth: 0
22
+ persist-credentials: false
23
+
24
+ - name: Generate changelog
25
+ id: changelog
26
+ uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
27
+ with:
28
+ config: cliff.toml
29
+ args: --unreleased --verbose
30
+ env:
31
+ OUTPUT: CHANGELOG.md
32
+
33
+ - name: Delete existing draft release
34
+ continue-on-error: true
35
+ run: |
36
+ gh release delete next-release --yes --repo "$GITHUB_REPOSITORY"
37
+ env:
38
+ GH_TOKEN: ${{ github.token }}
39
+
40
+ - name: Create or Update Draft Release
41
+ uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
42
+ with:
43
+ tag_name: next-release
44
+ name: 'Next Release (Draft)'
45
+ body: |
46
+ ${{ steps.changelog.outputs.content }}
47
+
48
+ ---
49
+ *This is an automatically generated draft release.*
50
+ draft: true
51
+ prerelease: false
@@ -0,0 +1,85 @@
1
+ name: Publish to TestPyPI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag_name:
10
+ description: 'Tag name for the publish (e.g., v1.2.3)'
11
+ required: false
12
+ type: string
13
+ workflow_call:
14
+ inputs:
15
+ tag_name:
16
+ description: 'Tag name for the publish (e.g., v1.2.3)'
17
+ required: false
18
+ type: string
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ jobs:
24
+ publish:
25
+ runs-on: ubuntu-latest
26
+ environment:
27
+ name: testpypi
28
+ permissions:
29
+ id-token: write
30
+ contents: read
31
+ steps:
32
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
33
+ with:
34
+ ref: ${{ inputs.tag_name || github.sha }}
35
+ fetch-depth: 0
36
+ persist-credentials: false
37
+
38
+ - name: Output build information
39
+ env:
40
+ REF_NAME: ${{ inputs.tag_name || github.sha }}
41
+ run: |
42
+ {
43
+ echo "### Publishing Build :package:"
44
+ echo "- **Ref**: $REF_NAME"
45
+ } >> "$GITHUB_STEP_SUMMARY"
46
+
47
+ - name: Install uv
48
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
49
+ with:
50
+ python-version: '3.13'
51
+ enable-cache: 'true'
52
+
53
+ - name: Install dependencies
54
+ run: uv sync --group dev --frozen
55
+
56
+ - name: Set version for publishing
57
+ env:
58
+ TAG_NAME: ${{ inputs.tag_name }}
59
+ run: |
60
+ if [ -n "$TAG_NAME" ]; then
61
+ # Use the tag, stripping the 'v' prefix if present
62
+ VERSION="${TAG_NAME#v}"
63
+ else
64
+ # For untagged builds, take the dynamic version and strip
65
+ # the +local part, which TestPyPI rejects
66
+ VERSION=$(uv run --frozen python -c 'from importlib.metadata import version; print(version("dependency-support-policy"))' | sed 's/+.*//')
67
+ fi
68
+ echo "Publishing version $VERSION"
69
+
70
+ # Pin the version statically for this build
71
+ sed -i "s/dynamic = \[\"version\"\]/version = \"$VERSION\"\ndynamic = []/" pyproject.toml
72
+
73
+ - name: Build distribution
74
+ run: uv build
75
+
76
+ - name: Smoke test (wheel)
77
+ run: uv run --isolated --no-project --with dist/*.whl
78
+ tests/smoke_test.py
79
+
80
+ - name: Smoke test (source distribution)
81
+ run: uv run --isolated --no-project --with dist/*.tar.gz
82
+ tests/smoke_test.py
83
+
84
+ - name: Publish to TestPyPI
85
+ run: uv publish --index testpypi