synaops 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.
@@ -0,0 +1,11 @@
1
+ # PyO3 abi3 builds on macOS need `-undefined dynamic_lookup` so Python C API
2
+ # symbols are deferred to runtime (Python resolves them when it loads the
3
+ # extension). PyO3's `extension-module` feature is supposed to add this via
4
+ # build.rs but the flag isn't reliably applied for abi3 on Apple Silicon —
5
+ # pinning it here avoids the linker error.
6
+
7
+ [target.aarch64-apple-darwin]
8
+ rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
9
+
10
+ [target.x86_64-apple-darwin]
11
+ rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
@@ -0,0 +1,71 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test-linux:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+
20
+ - uses: actions/setup-python@v6
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - uses: dtolnay/rust-toolchain@stable
25
+
26
+ - uses: Swatinem/rust-cache@v2
27
+
28
+ - name: cargo test
29
+ run: cargo test --release
30
+
31
+ - name: Install synaops + test deps
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ pip install pytest pytest-benchmark
35
+ pip install git+https://github.com/SynaLinks/synalinks.git
36
+ pip install .
37
+
38
+ - name: Parity tests
39
+ run: pytest bench/test_parity.py -v
40
+
41
+ test-cross:
42
+ name: smoke ${{ matrix.os }} / py${{ matrix.python-version }}
43
+ runs-on: ${{ matrix.os }}
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ os: [macos-latest, windows-latest]
48
+ python-version: ["3.10", "3.13"]
49
+
50
+ steps:
51
+ - uses: actions/checkout@v5
52
+
53
+ - uses: actions/setup-python@v6
54
+ with:
55
+ python-version: ${{ matrix.python-version }}
56
+
57
+ - uses: dtolnay/rust-toolchain@stable
58
+
59
+ - uses: Swatinem/rust-cache@v2
60
+
61
+ - name: cargo test
62
+ run: cargo test --release
63
+
64
+ - name: Install synaops
65
+ run: |
66
+ python -m pip install --upgrade pip
67
+ pip install .
68
+
69
+ - name: Import smoke test
70
+ run: |
71
+ python -c "import synaops; print(synaops.prefix_json({'a': 1}, 'pre'))"
@@ -0,0 +1,147 @@
1
+ name: Release
2
+
3
+ # Triggers on a version tag push (e.g. `git tag v0.1.0 && git push --tags`)
4
+ # or manually via the Actions UI.
5
+ #
6
+ # Builds abi3 wheels (cp310-abi3-*) — one wheel per platform/arch covers
7
+ # every Python 3.10+.
8
+ #
9
+ # One-time setup:
10
+ # 1. Create a GitHub Environment named `pypi` (Settings → Environments).
11
+ # Ideally restrict deployment to tags matching `v*`.
12
+ # 2. Add `PYPI_API_TOKEN` as a secret on that environment (scoping it to
13
+ # the env is more restrictive than a repo-level secret).
14
+ # To migrate to Trusted Publishing later: drop the env block, add
15
+ # `permissions: id-token: write`, and use pypa/gh-action-pypi-publish.
16
+
17
+ on:
18
+ push:
19
+ tags: ["v*"]
20
+ workflow_dispatch:
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ jobs:
26
+ manylinux:
27
+ runs-on: ubuntu-latest
28
+ strategy:
29
+ fail-fast: false
30
+ matrix:
31
+ target: [x86_64, aarch64]
32
+ steps:
33
+ - uses: actions/checkout@v5
34
+ - uses: actions/setup-python@v6
35
+ with:
36
+ python-version: "3.10"
37
+ - name: Build wheels
38
+ uses: PyO3/maturin-action@v1
39
+ with:
40
+ target: ${{ matrix.target }}
41
+ args: --release --out dist
42
+ manylinux: auto
43
+ - uses: actions/upload-artifact@v5
44
+ with:
45
+ name: wheels-manylinux-${{ matrix.target }}
46
+ path: dist
47
+
48
+ musllinux:
49
+ runs-on: ubuntu-latest
50
+ strategy:
51
+ fail-fast: false
52
+ matrix:
53
+ target: [x86_64, aarch64]
54
+ steps:
55
+ - uses: actions/checkout@v5
56
+ - uses: actions/setup-python@v6
57
+ with:
58
+ python-version: "3.10"
59
+ - name: Build wheels
60
+ uses: PyO3/maturin-action@v1
61
+ with:
62
+ target: ${{ matrix.target }}
63
+ args: --release --out dist
64
+ manylinux: musllinux_1_2
65
+ - uses: actions/upload-artifact@v5
66
+ with:
67
+ name: wheels-musllinux-${{ matrix.target }}
68
+ path: dist
69
+
70
+ macos:
71
+ runs-on: macos-latest
72
+ strategy:
73
+ fail-fast: false
74
+ matrix:
75
+ target: [x86_64, aarch64]
76
+ steps:
77
+ - uses: actions/checkout@v5
78
+ - uses: actions/setup-python@v6
79
+ with:
80
+ python-version: "3.10"
81
+ - name: Build wheels
82
+ uses: PyO3/maturin-action@v1
83
+ with:
84
+ target: ${{ matrix.target }}
85
+ args: --release --out dist
86
+ - uses: actions/upload-artifact@v5
87
+ with:
88
+ name: wheels-macos-${{ matrix.target }}
89
+ path: dist
90
+
91
+ windows:
92
+ runs-on: windows-latest
93
+ strategy:
94
+ fail-fast: false
95
+ matrix:
96
+ target: [x64]
97
+ steps:
98
+ - uses: actions/checkout@v5
99
+ - uses: actions/setup-python@v6
100
+ with:
101
+ python-version: "3.10"
102
+ architecture: ${{ matrix.target }}
103
+ - name: Build wheels
104
+ uses: PyO3/maturin-action@v1
105
+ with:
106
+ target: ${{ matrix.target }}
107
+ args: --release --out dist
108
+ - uses: actions/upload-artifact@v5
109
+ with:
110
+ name: wheels-windows-${{ matrix.target }}
111
+ path: dist
112
+
113
+ sdist:
114
+ runs-on: ubuntu-latest
115
+ steps:
116
+ - uses: actions/checkout@v5
117
+ - name: Build sdist
118
+ uses: PyO3/maturin-action@v1
119
+ with:
120
+ command: sdist
121
+ args: --out dist
122
+ - uses: actions/upload-artifact@v5
123
+ with:
124
+ name: wheels-sdist
125
+ path: dist
126
+
127
+ release:
128
+ name: Publish to PyPI
129
+ runs-on: ubuntu-latest
130
+ needs: [manylinux, musllinux, macos, windows, sdist]
131
+ if: startsWith(github.ref, 'refs/tags/')
132
+ environment:
133
+ name: pypi
134
+ url: https://pypi.org/p/synaops
135
+ steps:
136
+ - uses: actions/download-artifact@v5
137
+ with:
138
+ pattern: wheels-*
139
+ path: dist
140
+ merge-multiple: true
141
+ - name: Publish to PyPI
142
+ uses: PyO3/maturin-action@v1
143
+ env:
144
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
145
+ with:
146
+ command: upload
147
+ args: --non-interactive --skip-existing dist/*
@@ -0,0 +1,78 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual environments
26
+ .env
27
+ .venv
28
+ env/
29
+ venv/
30
+ ENV/
31
+ env.bak/
32
+ venv.bak/
33
+
34
+ # Testing / coverage
35
+ .tox/
36
+ .nox/
37
+ .coverage
38
+ .coverage.*
39
+ .cache
40
+ nosetests.xml
41
+ coverage.xml
42
+ *.cover
43
+ *.py,cover
44
+ .hypothesis/
45
+ .pytest_cache/
46
+ .benchmarks/
47
+ .ruff_cache/
48
+ .mypy_cache/
49
+ .dmypy.json
50
+ dmypy.json
51
+ .pyre/
52
+ .pytype/
53
+
54
+ # Jupyter
55
+ .ipynb_checkpoints
56
+ profile_default/
57
+ ipython_config.py
58
+
59
+ # Type checker / tooling
60
+ .pdm-python
61
+ __pypackages__/
62
+
63
+ # Rust
64
+ target/
65
+ **/*.rs.bk
66
+ *.pdb
67
+ Cargo.lock.bak
68
+
69
+ # IDE / editor
70
+ .idea/
71
+ .vscode/
72
+ *.swp
73
+ *.swo
74
+ *~
75
+
76
+ # OS
77
+ .DS_Store
78
+ Thumbs.db
@@ -0,0 +1,314 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "aho-corasick"
7
+ version = "1.1.4"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
10
+ dependencies = [
11
+ "memchr",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.0"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
19
+
20
+ [[package]]
21
+ name = "cfg-if"
22
+ version = "1.0.4"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
25
+
26
+ [[package]]
27
+ name = "equivalent"
28
+ version = "1.0.2"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
31
+
32
+ [[package]]
33
+ name = "hashbrown"
34
+ version = "0.16.1"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
37
+
38
+ [[package]]
39
+ name = "heck"
40
+ version = "0.5.0"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
43
+
44
+ [[package]]
45
+ name = "indexmap"
46
+ version = "2.13.0"
47
+ source = "registry+https://github.com/rust-lang/crates.io-index"
48
+ checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
49
+ dependencies = [
50
+ "equivalent",
51
+ "hashbrown",
52
+ ]
53
+
54
+ [[package]]
55
+ name = "indoc"
56
+ version = "2.0.7"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
59
+ dependencies = [
60
+ "rustversion",
61
+ ]
62
+
63
+ [[package]]
64
+ name = "itoa"
65
+ version = "1.0.18"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
68
+
69
+ [[package]]
70
+ name = "libc"
71
+ version = "0.2.185"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"
74
+
75
+ [[package]]
76
+ name = "memchr"
77
+ version = "2.8.0"
78
+ source = "registry+https://github.com/rust-lang/crates.io-index"
79
+ checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
80
+
81
+ [[package]]
82
+ name = "memoffset"
83
+ version = "0.9.1"
84
+ source = "registry+https://github.com/rust-lang/crates.io-index"
85
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
86
+ dependencies = [
87
+ "autocfg",
88
+ ]
89
+
90
+ [[package]]
91
+ name = "once_cell"
92
+ version = "1.21.4"
93
+ source = "registry+https://github.com/rust-lang/crates.io-index"
94
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
95
+
96
+ [[package]]
97
+ name = "portable-atomic"
98
+ version = "1.13.1"
99
+ source = "registry+https://github.com/rust-lang/crates.io-index"
100
+ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
101
+
102
+ [[package]]
103
+ name = "proc-macro2"
104
+ version = "1.0.106"
105
+ source = "registry+https://github.com/rust-lang/crates.io-index"
106
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
107
+ dependencies = [
108
+ "unicode-ident",
109
+ ]
110
+
111
+ [[package]]
112
+ name = "pyo3"
113
+ version = "0.22.6"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884"
116
+ dependencies = [
117
+ "cfg-if",
118
+ "indoc",
119
+ "libc",
120
+ "memoffset",
121
+ "once_cell",
122
+ "portable-atomic",
123
+ "pyo3-build-config",
124
+ "pyo3-ffi",
125
+ "pyo3-macros",
126
+ "unindent",
127
+ ]
128
+
129
+ [[package]]
130
+ name = "pyo3-build-config"
131
+ version = "0.22.6"
132
+ source = "registry+https://github.com/rust-lang/crates.io-index"
133
+ checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38"
134
+ dependencies = [
135
+ "once_cell",
136
+ "target-lexicon",
137
+ ]
138
+
139
+ [[package]]
140
+ name = "pyo3-ffi"
141
+ version = "0.22.6"
142
+ source = "registry+https://github.com/rust-lang/crates.io-index"
143
+ checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636"
144
+ dependencies = [
145
+ "libc",
146
+ "pyo3-build-config",
147
+ ]
148
+
149
+ [[package]]
150
+ name = "pyo3-macros"
151
+ version = "0.22.6"
152
+ source = "registry+https://github.com/rust-lang/crates.io-index"
153
+ checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453"
154
+ dependencies = [
155
+ "proc-macro2",
156
+ "pyo3-macros-backend",
157
+ "quote",
158
+ "syn",
159
+ ]
160
+
161
+ [[package]]
162
+ name = "pyo3-macros-backend"
163
+ version = "0.22.6"
164
+ source = "registry+https://github.com/rust-lang/crates.io-index"
165
+ checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe"
166
+ dependencies = [
167
+ "heck",
168
+ "proc-macro2",
169
+ "pyo3-build-config",
170
+ "quote",
171
+ "syn",
172
+ ]
173
+
174
+ [[package]]
175
+ name = "pythonize"
176
+ version = "0.22.0"
177
+ source = "registry+https://github.com/rust-lang/crates.io-index"
178
+ checksum = "90fcf491425978bd889015d5430f6473d91bdfa2097262f1e731aadcf6c2113e"
179
+ dependencies = [
180
+ "pyo3",
181
+ "serde",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "quote"
186
+ version = "1.0.45"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
189
+ dependencies = [
190
+ "proc-macro2",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "regex"
195
+ version = "1.12.3"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
198
+ dependencies = [
199
+ "aho-corasick",
200
+ "memchr",
201
+ "regex-automata",
202
+ "regex-syntax",
203
+ ]
204
+
205
+ [[package]]
206
+ name = "regex-automata"
207
+ version = "0.4.14"
208
+ source = "registry+https://github.com/rust-lang/crates.io-index"
209
+ checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
210
+ dependencies = [
211
+ "aho-corasick",
212
+ "memchr",
213
+ "regex-syntax",
214
+ ]
215
+
216
+ [[package]]
217
+ name = "regex-syntax"
218
+ version = "0.8.10"
219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
220
+ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
221
+
222
+ [[package]]
223
+ name = "rustversion"
224
+ version = "1.0.22"
225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
226
+ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
227
+
228
+ [[package]]
229
+ name = "serde"
230
+ version = "1.0.228"
231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
232
+ checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
233
+ dependencies = [
234
+ "serde_core",
235
+ ]
236
+
237
+ [[package]]
238
+ name = "serde_core"
239
+ version = "1.0.228"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
242
+ dependencies = [
243
+ "serde_derive",
244
+ ]
245
+
246
+ [[package]]
247
+ name = "serde_derive"
248
+ version = "1.0.228"
249
+ source = "registry+https://github.com/rust-lang/crates.io-index"
250
+ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
251
+ dependencies = [
252
+ "proc-macro2",
253
+ "quote",
254
+ "syn",
255
+ ]
256
+
257
+ [[package]]
258
+ name = "serde_json"
259
+ version = "1.0.149"
260
+ source = "registry+https://github.com/rust-lang/crates.io-index"
261
+ checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
262
+ dependencies = [
263
+ "indexmap",
264
+ "itoa",
265
+ "memchr",
266
+ "serde",
267
+ "serde_core",
268
+ "zmij",
269
+ ]
270
+
271
+ [[package]]
272
+ name = "syn"
273
+ version = "2.0.117"
274
+ source = "registry+https://github.com/rust-lang/crates.io-index"
275
+ checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
276
+ dependencies = [
277
+ "proc-macro2",
278
+ "quote",
279
+ "unicode-ident",
280
+ ]
281
+
282
+ [[package]]
283
+ name = "synaops"
284
+ version = "0.1.0"
285
+ dependencies = [
286
+ "pyo3",
287
+ "pythonize",
288
+ "regex",
289
+ "serde_json",
290
+ ]
291
+
292
+ [[package]]
293
+ name = "target-lexicon"
294
+ version = "0.12.16"
295
+ source = "registry+https://github.com/rust-lang/crates.io-index"
296
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
297
+
298
+ [[package]]
299
+ name = "unicode-ident"
300
+ version = "1.0.24"
301
+ source = "registry+https://github.com/rust-lang/crates.io-index"
302
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
303
+
304
+ [[package]]
305
+ name = "unindent"
306
+ version = "0.2.4"
307
+ source = "registry+https://github.com/rust-lang/crates.io-index"
308
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
309
+
310
+ [[package]]
311
+ name = "zmij"
312
+ version = "1.0.21"
313
+ source = "registry+https://github.com/rust-lang/crates.io-index"
314
+ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
@@ -0,0 +1,17 @@
1
+ [package]
2
+ name = "synaops"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ license = "Apache-2.0"
6
+ description = "Native Rust implementations of synalinks JSON/schema operations."
7
+ readme = "README.md"
8
+
9
+ [lib]
10
+ name = "synaops"
11
+ crate-type = ["cdylib", "rlib"]
12
+
13
+ [dependencies]
14
+ pyo3 = { version = "0.22", features = ["extension-module", "abi3-py310"] }
15
+ pythonize = "0.22"
16
+ serde_json = { version = "1", features = ["preserve_order"] }
17
+ regex = "1"