Skip to content

Latest commit

 

History

History
80 lines (53 loc) · 1.7 KB

CONTRIBUTING.md

File metadata and controls

80 lines (53 loc) · 1.7 KB

Development

Pre-requisites: install rye

# clone the repo
git clone https://github.com/a16z/jsi
cd jsi

# install dependencies
rye sync

# runs the formatter, linter, type checker and tests
rye run all

# run the tool
rye run jsi --help

# run it without rye
python -m jsi --help

# run a single test
rye run pytest -v -k <test_name>

You can install the development version of jsi using uv:

uv tool install --reinstall /path/to/jsi

Or to install it in editable mode in the current venv:

uv pip install -e /path/to/jsi

Redirect log output

# jsi will print its own output to stderr, so you can redirect it to a file
# (stdout is reserved for the best solver's output)
jsi 2> jsi.logs

Profiling imports

# this will print import times to stderr
python -Ximporttime -m jsi ... 2> stderr.log

# this parses the log and displays a nice visual summary
uvx tuna stderr.log

Benchmarking

I recommend using hyperfine to benchmark jsi.

# this only runs the "always-sat" virtual solver to evaluate jsi's overhead
hyperfine --warmup 3 --shell=none 'python -m jsi examples/easy-sat.smt2 --sequence always-sat'

Screenshot of hyperfine benchmark

Releasing

We use a GitHub Actions workflow to build and publish releases to PyPI when a new tag is pushed to the repo.

To release a new version, push a new tag to the repo:

git tag v1.0.0
git push origin v1.0.0

This will trigger the release workflow, which builds the project and publishes it to PyPI.