gwmock-benchmark 0.2.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 (106) hide show
  1. gwmock_benchmark-0.2.0/.coderabbit.yaml +3 -0
  2. gwmock_benchmark-0.2.0/.github/ISSUE_TEMPLATE/bug-report.md +56 -0
  3. gwmock_benchmark-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. gwmock_benchmark-0.2.0/.github/ISSUE_TEMPLATE/feature-request.md +47 -0
  5. gwmock_benchmark-0.2.0/.github/pull_request_template.md +40 -0
  6. gwmock_benchmark-0.2.0/.github/workflows/ci.yml +81 -0
  7. gwmock_benchmark-0.2.0/.github/workflows/codeql.yml +34 -0
  8. gwmock_benchmark-0.2.0/.github/workflows/documentation.yml +49 -0
  9. gwmock_benchmark-0.2.0/.github/workflows/draft_release.yml +50 -0
  10. gwmock_benchmark-0.2.0/.github/workflows/publish.yml +70 -0
  11. gwmock_benchmark-0.2.0/.github/workflows/publish_testpypi.yml +84 -0
  12. gwmock_benchmark-0.2.0/.github/workflows/release.yml +58 -0
  13. gwmock_benchmark-0.2.0/.github/workflows/scheduled_release.yml +143 -0
  14. gwmock_benchmark-0.2.0/.github/workflows/semantic_pull_request.yml +20 -0
  15. gwmock_benchmark-0.2.0/.gitignore +139 -0
  16. gwmock_benchmark-0.2.0/.markdownlint.yaml +48 -0
  17. gwmock_benchmark-0.2.0/.pre-commit-config.yaml +61 -0
  18. gwmock_benchmark-0.2.0/.prettierrc +7 -0
  19. gwmock_benchmark-0.2.0/.pypirc +10 -0
  20. gwmock_benchmark-0.2.0/.typos.toml +27 -0
  21. gwmock_benchmark-0.2.0/CITATION.cff +15 -0
  22. gwmock_benchmark-0.2.0/CODE_OF_CONDUCT.md +131 -0
  23. gwmock_benchmark-0.2.0/CONTRIBUTING.md +172 -0
  24. gwmock_benchmark-0.2.0/LICENSE +674 -0
  25. gwmock_benchmark-0.2.0/PKG-INFO +121 -0
  26. gwmock_benchmark-0.2.0/README.md +94 -0
  27. gwmock_benchmark-0.2.0/SECURITY.md +53 -0
  28. gwmock_benchmark-0.2.0/SUPPORT.md +38 -0
  29. gwmock_benchmark-0.2.0/cliff.toml +126 -0
  30. gwmock_benchmark-0.2.0/data/README.md +48 -0
  31. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomD.json +38 -0
  32. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomD_NRTidalv2.json +38 -0
  33. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomHM.json +38 -0
  34. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomPv2.json +38 -0
  35. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomXAS.json +38 -0
  36. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomXAS_NRTidalv3.json +38 -0
  37. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomXHM.json +38 -0
  38. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomXP.json +38 -0
  39. gwmock_benchmark-0.2.0/data/signal/consistency/IMRPhenomXPHM.json +38 -0
  40. gwmock_benchmark-0.2.0/data/signal/performance/lal_per-event_amd-epyc-7643-48-core-processor.json +56 -0
  41. gwmock_benchmark-0.2.0/data/signal/performance/lal_per-event_intel-r-core-tm-i7-4770k-cpu-3-50ghz.json +56 -0
  42. gwmock_benchmark-0.2.0/data/signal/performance/pycbc_per-event_amd-epyc-7643-48-core-processor.json +56 -0
  43. gwmock_benchmark-0.2.0/data/signal/performance/pycbc_per-event_intel-r-core-tm-i7-4770k-cpu-3-50ghz.json +56 -0
  44. gwmock_benchmark-0.2.0/data/signal/performance/ripple_batched_amd-epyc-7643-48-core-processor.json +56 -0
  45. gwmock_benchmark-0.2.0/data/signal/performance/ripple_batched_intel-r-core-tm-i7-4770k-cpu-3-50ghz.json +56 -0
  46. gwmock_benchmark-0.2.0/data/signal/performance/ripple_batched_nvidia-a30.json +55 -0
  47. gwmock_benchmark-0.2.0/data/signal/performance/ripple_batched_nvidia-geforce-rtx-5060-ti.json +55 -0
  48. gwmock_benchmark-0.2.0/data/signal/performance/ripple_per-event_amd-epyc-7643-48-core-processor.json +56 -0
  49. gwmock_benchmark-0.2.0/data/signal/performance/ripple_per-event_intel-r-core-tm-i7-4770k-cpu-3-50ghz.json +56 -0
  50. gwmock_benchmark-0.2.0/docs/api/index.md +18 -0
  51. gwmock_benchmark-0.2.0/docs/api/utils/index.md +19 -0
  52. gwmock_benchmark-0.2.0/docs/api/utils/log.md +17 -0
  53. gwmock_benchmark-0.2.0/docs/contribute.md +99 -0
  54. gwmock_benchmark-0.2.0/docs/contributing.md +1 -0
  55. gwmock_benchmark-0.2.0/docs/gen_ref_pages.py +95 -0
  56. gwmock_benchmark-0.2.0/docs/index.md +1 -0
  57. gwmock_benchmark-0.2.0/docs/javascripts/benchmark-charts.js +677 -0
  58. gwmock_benchmark-0.2.0/docs/javascripts/benchmark-table.js +96 -0
  59. gwmock_benchmark-0.2.0/docs/javascripts/mathjax.js +12 -0
  60. gwmock_benchmark-0.2.0/docs/javascripts/vendor/vega-embed.min.js +7 -0
  61. gwmock_benchmark-0.2.0/docs/javascripts/vendor/vega-lite.min.js +2 -0
  62. gwmock_benchmark-0.2.0/docs/javascripts/vendor/vega.min.js +2 -0
  63. gwmock_benchmark-0.2.0/docs/security.md +1 -0
  64. gwmock_benchmark-0.2.0/docs/signal/consistency.md +50 -0
  65. gwmock_benchmark-0.2.0/docs/signal/index.md +21 -0
  66. gwmock_benchmark-0.2.0/docs/signal/performance.md +48 -0
  67. gwmock_benchmark-0.2.0/docs/style/api.css +18 -0
  68. gwmock_benchmark-0.2.0/docs/stylesheets/benchmark-charts.css +27 -0
  69. gwmock_benchmark-0.2.0/docs/stylesheets/benchmark-table.css +64 -0
  70. gwmock_benchmark-0.2.0/pyproject.toml +153 -0
  71. gwmock_benchmark-0.2.0/renovate.json +79 -0
  72. gwmock_benchmark-0.2.0/setup_repo.sh +52 -0
  73. gwmock_benchmark-0.2.0/src/gwmock_benchmark/__init__.py +11 -0
  74. gwmock_benchmark-0.2.0/src/gwmock_benchmark/__main__.py +8 -0
  75. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/__init__.py +1 -0
  76. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/aggregate.py +67 -0
  77. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/main.py +98 -0
  78. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/signal.py +136 -0
  79. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/submit.py +72 -0
  80. gwmock_benchmark-0.2.0/src/gwmock_benchmark/cli/validate.py +64 -0
  81. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/__init__.py +38 -0
  82. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/measure.py +99 -0
  83. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/provenance.py +110 -0
  84. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/record.py +101 -0
  85. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/submit.py +99 -0
  86. gwmock_benchmark-0.2.0/src/gwmock_benchmark/harness/validate.py +65 -0
  87. gwmock_benchmark-0.2.0/src/gwmock_benchmark/suites/__init__.py +8 -0
  88. gwmock_benchmark-0.2.0/src/gwmock_benchmark/suites/signal.py +821 -0
  89. gwmock_benchmark-0.2.0/src/gwmock_benchmark/utils/__init__.py +7 -0
  90. gwmock_benchmark-0.2.0/src/gwmock_benchmark/utils/log.py +70 -0
  91. gwmock_benchmark-0.2.0/src/gwmock_benchmark/version.py +11 -0
  92. gwmock_benchmark-0.2.0/tests/cli/test_submit_cli.py +50 -0
  93. gwmock_benchmark-0.2.0/tests/cli/test_validate_cli.py +65 -0
  94. gwmock_benchmark-0.2.0/tests/conftest.py +16 -0
  95. gwmock_benchmark-0.2.0/tests/harness/test_measure.py +49 -0
  96. gwmock_benchmark-0.2.0/tests/harness/test_provenance.py +76 -0
  97. gwmock_benchmark-0.2.0/tests/harness/test_record.py +95 -0
  98. gwmock_benchmark-0.2.0/tests/harness/test_submit.py +64 -0
  99. gwmock_benchmark-0.2.0/tests/harness/test_validate.py +71 -0
  100. gwmock_benchmark-0.2.0/tests/smoke_test.py +34 -0
  101. gwmock_benchmark-0.2.0/tests/suites/test_signal.py +202 -0
  102. gwmock_benchmark-0.2.0/tests/test_aggregate.py +55 -0
  103. gwmock_benchmark-0.2.0/tests/test_data.py +45 -0
  104. gwmock_benchmark-0.2.0/tests/test_import.py +34 -0
  105. gwmock_benchmark-0.2.0/uv.lock +2689 -0
  106. gwmock_benchmark-0.2.0/zensical.toml +400 -0
