Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 2.11 KB

DEVELOPMENT.md

File metadata and controls

75 lines (54 loc) · 2.11 KB

README for Developers of OMMX

Code map

  • proto/
    • *.proto files defining OMMX Messages
    • Managed by buf, see its configuration in buf.yaml
  • python/ommx/
    • OMMX Python SDK
    • Managed by pip, see its configuration in pyproject.toml
  • rust/ommx/
    • OMMX Rust SDK
    • Managed by cargo, see its configuration in the workspace Cargo.toml
  • rust/protogen/
    • Rust code generator from *.proto. Used by cargo run --bin protogen. This is used only for development, and not published to crates.io.

OMMX Python SDK

PyPI - Version

Setup development environment

OMMX Python SDK is Rust/Python mixed project. You need to install Rust and Python development tools.

Install Rust

See the official guide for details.

virtualenv for Python

python -m venv .venv
source .venv/bin/activate
pip install "python/ommx[dev]"

TODO: Another Python development tools like poetry or rye

Generate Python codes from *.proto

cd proto
buf generate --template buf.gen.python.yaml
ruff format ../python

Generate API reference

sphinx-build -b html ./python/ommx/docs/source ./python/ommx/docs/build

Release to PyPI

[!IMPORTANT] The version of ommx and the adapters should be in sync.

  1. Update version in python/ommx/pyproject.toml
  2. Update version in python/ommx-python-mip-adapter/project.toml
  3. Push Git tag with python-x.y.z, then the GitHub Actions will release to PyPI

OMMX Rust SDK

Crates.io Version

Generate Rust codes from *.proto

cargo run --bin protogen

Release to crates.io

  1. Push a new Git tag named rust-x.y.z, then the GitHub Actions will release to crates.io
  2. Create a GitHub release.