primp 0.5.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.
@@ -0,0 +1,277 @@
1
+ # This file is autogenerated by maturin v1.7.0
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github -o .github/workflows/CI.yml --pytest --zig
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - '*'
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ linux:
23
+ runs-on: ${{ matrix.platform.runner }}
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ platform:
28
+ - runner: ubuntu-latest
29
+ target: x86_64
30
+ - runner: ubuntu-latest
31
+ target: aarch64
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: actions/setup-python@v5
35
+ with:
36
+ python-version: 3.x
37
+ - name: Build wheels
38
+ uses: PyO3/maturin-action@v1
39
+ with:
40
+ target: ${{ matrix.platform.target }}
41
+ args: --release --out dist --zig
42
+ sccache: 'true'
43
+ manylinux: auto
44
+ env:
45
+ CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
46
+ - name: Upload wheels
47
+ uses: actions/upload-artifact@v4
48
+ with:
49
+ name: wheels-linux-${{ matrix.platform.target }}
50
+ path: dist
51
+ - name: pytest
52
+ if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
53
+ shell: bash
54
+ run: |
55
+ set -e
56
+ pip install uv
57
+ for version in 3.8 3.9 3.10 3.11 3.12; do
58
+ uv venv --preview --python $version
59
+ source .venv/bin/activate
60
+ uv pip install primp --no-index --find-links dist --force-reinstall
61
+ uv pip install pytest
62
+ pytest
63
+ done
64
+ - name: pytest
65
+ if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
66
+ uses: uraimo/run-on-arch-action@v2
67
+ with:
68
+ arch: ${{ matrix.platform.target }}
69
+ distro: ubuntu22.04
70
+ githubToken: ${{ github.token }}
71
+ install: |
72
+ apt-get update
73
+ apt-get install -y --no-install-recommends python3 python3-pip
74
+ run: |
75
+ set -e
76
+ pip install uv
77
+ for version in 3.8 3.9 3.10 3.11 3.12; do
78
+ uv venv --preview --python $version
79
+ source .venv/bin/activate
80
+ uv pip install primp --no-index --find-links dist --force-reinstall
81
+ uv pip install pytest
82
+ pytest
83
+ done
84
+
85
+ musllinux:
86
+ runs-on: ${{ matrix.platform.runner }}
87
+ strategy:
88
+ fail-fast: false
89
+ matrix:
90
+ platform:
91
+ - runner: ubuntu-latest
92
+ target: x86_64
93
+ - runner: ubuntu-latest
94
+ target: aarch64
95
+ steps:
96
+ - uses: actions/checkout@v4
97
+ - uses: actions/setup-python@v5
98
+ with:
99
+ python-version: 3.x
100
+ - name: Build wheels
101
+ uses: PyO3/maturin-action@v1
102
+ with:
103
+ target: ${{ matrix.platform.target }}
104
+ args: --release --out dist --zig
105
+ sccache: 'true'
106
+ manylinux: musllinux_1_2
107
+ - name: Upload wheels
108
+ uses: actions/upload-artifact@v4
109
+ with:
110
+ name: wheels-musllinux-${{ matrix.platform.target }}
111
+ path: dist
112
+ - name: QEMU
113
+ if: matrix.platform.target != 'x86_64'
114
+ uses: docker/setup-qemu-action@v3
115
+ - name: pytest
116
+ uses: addnab/docker-run-action@v3
117
+ with:
118
+ image: quay.io/pypa/musllinux_1_2_${{ matrix.platform.target }}:latest
119
+ options: -v ${{ github.workspace }}:/io -w /io
120
+ run: |
121
+ for version in 3.8 3.9 3.10 3.11 3.12; do
122
+ python$version -m venv .venv
123
+ source .venv/bin/activate
124
+ pip install primp --no-index --find-links dist --force-reinstall
125
+ pip install pytest
126
+ pytest
127
+ done
128
+
129
+ windows:
130
+ runs-on: ${{ matrix.platform.runner }}
131
+ strategy:
132
+ fail-fast: false
133
+ matrix:
134
+ platform:
135
+ - runner: windows-latest
136
+ target: x64
137
+ steps:
138
+ - uses: actions/checkout@v4
139
+ - uses: actions/setup-python@v5
140
+ with:
141
+ python-version: 3.x
142
+ architecture: ${{ matrix.platform.target }}
143
+ - name: Install nasm
144
+ run: choco install nasm
145
+ - name: Build wheels
146
+ uses: PyO3/maturin-action@v1
147
+ with:
148
+ target: ${{ matrix.platform.target }}
149
+ args: --release --out dist
150
+ sccache: 'true'
151
+ - name: Upload wheels
152
+ uses: actions/upload-artifact@v4
153
+ with:
154
+ name: wheels-windows-${{ matrix.platform.target }}
155
+ path: dist
156
+ - name: pytest
157
+ if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
158
+ shell: bash
159
+ run: |
160
+ set -e
161
+ pip install uv
162
+ for version in 3.8 3.9 3.10 3.11 3.12; do
163
+ uv venv --preview --python $version
164
+ source .venv/Scripts/activate
165
+ uv pip install primp --no-index --find-links dist --force-reinstall
166
+ uv pip install pytest
167
+ pytest
168
+ done
169
+
170
+ macos:
171
+ runs-on: ${{ matrix.platform.runner }}
172
+ strategy:
173
+ fail-fast: false
174
+ matrix:
175
+ platform:
176
+ - runner: macos-12
177
+ target: x86_64
178
+ - runner: macos-14
179
+ target: aarch64
180
+ steps:
181
+ - uses: actions/checkout@v4
182
+ - uses: actions/setup-python@v5
183
+ with:
184
+ python-version: 3.x
185
+ - name: Build wheels
186
+ uses: PyO3/maturin-action@v1
187
+ with:
188
+ target: ${{ matrix.platform.target }}
189
+ args: --release --out dist
190
+ sccache: 'true'
191
+ - name: Upload wheels
192
+ uses: actions/upload-artifact@v4
193
+ with:
194
+ name: wheels-macos-${{ matrix.platform.target }}
195
+ path: dist
196
+ - name: pytest
197
+ run: |
198
+ set -e
199
+ pip install uv
200
+ for version in 3.8 3.9 3.10 3.11 3.12; do
201
+ uv venv --preview --python $version
202
+ source .venv/bin/activate
203
+ uv pip install primp --no-index --find-links dist --force-reinstall
204
+ uv pip install pytest
205
+ pytest
206
+ done
207
+
208
+ sdist:
209
+ runs-on: ubuntu-latest
210
+ steps:
211
+ - uses: actions/checkout@v4
212
+ - name: Build sdist
213
+ uses: PyO3/maturin-action@v1
214
+ with:
215
+ command: sdist
216
+ args: --out dist
217
+ - name: Upload sdist
218
+ uses: actions/upload-artifact@v4
219
+ with:
220
+ name: wheels-sdist
221
+ path: dist
222
+
223
+ release:
224
+ name: Release
225
+ runs-on: ubuntu-latest
226
+ if: "startsWith(github.ref, 'refs/tags/')"
227
+ needs: [linux, musllinux, windows, macos, sdist]
228
+ steps:
229
+ - uses: actions/download-artifact@v4
230
+ - name: Publish to PyPI
231
+ uses: PyO3/maturin-action@v1
232
+ env:
233
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
234
+ with:
235
+ command: upload
236
+ args: --non-interactive --skip-existing wheels-*/*
237
+
238
+ benchmark:
239
+ permissions:
240
+ contents: write
241
+ runs-on: ubuntu-latest
242
+ needs: [linux]
243
+ steps:
244
+ - uses: actions/checkout@v4
245
+ - name: Set up Python
246
+ uses: actions/setup-python@v5
247
+ with:
248
+ python-version: 3.x
249
+ - name: Download wheels
250
+ uses: actions/download-artifact@v4
251
+ with:
252
+ name: wheels-linux-x86_64
253
+ - name: Install dependencies
254
+ run: |
255
+ pip install -r benchmark/requirements.txt
256
+ pip install primp --no-index --find-links ./ --force-reinstall
257
+ - name: Start Uvicorn server
258
+ run: |
259
+ uvicorn benchmark.server:app --host 0.0.0.0 --port 8000 &
260
+ sleep 10
261
+ - name: Run benchmark
262
+ run: python benchmark/benchmark.py
263
+ - name: Generate image, commit to the temp branch, merge changes into main, delete temp branch
264
+ if: "startsWith(github.ref, 'refs/tags/')"
265
+ run: |
266
+ python benchmark/generate_image.py
267
+ git config --global user.name 'GitHub Actions'
268
+ git config --global user.email 'actions@github.com'
269
+ git add \*.jpg
270
+ git diff --quiet && git diff --staged --quiet || git commit -m "Update generated image"
271
+ git checkout -b update-generated-image
272
+ git push https://${{ secrets.PUSH_TOKEN }}@github.com/deedy5/primp.git update-generated-image || echo "No changes to push"
273
+ git fetch origin
274
+ git checkout main
275
+ git merge update-generated-image
276
+ git push https://${{ secrets.PUSH_TOKEN }}@github.com/deedy5/primp.git main
277
+ git push origin --delete update-generated-image
primp-0.5.3/.gitignore ADDED
@@ -0,0 +1,76 @@
1
+ /target
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ .pytest_cache/
6
+ *.py[cod]
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ .venv/
14
+ env/
15
+ bin/
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ include/
26
+ man/
27
+ venv/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+ pip-selfcheck.json
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+
45
+ # Translations
46
+ *.mo
47
+
48
+ # Mr Developer
49
+ .mr.developer.cfg
50
+ .project
51
+ .pydevproject
52
+
53
+ # Rope
54
+ .ropeproject
55
+
56
+ # Django stuff:
57
+ *.log
58
+ *.pot
59
+
60
+ .DS_Store
61
+
62
+ # Sphinx documentation
63
+ docs/_build/
64
+
65
+ # PyCharm
66
+ .idea/
67
+
68
+ # VSCode
69
+ .vscode/
70
+
71
+ # Pyenv
72
+ .python-version
73
+
74
+ # Ignore csv and jpg files in benchmark folder
75
+ benchmark/*.csv
76
+ benchmark/*.jpg