pygrindvakt 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 (117) hide show
  1. pygrindvakt-0.1.0/.github/scripts/setup-manylinux-build-env.sh +25 -0
  2. pygrindvakt-0.1.0/.github/workflows/ci.yml +281 -0
  3. pygrindvakt-0.1.0/.github/workflows/release.yml +241 -0
  4. pygrindvakt-0.1.0/.gitignore +230 -0
  5. pygrindvakt-0.1.0/.readthedocs.yaml +25 -0
  6. pygrindvakt-0.1.0/CHANGELOG.md +66 -0
  7. pygrindvakt-0.1.0/CONTRIBUTING.md +31 -0
  8. pygrindvakt-0.1.0/Cargo.lock +2970 -0
  9. pygrindvakt-0.1.0/Cargo.toml +26 -0
  10. pygrindvakt-0.1.0/LICENSE +23 -0
  11. pygrindvakt-0.1.0/PKG-INFO +168 -0
  12. pygrindvakt-0.1.0/README.md +146 -0
  13. pygrindvakt-0.1.0/build-wheels.sh +29 -0
  14. pygrindvakt-0.1.0/docs/Makefile +27 -0
  15. pygrindvakt-0.1.0/docs/_static/.gitkeep +0 -0
  16. pygrindvakt-0.1.0/docs/_templates/.gitkeep +0 -0
  17. pygrindvakt-0.1.0/docs/adr/0001-sync-api-over-embedded-tokio-runtime.md +64 -0
  18. pygrindvakt-0.1.0/docs/adr/0002-python-protocol-adapters.md +59 -0
  19. pygrindvakt-0.1.0/docs/adr/0003-fail-closed-hardening.md +55 -0
  20. pygrindvakt-0.1.0/docs/adr/README.md +12 -0
  21. pygrindvakt-0.1.0/docs/api/client.rst +217 -0
  22. pygrindvakt-0.1.0/docs/api/discovery.rst +193 -0
  23. pygrindvakt-0.1.0/docs/api/dpop.rst +175 -0
  24. pygrindvakt-0.1.0/docs/api/federation.rst +277 -0
  25. pygrindvakt-0.1.0/docs/api/http.rst +280 -0
  26. pygrindvakt-0.1.0/docs/api/index.rst +44 -0
  27. pygrindvakt-0.1.0/docs/api/jwt.rst +135 -0
  28. pygrindvakt-0.1.0/docs/api/keys.rst +123 -0
  29. pygrindvakt-0.1.0/docs/api/mac.rst +35 -0
  30. pygrindvakt-0.1.0/docs/api/metadata.rst +121 -0
  31. pygrindvakt-0.1.0/docs/api/pkce.rst +34 -0
  32. pygrindvakt-0.1.0/docs/api/provider.rst +347 -0
  33. pygrindvakt-0.1.0/docs/api/request.rst +135 -0
  34. pygrindvakt-0.1.0/docs/api/rp.rst +265 -0
  35. pygrindvakt-0.1.0/docs/api/tokens.rst +163 -0
  36. pygrindvakt-0.1.0/docs/api/util.rst +31 -0
  37. pygrindvakt-0.1.0/docs/conf.py +47 -0
  38. pygrindvakt-0.1.0/docs/exceptions.rst +259 -0
  39. pygrindvakt-0.1.0/docs/guides/dpop.rst +192 -0
  40. pygrindvakt-0.1.0/docs/guides/federation.rst +267 -0
  41. pygrindvakt-0.1.0/docs/guides/op_django.rst +219 -0
  42. pygrindvakt-0.1.0/docs/guides/op_fastapi.rst +201 -0
  43. pygrindvakt-0.1.0/docs/guides/op_flask.rst +204 -0
  44. pygrindvakt-0.1.0/docs/guides/rp.rst +273 -0
  45. pygrindvakt-0.1.0/docs/guides/security.rst +318 -0
  46. pygrindvakt-0.1.0/docs/guides/stores.rst +194 -0
  47. pygrindvakt-0.1.0/docs/index.rst +150 -0
  48. pygrindvakt-0.1.0/docs/installation.rst +157 -0
  49. pygrindvakt-0.1.0/docs/quickstart.rst +231 -0
  50. pygrindvakt-0.1.0/examples/README.md +95 -0
  51. pygrindvakt-0.1.0/examples/common/__init__.py +1 -0
  52. pygrindvakt-0.1.0/examples/common/op_config.py +105 -0
  53. pygrindvakt-0.1.0/examples/django-op/manage.py +21 -0
  54. pygrindvakt-0.1.0/examples/django-op/op/__init__.py +0 -0
  55. pygrindvakt-0.1.0/examples/django-op/op/adapters.py +33 -0
  56. pygrindvakt-0.1.0/examples/django-op/op/provider.py +15 -0
  57. pygrindvakt-0.1.0/examples/django-op/op/views.py +75 -0
  58. pygrindvakt-0.1.0/examples/django-op/opsite/__init__.py +0 -0
  59. pygrindvakt-0.1.0/examples/django-op/opsite/settings.py +30 -0
  60. pygrindvakt-0.1.0/examples/django-op/opsite/urls.py +11 -0
  61. pygrindvakt-0.1.0/examples/fastapi-op/app.py +168 -0
  62. pygrindvakt-0.1.0/examples/flask-op/app.py +126 -0
  63. pygrindvakt-0.1.0/examples/flask-rp/app.py +95 -0
  64. pygrindvakt-0.1.0/pyproject.toml +56 -0
  65. pygrindvakt-0.1.0/python/pygrindvakt/__init__.py +86 -0
  66. pygrindvakt-0.1.0/python/pygrindvakt/__init__.pyi +118 -0
  67. pygrindvakt-0.1.0/python/pygrindvakt/client.pyi +91 -0
  68. pygrindvakt-0.1.0/python/pygrindvakt/discovery.pyi +44 -0
  69. pygrindvakt-0.1.0/python/pygrindvakt/dpop.pyi +91 -0
  70. pygrindvakt-0.1.0/python/pygrindvakt/errors.py +85 -0
  71. pygrindvakt-0.1.0/python/pygrindvakt/errors.pyi +33 -0
  72. pygrindvakt-0.1.0/python/pygrindvakt/federation.pyi +74 -0
  73. pygrindvakt-0.1.0/python/pygrindvakt/http.pyi +174 -0
  74. pygrindvakt-0.1.0/python/pygrindvakt/jwt.pyi +57 -0
  75. pygrindvakt-0.1.0/python/pygrindvakt/keys.pyi +71 -0
  76. pygrindvakt-0.1.0/python/pygrindvakt/mac.pyi +10 -0
  77. pygrindvakt-0.1.0/python/pygrindvakt/metadata.pyi +100 -0
  78. pygrindvakt-0.1.0/python/pygrindvakt/pkce.pyi +11 -0
  79. pygrindvakt-0.1.0/python/pygrindvakt/provider.pyi +185 -0
  80. pygrindvakt-0.1.0/python/pygrindvakt/py.typed +1 -0
  81. pygrindvakt-0.1.0/python/pygrindvakt/request.pyi +75 -0
  82. pygrindvakt-0.1.0/python/pygrindvakt/rp.pyi +118 -0
  83. pygrindvakt-0.1.0/python/pygrindvakt/tokens.pyi +135 -0
  84. pygrindvakt-0.1.0/python/pygrindvakt/util.pyi +10 -0
  85. pygrindvakt-0.1.0/src/client.rs +351 -0
  86. pygrindvakt-0.1.0/src/convert.rs +114 -0
  87. pygrindvakt-0.1.0/src/discovery.rs +318 -0
  88. pygrindvakt-0.1.0/src/dpop.rs +296 -0
  89. pygrindvakt-0.1.0/src/errors.rs +332 -0
  90. pygrindvakt-0.1.0/src/federation.rs +468 -0
  91. pygrindvakt-0.1.0/src/http.rs +716 -0
  92. pygrindvakt-0.1.0/src/jwt.rs +182 -0
  93. pygrindvakt-0.1.0/src/keys.rs +179 -0
  94. pygrindvakt-0.1.0/src/lib.rs +54 -0
  95. pygrindvakt-0.1.0/src/metadata.rs +277 -0
  96. pygrindvakt-0.1.0/src/provider.rs +565 -0
  97. pygrindvakt-0.1.0/src/request.rs +186 -0
  98. pygrindvakt-0.1.0/src/rp.rs +612 -0
  99. pygrindvakt-0.1.0/src/runtime.rs +99 -0
  100. pygrindvakt-0.1.0/src/tokens.rs +379 -0
  101. pygrindvakt-0.1.0/src/util.rs +87 -0
  102. pygrindvakt-0.1.0/tests/conftest.py +234 -0
  103. pygrindvakt-0.1.0/tests/test_adapters.py +267 -0
  104. pygrindvakt-0.1.0/tests/test_client.py +85 -0
  105. pygrindvakt-0.1.0/tests/test_discovery.py +655 -0
  106. pygrindvakt-0.1.0/tests/test_dpop.py +182 -0
  107. pygrindvakt-0.1.0/tests/test_federation.py +940 -0
  108. pygrindvakt-0.1.0/tests/test_frameworks.py +399 -0
  109. pygrindvakt-0.1.0/tests/test_http.py +120 -0
  110. pygrindvakt-0.1.0/tests/test_jwt_pkce_mac_util.py +88 -0
  111. pygrindvakt-0.1.0/tests/test_keys.py +96 -0
  112. pygrindvakt-0.1.0/tests/test_package.py +88 -0
  113. pygrindvakt-0.1.0/tests/test_provider.py +457 -0
  114. pygrindvakt-0.1.0/tests/test_rp.py +724 -0
  115. pygrindvakt-0.1.0/tests/test_stubs.py +93 -0
  116. pygrindvakt-0.1.0/tests/test_tokens.py +82 -0
  117. pygrindvakt-0.1.0/uv.lock +1298 -0
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ : "${UV_VERSION:=0.11.23}"
5
+ : "${RUSTUP_HOME:=/opt/rustup}"
6
+ : "${CARGO_HOME:=/opt/cargo}"
7
+
8
+ export RUSTUP_HOME
9
+ export CARGO_HOME
10
+ export PATH="${CARGO_HOME}/bin:/opt/python/cp314-cp314/bin:${PATH}"
11
+
12
+ curl --proto '=https' --tlsv1.2 -sSf \
13
+ -o /tmp/rustup-init \
14
+ https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
15
+ chmod +x /tmp/rustup-init
16
+ /tmp/rustup-init -y --profile minimal --default-toolchain stable
17
+ rustup update stable
18
+ rustup default stable
19
+ rustc --version
20
+ cargo --version
21
+
22
+ /opt/python/cp314-cp314/bin/python3.14 -m pip install --upgrade "uv==${UV_VERSION}"
23
+ uv --version
24
+
25
+ /io/build-wheels.sh
@@ -0,0 +1,281 @@
1
+ name: ci
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - 'src/**'
6
+ - 'python/**'
7
+ - 'tests/**'
8
+ - 'Cargo.lock'
9
+ - 'Cargo.toml'
10
+ - 'pyproject.toml'
11
+ - 'build-wheels.sh'
12
+ - '.github/workflows/**'
13
+ - '.github/scripts/**'
14
+ workflow_dispatch:
15
+ env:
16
+ FORCE_COLOR: "1"
17
+ UV_LINK_MODE: "copy"
18
+ UV_VERSION: "0.11.23"
19
+ jobs:
20
+
21
+ manylinux_x86_64:
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 20
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+
27
+ - name: Pull the manylinux image
28
+ run: docker pull quay.io/pypa/manylinux_2_28_x86_64
29
+
30
+ - name: Build the wheel inside manylinux container
31
+ run: |
32
+ docker run --rm \
33
+ -e UV_VERSION=${{ env.UV_VERSION }} \
34
+ -e RUSTUP_HOME=/opt/rustup \
35
+ -e CARGO_HOME=/opt/cargo \
36
+ -v ${{ github.workspace }}:/io \
37
+ quay.io/pypa/manylinux_2_28_x86_64 \
38
+ /bin/bash /io/.github/scripts/setup-manylinux-build-env.sh
39
+
40
+ - name: Install UV and test wheel
41
+ run: |
42
+ python3 -m pip install --user "uv==${UV_VERSION}"
43
+ ~/.local/bin/uv venv
44
+ ~/.local/bin/uv pip install pytest cryptography flask django fastapi httpx
45
+ ~/.local/bin/uv pip install ./dist/pygrindvakt-*.whl
46
+ .venv/bin/python -m pytest tests/ -vvv
47
+
48
+ - name: Store wheels
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: pygrindvakt_manylinux_x86_64
52
+ path: dist/
53
+ overwrite: true
54
+ retention-days: 1
55
+ if-no-files-found: "error"
56
+ compression-level: 0
57
+
58
+ # PKCS#11 / HSM integration tests, driven by SoftHSM2.
59
+ # Unlike pybergshamra (which provisions a token via hsm-test/setup.sh),
60
+ # pygrindvakt's `softhsm` pytest fixture provisions a throwaway token itself
61
+ # and auto-skips when the tooling is absent, so this job only needs to install
62
+ # softhsm2 + opensc and run the suite; the pkcs11-marked tests then execute.
63
+ hsm:
64
+ name: HSM (SoftHSM2 / PKCS#11) + Redis
65
+ runs-on: ubuntu-latest
66
+ timeout-minutes: 15
67
+ services:
68
+ redis:
69
+ image: redis:7-alpine
70
+ ports:
71
+ - 6379:6379
72
+ options: >-
73
+ --health-cmd "redis-cli ping"
74
+ --health-interval 5s
75
+ --health-timeout 3s
76
+ --health-retries 10
77
+ env:
78
+ REDIS_URL: redis://127.0.0.1:6379/
79
+ steps:
80
+ - uses: actions/checkout@v7
81
+
82
+ - name: Install SoftHSM2 + OpenSC
83
+ run: sudo apt-get update && sudo apt-get install -y softhsm2 opensc
84
+
85
+ - uses: dtolnay/rust-toolchain@stable
86
+
87
+ - name: Install UV
88
+ run: |
89
+ python3 -m pip install --user "uv==${UV_VERSION}"
90
+ echo "$HOME/.local/bin" >> "$GITHUB_PATH"
91
+
92
+ - name: Build and install the extension
93
+ run: |
94
+ uv venv
95
+ uv pip install "maturin==1.14.1" pytest cryptography flask django fastapi httpx
96
+ .venv/bin/maturin develop
97
+
98
+ - name: Run the test suite (incl. PKCS#11 and Redis)
99
+ run: |
100
+ .venv/bin/python -m pytest tests/ -vvv
101
+
102
+ #manylinux_aarch64:
103
+ #runs-on: ubuntu-24-arm
104
+ #timeout-minutes: 10
105
+ #steps:
106
+ #- uses: actions/checkout@v7
107
+
108
+ #- name: Pull the manylinux image
109
+ #run: docker pull quay.io/pypa/manylinux_2_28_aarch64
110
+
111
+ #- name: Build the wheel inside manylinux container
112
+ #run: |
113
+ #docker run --rm \
114
+ #-e UV_VERSION=${{ env.UV_VERSION }} \
115
+ #-e RUSTUP_HOME=/opt/rustup \
116
+ #-e CARGO_HOME=/opt/cargo \
117
+ #-v ${{ github.workspace }}:/io \
118
+ #quay.io/pypa/manylinux_2_28_aarch64 \
119
+ #/bin/bash /io/.github/scripts/setup-manylinux-build-env.sh
120
+
121
+ #- name: Install UV
122
+ #run: |
123
+ #python3 -m pip install --user "uv==${UV_VERSION}"
124
+ #uv venv
125
+ #source .venv/bin/activate
126
+ #uv pip install pytest
127
+ #uv pip install ./dist/pygrindvakt-*.whl
128
+
129
+ #- name: Run tests
130
+ #run: |
131
+ #source .venv/bin/activate
132
+ #pytest tests/ -vvv
133
+
134
+ #- name: Store wheels
135
+ #uses: actions/upload-artifact@v4
136
+ #with:
137
+ #name: pygrindvakt_manylinux_aarch64
138
+ #path: dist/
139
+ #overwrite: true
140
+ #retention-days: 1
141
+ #if-no-files-found: "error"
142
+ #compression-level: 0
143
+
144
+ #macos_aarch64:
145
+ #runs-on: macos-15
146
+ #timeout-minutes: 10
147
+ #steps:
148
+ #- uses: actions/checkout@v7
149
+
150
+ #- uses: actions/setup-python@v6
151
+ #with:
152
+ #allow-prereleases: true
153
+ #python-version: "3.14"
154
+
155
+ #- uses: dtolnay/rust-toolchain@stable
156
+ #with:
157
+ #targets: "aarch64-apple-darwin"
158
+
159
+ #- name: Build environment
160
+ #run: |
161
+ #python3 -m pip install --user "uv==${UV_VERSION}"
162
+ #uv venv --python python3.14
163
+ #source .venv/bin/activate
164
+ #uv pip install --upgrade "maturin==1.14.1" pytest
165
+
166
+ #- name: Build wheel
167
+ #run: |
168
+ #source .venv/bin/activate
169
+ #MACOSX_DEPLOYMENT_TARGET="11.0" \
170
+ #maturin build \
171
+ #--release \
172
+ #--strip \
173
+ #--interpreter python3.14 \
174
+ #--target=aarch64-apple-darwin
175
+
176
+ #- name: Run tests
177
+ #run: |
178
+ #source .venv/bin/activate
179
+ #uv pip install target/wheels/pygrindvakt-*.whl
180
+ #pytest tests/ -vvv
181
+
182
+ #- name: Store wheels
183
+ #uses: actions/upload-artifact@v4
184
+ #with:
185
+ #name: pygrindvakt_macos_aarch64
186
+ #path: target/wheels
187
+ #overwrite: true
188
+ #retention-days: 1
189
+ #if-no-files-found: "error"
190
+ #compression-level: 0
191
+
192
+ #windows_amd64:
193
+ #runs-on: windows-2025
194
+ #timeout-minutes: 10
195
+ #steps:
196
+ #- uses: actions/checkout@v7
197
+
198
+ #- uses: actions/setup-python@v6
199
+ #with:
200
+ #allow-prereleases: true
201
+ #python-version: "3.14"
202
+ #architecture: "x64"
203
+
204
+ #- uses: dtolnay/rust-toolchain@stable
205
+ #with:
206
+ #targets: "x86_64-pc-windows-msvc"
207
+
208
+ #- name: Build environment
209
+ #run: |
210
+ #python.exe -m pip install --upgrade pip "maturin==1.14.1" pytest
211
+
212
+ #- name: Build wheel
213
+ #run: |
214
+ #maturin.exe build --release --strip --target=x86_64-pc-windows-msvc
215
+
216
+ #- name: Run tests
217
+ #shell: pwsh
218
+ #run: |
219
+ #python -m venv venv
220
+ #.\venv\Scripts\Activate.ps1
221
+ #pip install pytest
222
+ #pip install pygrindvakt --no-index --find-links target\wheels
223
+ #pytest tests/ -vvv
224
+
225
+ #- name: Store wheels
226
+ #uses: actions/upload-artifact@v4
227
+ #with:
228
+ #name: pygrindvakt_windows_amd64
229
+ #path: target\wheels
230
+ #overwrite: true
231
+ #retention-days: 1
232
+ #if-no-files-found: "error"
233
+ #compression-level: 0
234
+
235
+ #windows_aarch64:
236
+ #runs-on: windows-11-arm
237
+ #timeout-minutes: 10
238
+ #env:
239
+ #TARGET: "aarch64-pc-windows-msvc"
240
+ #steps:
241
+ #- uses: actions/checkout@v7
242
+
243
+ #- uses: actions/setup-python@v6
244
+ #with:
245
+ #allow-prereleases: true
246
+ #python-version: "3.14"
247
+ #architecture: "arm64"
248
+
249
+ #- shell: pwsh
250
+ #run: |
251
+ #Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/$env:TARGET/rustup-init.exe" -OutFile rustup-init.exe
252
+ #.\rustup-init.exe --default-toolchain "stable-$env:TARGET" --profile minimal --component rust-src -y
253
+ #"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
254
+ #"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
255
+
256
+ #- name: Build environment
257
+ #run: |
258
+ #python.exe -m pip install --upgrade pip "maturin==1.14.1" pytest
259
+
260
+ #- name: Build wheel
261
+ #run: |
262
+ #maturin.exe build --release --strip --target="$env:TARGET"
263
+
264
+ #- name: Run tests
265
+ #shell: pwsh
266
+ #run: |
267
+ #python -m venv venv
268
+ #.\venv\Scripts\Activate.ps1
269
+ #pip install pytest
270
+ #pip install pygrindvakt --no-index --find-links target\wheels
271
+ #pytest tests/ -vvv
272
+
273
+ #- name: Store wheels
274
+ #uses: actions/upload-artifact@v4
275
+ #with:
276
+ #name: pygrindvakt_windows_aarch64
277
+ #path: target\wheels
278
+ #overwrite: true
279
+ #retention-days: 1
280
+ #if-no-files-found: "error"
281
+ #compression-level: 0
@@ -0,0 +1,241 @@
1
+ name: release
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+ workflow_dispatch:
7
+ env:
8
+ FORCE_COLOR: "1"
9
+ UV_LINK_MODE: "copy"
10
+ UV_VERSION: "0.11.23"
11
+ jobs:
12
+
13
+ manylinux_x86_64:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 20
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+
19
+ - name: Pull the manylinux image
20
+ run: docker pull quay.io/pypa/manylinux_2_28_x86_64
21
+
22
+ - name: Build the wheel inside manylinux container
23
+ run: |
24
+ docker run --rm \
25
+ -e UV_VERSION=${{ env.UV_VERSION }} \
26
+ -e RUSTUP_HOME=/opt/rustup \
27
+ -e CARGO_HOME=/opt/cargo \
28
+ -v ${{ github.workspace }}:/io \
29
+ quay.io/pypa/manylinux_2_28_x86_64 \
30
+ /bin/bash /io/.github/scripts/setup-manylinux-build-env.sh
31
+
32
+ - name: Install UV and test
33
+ run: |
34
+ python3 -m pip install --user "uv==${UV_VERSION}"
35
+ ~/.local/bin/uv venv
36
+ ~/.local/bin/uv pip install pytest cryptography flask django fastapi httpx
37
+ ~/.local/bin/uv pip install ./dist/pygrindvakt-*.whl
38
+ .venv/bin/python -m pytest tests/ -vvv
39
+
40
+ - name: Store wheels
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: pygrindvakt_manylinux_x86_64
44
+ path: dist/
45
+ overwrite: true
46
+ retention-days: 3
47
+ if-no-files-found: "error"
48
+ compression-level: 0
49
+
50
+ #manylinux_aarch64:
51
+ #runs-on: ubuntu-24-arm
52
+ #timeout-minutes: 10
53
+ #steps:
54
+ #- uses: actions/checkout@v5
55
+
56
+ #- name: Pull the manylinux image
57
+ #run: docker pull quay.io/pypa/manylinux_2_28_aarch64
58
+
59
+ #- name: Build the wheel inside manylinux container
60
+ #run: |
61
+ #docker run --rm \
62
+ #-e UV_VERSION=${{ env.UV_VERSION }} \
63
+ #-e RUSTUP_HOME=/opt/rustup \
64
+ #-e CARGO_HOME=/opt/cargo \
65
+ #-v ${{ github.workspace }}:/io \
66
+ #quay.io/pypa/manylinux_2_28_aarch64 \
67
+ #/bin/bash /io/.github/scripts/setup-manylinux-build-env.sh
68
+
69
+ #- name: Install UV and test
70
+ #run: |
71
+ #python3 -m pip install --user "uv==${UV_VERSION}"
72
+ #uv venv
73
+ #source .venv/bin/activate
74
+ #uv pip install pytest
75
+ #uv pip install ./dist/pygrindvakt-*.whl
76
+ #pytest tests/ -vvv
77
+
78
+ #- name: Store wheels
79
+ #uses: actions/upload-artifact@v4
80
+ #with:
81
+ #name: pygrindvakt_manylinux_aarch64
82
+ #path: dist/
83
+ #overwrite: true
84
+ #retention-days: 3
85
+ #if-no-files-found: "error"
86
+ #compression-level: 0
87
+
88
+ #macos_aarch64:
89
+ #runs-on: macos-15
90
+ #timeout-minutes: 10
91
+ #steps:
92
+ #- uses: actions/checkout@v5
93
+
94
+ #- uses: actions/setup-python@v6
95
+ #with:
96
+ #allow-prereleases: true
97
+ #python-version: "3.14"
98
+
99
+ #- uses: dtolnay/rust-toolchain@stable
100
+ #with:
101
+ #targets: "aarch64-apple-darwin"
102
+
103
+ #- name: Build environment
104
+ #run: |
105
+ #python3 -m pip install --user "uv==${UV_VERSION}"
106
+ #uv venv --python python3.14
107
+ #source .venv/bin/activate
108
+ #uv pip install --upgrade "maturin==1.14.1" pytest
109
+
110
+ #- name: Build wheel
111
+ #run: |
112
+ #source .venv/bin/activate
113
+ #MACOSX_DEPLOYMENT_TARGET="11.0" \
114
+ #maturin build \
115
+ #--release \
116
+ #--strip \
117
+ #--interpreter python3.14 \
118
+ #--target=aarch64-apple-darwin
119
+
120
+ #- name: Run tests
121
+ #run: |
122
+ #source .venv/bin/activate
123
+ #uv pip install target/wheels/pygrindvakt-*.whl
124
+ #pytest tests/ -vvv
125
+
126
+ #- name: Store wheels
127
+ #uses: actions/upload-artifact@v4
128
+ #with:
129
+ #name: pygrindvakt_macos_aarch64
130
+ #path: target/wheels
131
+ #overwrite: true
132
+ #retention-days: 3
133
+ #if-no-files-found: "error"
134
+ #compression-level: 0
135
+
136
+ #windows_amd64:
137
+ #runs-on: windows-2025
138
+ #timeout-minutes: 10
139
+ #steps:
140
+ #- uses: actions/checkout@v5
141
+
142
+ #- uses: actions/setup-python@v6
143
+ #with:
144
+ #allow-prereleases: true
145
+ #python-version: "3.14"
146
+ #architecture: "x64"
147
+
148
+ #- uses: dtolnay/rust-toolchain@stable
149
+ #with:
150
+ #targets: "x86_64-pc-windows-msvc"
151
+
152
+ #- name: Build wheel
153
+ #run: |
154
+ #python.exe -m pip install --upgrade pip "maturin==1.14.1"
155
+ #maturin.exe build --release --strip --target=x86_64-pc-windows-msvc
156
+
157
+ #- name: Run tests
158
+ #shell: pwsh
159
+ #run: |
160
+ #python -m venv venv
161
+ #.\venv\Scripts\Activate.ps1
162
+ #pip install pytest
163
+ #pip install pygrindvakt --no-index --find-links target\wheels
164
+ #pytest tests/ -vvv
165
+
166
+ #- name: Store wheels
167
+ #uses: actions/upload-artifact@v4
168
+ #with:
169
+ #name: pygrindvakt_windows_amd64
170
+ #path: target\wheels
171
+ #overwrite: true
172
+ #retention-days: 3
173
+ #if-no-files-found: "error"
174
+ #compression-level: 0
175
+
176
+ #windows_aarch64:
177
+ #runs-on: windows-11-arm
178
+ #timeout-minutes: 10
179
+ #env:
180
+ #TARGET: "aarch64-pc-windows-msvc"
181
+ #steps:
182
+ #- uses: actions/checkout@v5
183
+
184
+ #- uses: actions/setup-python@v6
185
+ #with:
186
+ #allow-prereleases: true
187
+ #python-version: "3.14"
188
+ #architecture: "arm64"
189
+
190
+ #- shell: pwsh
191
+ #run: |
192
+ #Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/$env:TARGET/rustup-init.exe" -OutFile rustup-init.exe
193
+ #.\rustup-init.exe --default-toolchain "stable-$env:TARGET" --profile minimal --component rust-src -y
194
+ #"$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH
195
+ #"CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV
196
+
197
+ #- name: Build wheel
198
+ #run: |
199
+ #python.exe -m pip install --upgrade pip "maturin==1.14.1"
200
+ #maturin.exe build --release --strip --target="$env:TARGET"
201
+
202
+ #- name: Run tests
203
+ #shell: pwsh
204
+ #run: |
205
+ #python -m venv venv
206
+ #.\venv\Scripts\Activate.ps1
207
+ #pip install pytest
208
+ #pip install pygrindvakt --no-index --find-links target\wheels
209
+ #pytest tests/ -vvv
210
+
211
+ #- name: Store wheels
212
+ #uses: actions/upload-artifact@v4
213
+ #with:
214
+ #name: pygrindvakt_windows_aarch64
215
+ #path: target\wheels
216
+ #overwrite: true
217
+ #retention-days: 3
218
+ #if-no-files-found: "error"
219
+ #compression-level: 0
220
+
221
+ publish:
222
+ runs-on: ubuntu-latest
223
+ needs: [manylinux_x86_64]
224
+ environment: pypi
225
+ permissions:
226
+ id-token: write
227
+ steps:
228
+ - name: Download all artifacts
229
+ uses: actions/download-artifact@v4
230
+ with:
231
+ path: dist
232
+ pattern: pygrindvakt_*
233
+ merge-multiple: true
234
+
235
+ - name: List artifacts
236
+ run: ls -lR dist/
237
+
238
+ - name: Publish to PyPI
239
+ uses: pypa/gh-action-pypi-publish@release/v1
240
+ with:
241
+ packages-dir: dist/