Installation¶
Install Commol from PyPI, or build it from source to work on it.
Quick path¶
The figures need matplotlib, the optional extra commol[plot]:
| Requirement | Version |
|---|---|
| Python | 3.12 or later |
| Platforms with ready-made wheels | Linux and macOS (x86_64 and arm64), Windows (x86_64) |
On other platforms, pip builds Commol from the source distribution, which
needs a Rust toolchain.
Check the installation¶
commol.__version__ is the version you installed. commol.build_info() gives
it with the full commit of the source; save it with a result to name the code
that made it.
| Installed from | __version__ |
build_info().commit |
|---|---|---|
| A wheel of a release on PyPI | The release, such as 0.9.0 |
The commit of the release |
| The source distribution of a release | The release | None: the source has no git metadata |
A git commit, or a clone (maturin develop) |
0.1.0+g<first 7 characters of the commit> |
The full commit |
A build that is not a release has the placeholder version 0.1.0 of the
source, so its local version (+g…) is what names its commit. The metadata of
the package (pip show commol) gives the placeholder alone.
Build from source¶
To work on Commol, or to use unreleased code from main:
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh. - Install uv, at the version of
required-versioninpy-commol/pyproject.toml; another version of uv refuses to run in the project. A standalone uv moves to it withuv self update <version>. - Clone, install the dependencies, and build the extension:
git clone https://github.com/MUNQU/commol.git
cd commol/py-commol
uv sync --extra dev --extra docs
source .venv/bin/activate # On Windows: .venv\Scripts\activate
maturin develop --release --features test-kind
pytest
| Step | Why |
|---|---|
uv sync --extra dev --extra docs |
Creates .venv with the test, lint and documentation tools. It does not build Commol (package = false in pyproject.toml), and a later uv sync removes the install of Commol. |
source .venv/bin/activate |
maturin develop installs into the active environment. |
maturin develop --release --features test-kind |
Compiles the Rust extension and installs Commol in editable mode. The test-kind feature adds the model kind that the tests need; a release never has it. Run it again after every Rust change and every uv sync. |
Paths with spaces
Maturin may fail when the project path contains spaces. Clone into a path without them.
See Development Workflow for branches, checks and pull requests.
Next steps¶
| To learn | Read |
|---|---|
| Your first model | Quick Start |
| The concepts | Core Concepts |