Skip to main content

PyO3 extension: native local scorer for sparkrules Tier-1

Project description

sparkrules-native (Rust Tier-1 scorer)

PyO3 extension implementing the Tier-1 scalar interpreter described in docs/CHOOSING_A_BACKEND.md. It reads rule AST JSON emitted by SparkRules Python (RulePack.to_native_json()) — the DRL lexer/parser stays on the Python side.

Build (local)

cd sparkrules_native
python -m venv .venv
.venv\\Scripts\\activate   # Windows
pip install maturin
maturin develop --release
python -c "import sparkrules_native as m; print(m.native_version())"

Parity

All scores must match LocalRuleExecutor.score() for the same fact dict / JSON-able structure. Run:

pytest tests/integration/test_native_parity.py -q

Consumers (no PyPI yet)

Until https://pypi.org/project/sparkrules-native/ resolves, use:

  • native-wheels.yml artifacts (.whl per OS/Python), or
  • maturin develop --release / maturin build --release locally.

See docs/NATIVE_TIER1.md (PyPI verification commands, Glue --extra-py-files, artifact names).

Publish to PyPI (maintainers)

The crate is CI-built (.github/workflows/native-wheels.yml) but not automatically published. publish-sparkrules-native.yml has no effect until the secret exists and the workflow run finishes green; then confirm the project on PyPI.

  1. Create a PYPI_API_TOKEN PyPI token secret on the GitHub repo (maturin reads MATURIN_PYPI_TOKEN; the workflow wires secrets.PYPI_API_TOKEN into it).
  2. Run publish-sparkrules-native.yml via Actions → workflow_dispatch.
  3. Restore sparkrules[native] in root pyproject.toml (native = ["sparkrules-native>=0.1.0,<1.0"]) once pip install sparkrules-native works from PyPI.

Tier 2+

src/eval_columnar.rs is reserved for an Arrow batch path; not implemented in Tier-1.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparkrules_native-0.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparkrules_native-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl (951.5 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

File details

Details for the file sparkrules_native-0.1.0.tar.gz.

File metadata

  • Download URL: sparkrules_native-0.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sparkrules_native-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65d9778924c1a38ee6b3aa8a179ad89246d3ac183b5491464ae59712d5e41b53
MD5 6c70032279e28d082bc6795c02b3bfae
BLAKE2b-256 3e3dd280b97d1dfe6958450b0ce97733129764ef9f0bbee7e7a0d4a97d8cd322

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkrules_native-0.1.0.tar.gz:

Publisher: publish-sparkrules-native.yml on vaquarkhan/sparkrules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sparkrules_native-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for sparkrules_native-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 976bbc193925268557447dbd1fca0952e36e9daac2c5bdfe343d9d0098ca73cf
MD5 b3b4f27f6b527d1110f8de44c1d4d94f
BLAKE2b-256 caf0687eb1e9f003661213ebdf861e624f69d9af12da360934a418ebef6574f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkrules_native-0.1.0-cp311-abi3-manylinux_2_34_x86_64.whl:

Publisher: publish-sparkrules-native.yml on vaquarkhan/sparkrules

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page