@@ -0,0 +1,3 @@
1
+ reviews:
2
+ auto_review:
3
+ enabled: false
@@ -0,0 +1,56 @@
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 a short snippet of Python code that demonstrates the issue. Use
24
+ code blocks for readability:
25
+
26
+ ```python
27
+ # Your code here
28
+ ```
29
+
30
+ ## 📋 Expected Behavior
31
+
32
+ A clear and concise description of what you expected to happen.
33
+
34
+ ## 💥 Actual Behavior / Traceback
35
+
36
+ If applicable, add the Python error traceback here **after redacting secrets**
37
+ (API keys, tokens, credentials, private URLs/paths, personal data). If this is a
38
+ potential security vulnerability, do **not** post it publicly; use the Security
39
+ reporting channel instead.
40
+
41
+ ```text
42
+ Traceback (most recent call last):
43
+ ...
44
+
45
+ ```
46
+
47
+ ## 🛠 Environment Information
48
+
49
+ - **Python Version:** (e.g., 3.12)
50
+ - **Package Version:** (e.g., 1.2.3)
51
+ - **Operating System:** (e.g., Windows 11, Ubuntu 22.04, macOS)
52
+ - **Relevant Dependencies:** (e.g., numpy, pandas version if applicable)
53
+
54
+ ## 📎 Additional Context
55
+
56
+ Add any other context about the problem here (e.g., screenshots, logs).
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: GitHub Community Support
4
+ url: https://github.com/Leuven-Gravity-Institute/gwmock-benchmark/discussions
5
+ about: Please ask and answer questions here.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: ✨ Feature Request
3
+ about: Suggest an idea or improvement for this package
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'm always frustrated when I have to manually loop over X to achieve
14
+ > Y..."_
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 API / Usage Example
22
+
23
+ If applicable, show how you would imagine the Python code looking with this new
24
+ feature:
25
+
26
+ ```python
27
+ import gwsim_benchmark
28
+
29
+ # How you'd like to use the new feature
30
+ result = gwsim_benchmark.new_function(param="example")
31
+
32
+ ```
33
+
34
+ ## 🌈 Use Case & Benefits
35
+
36
+ Why is this feature important to you and other users? How does it improve the
37
+ package?
38
+
39
+ ## 🔄 Alternatives Considered
40
+
41
+ A clear and concise description of any alternative solutions or workarounds
42
+ you've considered (e.g., using a different library or a custom wrapper).
43
+
44
+ ## ⚠️ Additional Context
45
+
46
+ Add any other context, screenshots, or links to similar implementations in other
47
+ libraries here.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: 🚀 Pull Request
3
+ about: Submit your changes for review
4
+ ---
5
+
6
+ ## 📝 Summary
7
+
8
+ Briefly describe the changes introduced by this PR. Mention any related issues
9
+ using keywords (e.g., `Closes #123`).
10
+
11
+ ## ✨ Type of Change
12
+
13
+ - [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
14
+ - [ ] ✨ New feature (non-breaking change which adds functionality)
15
+ - [ ] 💥 Breaking change (fix or feature that would cause existing functionality
16
+ to not work as expected)
17
+ - [ ] 📝 Documentation update
18
+ - [ ] 🎨 Refactoring (no functional changes, no API changes)
19
+
20
+ ## 🧪 How Has This Been Tested?
21
+
22
+ Please describe the tests that you ran to verify your changes.
23
+
24
+ - [ ] **Unit Tests:** `uv run pytest tests/test_feature.py`
25
+ - [ ] **Manual Test:** (Describe steps)
26
+
27
+ ## 🏗️ Checklist
28
+
29
+ - [ ] My code follows the style guidelines of this project (PEP 8).
30
+ - [ ] I have performed a self-review of my own code.
31
+ - [ ] I have commented my code, particularly in hard-to-understand areas.
32
+ - [ ] I have made corresponding changes to the documentation.
33
+ - [ ] My changes generate no new warnings.
34
+ - [ ] I have added tests that prove my fix is effective or that my feature
35
+ works.
36
+
37
+ ## 📷 Screenshots (if applicable)
38
+
39
+ If this is a UI change or produces a specific output/graph, add screenshots
40
+ here.
@@ -0,0 +1,81 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+ workflow_call:
9
+
10
+ jobs:
11
+ test:
12
+ strategy:
13
+ matrix:
14
+ python-version: ['3.12', '3.13', '3.14']
15
+ # HPC benchmarking tool: Unix-only deps (resource, /proc, nvidia-smi,
16
+ # SLURM/HTCondor, lalsuite). Windows is not a supported runtime.
17
+ os: [ubuntu-latest, macos-latest]
18
+ runs-on: ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+ enable-cache: 'true'
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --group dev --frozen
30
+
31
+ - name: Run tests with pytest
32
+ run: uv run --frozen pytest
33
+
34
+ - name: Upload coverage to Codecov
35
+ if: ${{ !cancelled() }}
36
+ uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5
37
+ with:
38
+ token: ${{ secrets.CODECOV_TOKEN }}
39
+
40
+ # Gate on contributed data: every record under data/ must be well-formed, have
41
+ # complete provenance, and have derived metrics that still agree with the
42
+ # primitives they were computed from. Catches malformed or hand-edited records on
43
+ # the PR that adds them. Pure arithmetic — no waveform extras needed.
44
+ validate-data:
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
48
+
49
+ - name: Install uv
50
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
51
+ with:
52
+ python-version: '3.13'
53
+ enable-cache: 'true'
54
+
55
+ - name: Install dependencies
56
+ run: uv sync --frozen
57
+
58
+ - name: Validate committed records
59
+ run: uv run --frozen gwmock-benchmark validate --data-dir data
60
+
61
+ # Exercises the gwmock-signal suite end to end: installs the [signal] extra
62
+ # (gwmock-signal[jax,pycbc] -> lalsuite, jax, ripplegw, pycbc) and runs the
63
+ # integration tests that actually generate waveforms.
64
+ test-signal:
65
+ runs-on: ubuntu-latest
66
+ steps:
67
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
68
+
69
+ - name: Install uv
70
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
71
+ with:
72
+ python-version: '3.13'
73
+ enable-cache: 'true'
74
+
75
+ - name: Install dependencies (with signal extra)
76
+ run: uv sync --group dev --extra signal --frozen
77
+
78
+ - name: Run signal suite integration tests
79
+ run:
80
+ uv run --frozen pytest -m integration
81
+ tests/suites/test_signal.py
@@ -0,0 +1,34 @@
1
+ name: 'CodeQL Advanced'
2
+
3
+ on:
4
+ push:
5
+ branches: ['main']
6
+ pull_request:
7
+ branches: ['main']
8
+ schedule:
9
+ - cron: '0 0 * * 1'
10
+ workflow_call:
11
+
12
+ jobs:
13
+ analyze:
14
+ name: Analyze
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ security-events: write
18
+ actions: read
19
+ contents: read
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
23
+
24
+ - name: Initialize CodeQL
25
+ uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
26
+ with:
27
+ languages: python
28
+ queries: security-and-quality
29
+
30
+ - name: Autobuild
31
+ uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
32
+
33
+ - name: Perform CodeQL Analysis
34
+ uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
@@ -0,0 +1,49 @@
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
+ environment:
21
+ name: github-pages
22
+ url: ${{ steps.deployment.outputs.page_url }}
23
+ steps:
24
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
28
+ with:
29
+ python-version: '3.14.3'
30
+ enable-cache: 'true'
31
+
32
+ - name: Install dependencies
33
+ run: uv sync --group docs --frozen
34
+
35
+ # Render figures + table snippets from the committed data/ before building
36
+ # (zensical has no in-renderer hook); contributors submit data only.
37
+ - name: Aggregate benchmark data into the docs
38
+ run:
39
+ uv run --frozen gwmock-benchmark aggregate --data-dir data
40
+ --docs-dir docs
41
+
42
+ - run: uv run --frozen zensical build
43
+
44
+ - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
45
+ with:
46
+ path: site
47
+
48
+ - id: deployment
49
+ uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
@@ -0,0 +1,50 @@
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
+
23
+ - name: Generate changelog
24
+ id: changelog
25
+ uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
26
+ with:
27
+ config: cliff.toml
28
+ args: --unreleased --verbose
29
+ env:
30
+ OUTPUT: CHANGELOG.md
31
+
32
+ - name: Delete existing draft release
33
+ continue-on-error: true
34
+ run: |
35
+ gh release delete next-release --yes
36
+ env:
37
+ GH_TOKEN: ${{ github.token }}
38
+
39
+ - name: Create or Update Draft Release
40
+ uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
41
+ with:
42
+ tag_name: next-release
43
+ name: 'Next Release (Draft)'
44
+ body: |
45
+ ${{ steps.changelog.outputs.content }}
46
+
47
+ ---
48
+ *This is an automatically generated draft release.*
49
+ draft: true
50
+ prerelease: false
@@ -0,0 +1,70 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag_name:
7
+ description: 'Tag name for the publish (e.g., v1.2.3)'
8
+ required: true
9
+ type: string
10
+ workflow_call:
11
+ inputs:
12
+ tag_name:
13
+ description: 'Tag name for the publish (e.g., v1.2.3)'
14
+ required: true
15
+ type: string
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
22
+ with:
23
+ ref: ${{ inputs.tag_name || github.event.inputs.tag_name }}
24
+ fetch-depth: 0
25
+
26
+ - name: Output build information
27
+ run: |
28
+ echo "### Publishing Build :package:" >> $GITHUB_STEP_SUMMARY
29
+ echo "- **Version tag**: ${{ inputs.tag_name || github.event.inputs.tag_name }}" >> $GITHUB_STEP_SUMMARY
30
+
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
33
+ with:
34
+ python-version: '3.14.3'
35
+ enable-cache: 'true'
36
+
37
+ - name: Install dependencies
38
+ run: uv sync --frozen
39
+
40
+ - name: Build distribution
41
+ run: uv build
42
+
43
+ - name: Upload build artifacts
44
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
45
+ with:
46
+ name: python-package-distributions
47
+ path: dist/
48
+
49
+ publish-to-pypi:
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+ environment: pypi
53
+ permissions:
54
+ id-token: write
55
+
56
+ steps:
57
+ - name: Download build artifacts
58
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
59
+ with:
60
+ name: python-package-distributions
61
+ path: dist/
62
+
63
+ - name: Publish to PyPI
64
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
65
+ # Remove this line if you want the workflow to fail on publish errors
66
+ # This is added for this template only since the environment 'pypi' is
67
+ # not created to avoid publishing
68
+ continue-on-error: true
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,84 @@
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
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
25
+ with:
26
+ ref: ${{ inputs.tag_name || github.sha }}
27
+ fetch-depth: 0
28
+
29
+ - name: Output build information
30
+ run: |
31
+ echo "### Publishing Build :package:" >> $GITHUB_STEP_SUMMARY
32
+ echo "- **Version tag**: ${{ inputs.tag_name || github.sha }}" >> $GITHUB_STEP_SUMMARY
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
36
+ with:
37
+ python-version: '3.14.3'
38
+ enable-cache: 'true'
39
+
40
+ - name: Install dependencies
41
+ run: uv sync --group build --frozen
42
+
43
+ - name: Set version for publishing
44
+ run: |
45
+ if [ -n "${{ inputs.tag_name }}" ]; then
46
+ # Use the tag, stripping 'v' prefix if present
47
+ VERSION=$(echo "${{ inputs.tag_name }}" | sed 's/^v//')
48
+ else
49
+ # For untagged builds, use a dev version without local part
50
+ # Get the dev version from hatch-vcs, then strip +local
51
+ VERSION=$(uv run --frozen hatch version | sed 's/+.*//')
52
+ fi
53
+
54
+ # Update pyproject.toml with sed
55
+ sed -i "s/dynamic = \[\"version\"\]/version = \"$VERSION\"\ndynamic = []/" pyproject.toml
56
+
57
+ - name: Build distribution
58
+ run: uv build
59
+
60
+ - name: Upload build artifacts
61
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
62
+ with:
63
+ name: python-package-distributions
64
+ path: dist/
65
+
66
+ publish-to-testpypi:
67
+ needs: build
68
+ runs-on: ubuntu-latest
69
+ environment: testpypi
70
+ permissions:
71
+ id-token: write
72
+
73
+ steps:
74
+ - name: Download build artifacts
75
+ uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
76
+ with:
77
+ name: python-package-distributions
78
+ path: dist/
79
+
80
+ - name: Publish to TestPyPI
81
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
82
+ with:
83
+ repository-url: https://test.pypi.org/legacy/
84
+ packages-dir: dist/
@@ -0,0 +1,58 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag_name:
7
+ description: 'Tag name for the release (e.g., v1.2.3)'
8
+ required: true
9
+ type: string
10
+ workflow_call:
11
+ inputs:
12
+ tag_name:
13
+ description: 'Tag name for the release (e.g., v1.2.3)'
14
+ required: true
15
+ type: string
16
+
17
+ permissions:
18
+ contents: write
19
+
20
+ jobs:
21
+ release:
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: write
25
+ steps:
26
+ - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
27
+ with:
28
+ fetch-depth: 0
29
+ ref: ${{ inputs.tag_name || github.event.inputs.tag_name }}
30
+
31
+ - name: Generate changelog
32
+ id: changelog
33
+ uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
34
+ with:
35
+ config: cliff.toml
36
+ args: --current --verbose
37
+ env:
38
+ OUTPUT: CHANGELOG.md
39
+
40
+ - name: Delete draft release
41
+ continue-on-error: true
42
+ run: |
43
+ gh release delete next-release --yes
44
+ env:
45
+ GH_TOKEN: ${{ github.token }}
46
+
47
+ - name: Create Release
48
+ uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
49
+ with:
50
+ tag_name:
51
+ ${{ inputs.tag_name || github.event.inputs.tag_name }}
52
+ body: ${{ steps.changelog.outputs.content }}
53
+ draft: false
54
+ prerelease:
55
+ ${{ contains(inputs.tag_name ||
56
+ github.event.inputs.tag_name, 'alpha') ||
57
+ contains(inputs.tag_name || github.event.inputs.tag_name,
58
+ 'beta') }}