Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- run: pip install mkdocs-material
- run: |
cd py-forust
uv sync --group dev --group docs
Expand Down
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@ The test script can also be run from powershell.

This script, builds the package in release mode, installs it, and then runs the test. Because of this, it is useful to run this whenever you want to test out a change in the python package.

## Preparing a Release

This repository has two Cargo packages and one Python package. The Python package gets its version dynamically from `py-forust/Cargo.toml`, so keep the versions synchronized:

- Set the Rust library version in the root `Cargo.toml`.
- Set the binding package version in `py-forust/Cargo.toml`.
- Set the `forust-ml` path dependency in `py-forust/Cargo.toml` to the same version.
- Leave `project.dynamic = ["version"]` in `py-forust/pyproject.toml`; maturin reads the version from Cargo.

Cargo and Python use different prerelease spellings. In Cargo manifests, use SemVer syntax such as `X.Y.Z-rc.N`. Maturin converts that to the PEP 440 Python version `X.Y.ZrcN` and produces wheel names such as `forust-X.Y.ZrcN-...whl`. Do not use `X.Y.ZrcN` directly in a Cargo manifest; Cargo rejects it.

Before tagging, validate the metadata and build a wheel:

```sh
cargo metadata --manifest-path py-forust/Cargo.toml --format-version 1
cargo check --manifest-path py-forust/Cargo.toml
maturin build --release --manifest-path py-forust/Cargo.toml --out dist
```

Create an annotated tag after committing and pushing the version changes:

```sh
git tag -a vX.Y.Z-rc.N -m "Release X.Y.ZrcN"
git push origin vX.Y.Z-rc.N
```

The CI workflow runs when a tag is pushed. It publishes the Rust crate and, after the platform builds pass, publishes the Python wheels and source distribution to PyPI. Published versions cannot be reused. If a tagged workflow fails after the Rust publish step, increment the candidate number (`rc.2`, `rc.3`, and so on) before trying again, even if the Python artifacts were never published.

## Benchmarking
Benchmarking is run using the [`criterion`](https://github.com/bheisler/criterion.rs) Rust crate.
To run the benchmarks, you can run the following command from your terminal.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "forust-ml"
version = "0.7.0"
version = "0.8.0"
edition = "2021"
authors = ["James Inlow <james.d.inlow@gmail.com>"]
homepage = "https://github.com/jinlow/forust"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pip install forust

To use in a rust project add the following to your Cargo.toml file.
```toml
forust-ml = "0.7.0"
forust-ml = "0.8.0"
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions py-forust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-forust"
version = "0.7.0"
version = "0.8.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -10,7 +10,7 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.28", features = ["extension-module"] }
forust-ml = { version = "0.7.0", path = "../" }
forust-ml = { version = "0.8.0", path = "../" }
numpy = "0.28"
ndarray = "0.17"
serde_plain = { version = "1.0" }
Expand Down
2 changes: 1 addition & 1 deletion py-forust/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ build-backend = "maturin"

[dependency-groups]
dev = ["maturin", "pytest", "seaborn", "xgboost<2.0", "scikit-learn", "ruff==0.6.9"]
docs = ["mkdocs-material==9.*", "mkdocstrings==0.29.1", "mkdocstrings-python==1.16.10", "mkdocs-autorefs==1.4.1", "mkdocs<2.0.0"]
docs = ["mkdocs-material==9.*", "mkdocstrings", "mkdocstrings-python", "mkdocs-autorefs", "mkdocs"]

[tool.maturin]
sdist-include = ["LICENSE", "README.md"]
Expand Down
2 changes: 1 addition & 1 deletion rs-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To run this example, add the following code to your `Cargo.toml` file.
```toml
[dependencies]
forust-ml = "0.7.0"
forust-ml = "0.8.0"
polars = "0.28"
reqwest = { version = "0.11", features = ["blocking"] }
```
Expand Down
Loading