groth16py 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 (157) hide show
  1. groth16py-0.1.0/.github/workflows/ci.yml +58 -0
  2. groth16py-0.1.0/.github/workflows/docs.yml +75 -0
  3. groth16py-0.1.0/.github/workflows/wheels.yml +107 -0
  4. groth16py-0.1.0/.gitignore +29 -0
  5. groth16py-0.1.0/Cargo.lock +2698 -0
  6. groth16py-0.1.0/Cargo.toml +109 -0
  7. groth16py-0.1.0/LICENSE +674 -0
  8. groth16py-0.1.0/Makefile +46 -0
  9. groth16py-0.1.0/PKG-INFO +285 -0
  10. groth16py-0.1.0/README.md +265 -0
  11. groth16py-0.1.0/circuits/README.md +49 -0
  12. groth16py-0.1.0/circuits/merkleTree.circom +57 -0
  13. groth16py-0.1.0/circuits/withdraw.circom +76 -0
  14. groth16py-0.1.0/pyproject.toml +40 -0
  15. groth16py-0.1.0/python/groth16py/__init__.py +85 -0
  16. groth16py-0.1.0/python/groth16py/_groth16py.pyi +141 -0
  17. groth16py-0.1.0/python/groth16py/_vendor/README.md +17 -0
  18. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/aliascheck.circom +43 -0
  19. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/babyjub.circom +106 -0
  20. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/binsub.circom +71 -0
  21. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/binsum.circom +95 -0
  22. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/bitify.circom +103 -0
  23. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/comparators.circom +139 -0
  24. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/compconstant.circom +74 -0
  25. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/eddsa.circom +141 -0
  26. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/eddsamimc.circom +122 -0
  27. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/eddsamimcsponge.circom +122 -0
  28. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/eddsaposeidon.circom +121 -0
  29. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/escalarmul.circom +165 -0
  30. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/escalarmulany.circom +196 -0
  31. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/escalarmulfix.circom +300 -0
  32. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/escalarmulw4table.circom +51 -0
  33. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/gates.circom +92 -0
  34. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mimc.circom +155 -0
  35. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mimcsponge.circom +290 -0
  36. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/montgomery.circom +142 -0
  37. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/multiplexer.circom +113 -0
  38. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mux1.circom +47 -0
  39. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mux2.circom +62 -0
  40. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mux3.circom +74 -0
  41. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/mux4.circom +118 -0
  42. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/pedersen.circom +256 -0
  43. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/pedersen_old.circom +66 -0
  44. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/pointbits.circom +163 -0
  45. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/poseidon.circom +203 -0
  46. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/sign.circom +35 -0
  47. groth16py-0.1.0/python/groth16py/_vendor/circomlib1/circuits/switcher.circom +40 -0
  48. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/README.md +830 -0
  49. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/aliascheck.circom +33 -0
  50. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/babyjub.circom +107 -0
  51. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/binsub.circom +74 -0
  52. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/binsum.circom +101 -0
  53. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/bitify.circom +106 -0
  54. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/comparators.circom +141 -0
  55. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/compconstant.circom +74 -0
  56. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/eddsa.circom +139 -0
  57. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/eddsamimc.circom +124 -0
  58. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/eddsamimcsponge.circom +124 -0
  59. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/eddsaposeidon.circom +123 -0
  60. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/escalarmul.circom +166 -0
  61. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/escalarmulany.circom +197 -0
  62. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/escalarmulfix.circom +299 -0
  63. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/escalarmulw4table.circom +52 -0
  64. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/gates.circom +96 -0
  65. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mimc.circom +156 -0
  66. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mimcsponge.circom +293 -0
  67. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/montgomery.circom +142 -0
  68. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/multiplexer.circom +115 -0
  69. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mux1.circom +48 -0
  70. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mux2.circom +63 -0
  71. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mux3.circom +75 -0
  72. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/mux4.circom +119 -0
  73. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/pedersen.circom +257 -0
  74. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/pedersen_old.circom +68 -0
  75. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/pointbits.circom +164 -0
  76. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/poseidon.circom +208 -0
  77. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/poseidon_constants.circom +24959 -0
  78. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/poseidon_constants_old.circom +252 -0
  79. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/poseidon_old.circom +97 -0
  80. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/ch.circom +47 -0
  81. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/constants.circom +53 -0
  82. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/main.circom +35 -0
  83. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/maj.circom +45 -0
  84. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/rotate.circom +28 -0
  85. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sha256.circom +81 -0
  86. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sha256_2.circom +91 -0
  87. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sha256compression.circom +166 -0
  88. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sha256compression_function.circom +112 -0
  89. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/shift.circom +33 -0
  90. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sigma.circom +77 -0
  91. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/sigmaplus.circom +50 -0
  92. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/t1.circom +58 -0
  93. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/t2.circom +51 -0
  94. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sha256/xor3.circom +45 -0
  95. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/sign.circom +36 -0
  96. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smthash_mimc.circom +58 -0
  97. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smthash_poseidon.circom +57 -0
  98. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtlevins.circom +103 -0
  99. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtprocessor.circom +261 -0
  100. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtprocessorlevel.circom +95 -0
  101. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtprocessorsm.circom +165 -0
  102. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtverifier.circom +138 -0
  103. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtverifierlevel.circom +71 -0
  104. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/smt/smtverifiersm.circom +106 -0
  105. groth16py-0.1.0/python/groth16py/_vendor/circomlib2/circuits/switcher.circom +42 -0
  106. groth16py-0.1.0/python/groth16py/_vendor/circuits1/merkleTree.circom +51 -0
  107. groth16py-0.1.0/python/groth16py/_vendor/circuits1/withdraw.circom +67 -0
  108. groth16py-0.1.0/python/groth16py/_vendor/circuits2/merkleTree.circom +57 -0
  109. groth16py-0.1.0/python/groth16py/_vendor/circuits2/withdraw.circom +76 -0
  110. groth16py-0.1.0/python/groth16py/py.typed +0 -0
  111. groth16py-0.1.0/src/circom1.rs +112 -0
  112. groth16py-0.1.0/src/circom1_compile.rs +208 -0
  113. groth16py-0.1.0/src/circom1_compile_harness.js +122 -0
  114. groth16py-0.1.0/src/circom1_witness.js +245 -0
  115. groth16py-0.1.0/src/circom_reduction.rs +127 -0
  116. groth16py-0.1.0/src/compile.rs +132 -0
  117. groth16py-0.1.0/src/encoding.rs +239 -0
  118. groth16py-0.1.0/src/error.rs +48 -0
  119. groth16py-0.1.0/src/legacy.rs +372 -0
  120. groth16py-0.1.0/src/lib.rs +77 -0
  121. groth16py-0.1.0/src/persist.rs +202 -0
  122. groth16py-0.1.0/src/prove.rs +181 -0
  123. groth16py-0.1.0/src/r1cs.rs +208 -0
  124. groth16py-0.1.0/src/setup.rs +221 -0
  125. groth16py-0.1.0/src/solidity.rs +97 -0
  126. groth16py-0.1.0/src/vendor/circom1/README.md +16 -0
  127. groth16py-0.1.0/src/vendor/circom1/big-integer.js +1321 -0
  128. groth16py-0.1.0/src/vendor/circom1/compiler.js +489 -0
  129. groth16py-0.1.0/src/vendor/circom1/exec.js +1186 -0
  130. groth16py-0.1.0/src/vendor/circom1/genOptCode.js +70 -0
  131. groth16py-0.1.0/src/vendor/circom1/gencode.js +633 -0
  132. groth16py-0.1.0/src/vendor/circom1/jaz.js +1395 -0
  133. groth16py-0.1.0/src/vendor/circom1/lcalgebra.js +506 -0
  134. groth16py-0.1.0/src/verify.rs +121 -0
  135. groth16py-0.1.0/src/vk.rs +196 -0
  136. groth16py-0.1.0/src/wasm_witness.rs +194 -0
  137. groth16py-0.1.0/src/websnark.rs +242 -0
  138. groth16py-0.1.0/src/witness.rs +88 -0
  139. groth16py-0.1.0/src/zkey.rs +260 -0
  140. groth16py-0.1.0/templates/verifier_bytes.sol.tmpl +195 -0
  141. groth16py-0.1.0/templates/verifier_snarkjs.sol.tmpl +183 -0
  142. groth16py-0.1.0/tests/encoding_roundtrip.rs +106 -0
  143. groth16py-0.1.0/tests/fixtures/README.md +18 -0
  144. groth16py-0.1.0/tests/fixtures/Verifier.sol +275 -0
  145. groth16py-0.1.0/tests/fixtures/mul.circom +8 -0
  146. groth16py-0.1.0/tests/fixtures/mul.zkey +0 -0
  147. groth16py-0.1.0/tests/fixtures/mul_vk.json +94 -0
  148. groth16py-0.1.0/tests/fixtures/withdraw_proof.json +12 -0
  149. groth16py-0.1.0/tests/fixtures/withdraw_verification_key.json +1 -0
  150. groth16py-0.1.0/tests/native.rs +210 -0
  151. groth16py-0.1.0/tests/onchain/.gitignore +5 -0
  152. groth16py-0.1.0/tests/onchain/foundry.toml +7 -0
  153. groth16py-0.1.0/tests/onchain/parity.sh +70 -0
  154. groth16py-0.1.0/tests/solidity.rs +84 -0
  155. groth16py-0.1.0/tests/test_api.py +263 -0
  156. groth16py-0.1.0/tests/verify.rs +70 -0
  157. groth16py-0.1.0/uv.lock +8 -0
@@ -0,0 +1,58 @@
1
+ name: CI
2
+
3
+ # Runs on every push to main and on PRs (plus manual dispatch). cargo test (default + native),
4
+ # maturin develop + pytest per platform, and an anvil on-chain parity job. Node-free; pure Rust
5
+ # (no protoc/wasmer); the native build pulls circom + boa.
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ rust:
15
+ name: cargo test (default + native)
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: dtolnay/rust-toolchain@stable
20
+ - uses: Swatinem/rust-cache@v2
21
+ # Default features: pure-arkworks crypto core (fast, no circom crates).
22
+ - run: cargo test --all --verbose
23
+ # Native feature: in-process circom compile + wasmi witness + zkey import.
24
+ - run: cargo test --features native --verbose
25
+
26
+ python:
27
+ name: maturin + pytest (uv)
28
+ runs-on: ${{ matrix.os }}
29
+ strategy:
30
+ fail-fast: false
31
+ matrix:
32
+ os: [ubuntu-latest, macos-latest, windows-latest]
33
+ python-version: ["3.9", "3.12"]
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: astral-sh/setup-uv@v5
37
+ - uses: dtolnay/rust-toolchain@stable
38
+ - uses: Swatinem/rust-cache@v2
39
+ # uv-managed venv; the wheel bundles the `native` feature (circom + wasmi) — no protoc,
40
+ # no wasmer, no Node.
41
+ - run: uv venv --python ${{ matrix.python-version }}
42
+ - run: uv pip install maturin pytest
43
+ - run: uv run maturin develop
44
+ - run: uv run pytest -v
45
+
46
+ parity:
47
+ name: on-chain parity (anvil)
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: astral-sh/setup-uv@v5
52
+ - uses: dtolnay/rust-toolchain@stable
53
+ - uses: Swatinem/rust-cache@v2
54
+ - uses: foundry-rs/foundry-toolchain@v1
55
+ # §11.2 + §11.4: emit both verifier styles from the library, deploy to anvil, and
56
+ # confirm verifyProof agrees (genuine -> true, tampered -> false).
57
+ - run: uv venv && uv pip install maturin && uv run maturin develop
58
+ - run: bash tests/onchain/parity.sh
@@ -0,0 +1,75 @@
1
+ name: docs
2
+
3
+ # Manual-only (workflow_dispatch): build the Rust (cargo doc) and Python (pdoc) API docs and
4
+ # publish them to GitHub Pages under one site (/ landing, /rust, /python). The crate can't go on
5
+ # docs.rs — the `native` feature pulls the circom compiler crates by git, which crates.io/docs.rs
6
+ # reject — so docs are built and hosted here. Requires Pages enabled in the repo settings.
7
+ on:
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+ pages: write
13
+ id-token: write
14
+
15
+ # Allow one concurrent deployment.
16
+ concurrency:
17
+ group: pages
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: astral-sh/setup-uv@v5
26
+ - uses: dtolnay/rust-toolchain@stable
27
+ - uses: Swatinem/rust-cache@v2
28
+
29
+ # Rust API docs (native feature -> documents the full surface).
30
+ - run: cargo doc --features native --no-deps
31
+
32
+ # Python API docs via pdoc (reads the compiled module's docstrings).
33
+ - run: uv venv
34
+ - run: uv pip install maturin pdoc
35
+ - run: uv run maturin develop
36
+ - run: uv run pdoc groth16py -o docs/python
37
+
38
+ # Assemble a single site: landing page + /rust + /python.
39
+ - name: Assemble site
40
+ run: |
41
+ mkdir -p site/rust site/python
42
+ cp -r target/doc/. site/rust/
43
+ cp -r docs/python/. site/python/
44
+ cat > site/index.html <<'HTML'
45
+ <!doctype html>
46
+ <html lang="en"><head><meta charset="utf-8">
47
+ <meta name="viewport" content="width=device-width, initial-scale=1">
48
+ <title>groth16py — documentation</title>
49
+ <style>
50
+ body{font-family:system-ui,sans-serif;max-width:44rem;margin:4rem auto;padding:0 1rem;line-height:1.6}
51
+ a{color:#0366d6;text-decoration:none} a:hover{text-decoration:underline}
52
+ .card{display:block;padding:1rem 1.25rem;margin:.75rem 0;border:1px solid #d0d7de;border-radius:8px}
53
+ code{background:#f6f8fa;padding:.1em .3em;border-radius:4px}
54
+ </style></head><body>
55
+ <h1>groth16py</h1>
56
+ <p>arkworks-backed BN254 Groth16 for Python — no Node.js. API documentation:</p>
57
+ <a class="card" href="./python/groth16py.html"><strong>Python API</strong> — <code>groth16py</code> module (pdoc)</a>
58
+ <a class="card" href="./rust/groth16py/index.html"><strong>Rust API</strong> — the <code>groth16py</code> crate (cargo doc)</a>
59
+ <p>See the <a href="https://github.com/luksgrin/groth16py">repository</a> for the README and usage guide.</p>
60
+ </body></html>
61
+ HTML
62
+
63
+ - uses: actions/upload-pages-artifact@v3
64
+ with:
65
+ path: site
66
+
67
+ deploy:
68
+ needs: build
69
+ runs-on: ubuntu-latest
70
+ environment:
71
+ name: github-pages
72
+ url: ${{ steps.deployment.outputs.page_url }}
73
+ steps:
74
+ - id: deployment
75
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,107 @@
1
+ name: wheels
2
+
3
+ # Builds the abi3 wheel matrix + sdist. Triggered by pushing a `v*` tag (which also publishes to
4
+ # PyPI), or manually (with an opt-in `publish` input). abi3-py39 -> one wheel per platform, works
5
+ # across CPython >= 3.9. Wheels bundle the `native` feature (circom-2 compiler crates + wasmi +
6
+ # the boa JS engine for the legacy circom-1 path) plus the vendored circomlibs/sources — all pure
7
+ # Rust, no protoc, clang, wasmer, or Node — so everything just cross-compiles.
8
+ on:
9
+ push:
10
+ tags: ["v*"]
11
+ workflow_dispatch:
12
+ inputs:
13
+ publish:
14
+ description: "Publish built artifacts to PyPI (needs trusted publishing configured)"
15
+ type: boolean
16
+ default: false
17
+
18
+ jobs:
19
+ linux:
20
+ name: wheels linux (${{ matrix.target }})
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ target: [x86_64, aarch64]
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: actions/setup-python@v5
29
+ with:
30
+ python-version: "3.12"
31
+ - uses: PyO3/maturin-action@v1
32
+ with:
33
+ target: ${{ matrix.target }}
34
+ args: --release --out dist
35
+ manylinux: auto
36
+ - uses: actions/upload-artifact@v4
37
+ with:
38
+ name: wheels-linux-${{ matrix.target }}
39
+ path: dist
40
+
41
+ macos:
42
+ name: wheels macos (universal2)
43
+ # macos-latest is arm64 (the macos-13 x86_64 runner is deprecated); build one universal2
44
+ # wheel that covers both Apple Silicon and Intel — no per-arch runner split needed.
45
+ runs-on: macos-latest
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.12"
51
+ - uses: PyO3/maturin-action@v1
52
+ with:
53
+ target: universal2-apple-darwin
54
+ args: --release --out dist
55
+ - uses: actions/upload-artifact@v4
56
+ with:
57
+ name: wheels-macos-universal2
58
+ path: dist
59
+
60
+ windows:
61
+ name: wheels windows (x64)
62
+ runs-on: windows-latest
63
+ steps:
64
+ - uses: actions/checkout@v4
65
+ - uses: actions/setup-python@v5
66
+ with:
67
+ python-version: "3.12"
68
+ - uses: PyO3/maturin-action@v1
69
+ with:
70
+ target: x64
71
+ args: --release --out dist
72
+ - uses: actions/upload-artifact@v4
73
+ with:
74
+ name: wheels-windows-x64
75
+ path: dist
76
+
77
+ sdist:
78
+ name: sdist
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ - uses: PyO3/maturin-action@v1
83
+ with:
84
+ command: sdist
85
+ args: --out dist
86
+ - uses: actions/upload-artifact@v4
87
+ with:
88
+ name: sdist
89
+ path: dist
90
+
91
+ publish:
92
+ name: publish to PyPI
93
+ needs: [linux, macos, windows, sdist]
94
+ # Publish on a v* tag push, or on a manual run with the publish input checked. The `pypi`
95
+ # environment is additionally gated to v* tags in the repo settings (defense in depth).
96
+ if: ${{ startsWith(github.ref, 'refs/tags/v') || inputs.publish }}
97
+ runs-on: ubuntu-latest
98
+ # Trusted publishing (OIDC) — configure the publisher on PyPI; no token needed.
99
+ environment: pypi
100
+ permissions:
101
+ id-token: write
102
+ steps:
103
+ - uses: actions/download-artifact@v4
104
+ with:
105
+ path: dist
106
+ merge-multiple: true
107
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ # Rust
2
+ /target
3
+ Cargo.lock
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ .venv/
9
+ venv/
10
+ *.egg-info/
11
+ build/
12
+ dist/
13
+ wheels/
14
+ .pytest_cache/
15
+ .mypy_cache/
16
+ .ruff_cache/
17
+
18
+ # maturin
19
+ *.so
20
+ *.pyd
21
+ *.dylib
22
+
23
+ # Generated docs (cargo doc -> target/doc already covered; pdoc output)
24
+ /docs/
25
+
26
+ # OS / editor
27
+ .DS_Store
28
+ .idea/
29
+ .vscode/