Development
Repository structure
| Path | Contents |
|---|---|
src/lib.rs | The DataFrame structure and the Turtle conversion. |
src/rules.rs | The nemo rule runner. |
src/python.rs | The Python bindings (pyrumo). |
src/main.rs | The command-line tool. |
tests/ | The Rust tests and the Python tests. |
examples/ | Example data, rules and Python scripts. |
docs/ | This manual. |
Run the Rust tests
cargo test
cargo test --features rules
Build and test the Python package
-
Make a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install maturin:
pip install maturin -
Build and install the package:
maturin develop --extras test -
Run the tests:
pytest
Build this manual
The manual uses mdBook.
-
Install mdBook:
cargo install mdbook -
Build the manual:
mdbook build docsThe HTML files are in
docs/book. -
To see the manual while you edit it, run:
mdbook serve docs --open
Publish this manual
The Docs workflow (.github/workflows/docs.yml) publishes the manual to GitHub Pages.
Before the first publication, do this procedure one time:
- On GitHub, open the repository settings.
- Select Pages.
- In Build and deployment, set Source to GitHub Actions.
The workflow starts in these conditions:
| Event | Result |
|---|---|
A push to master or main that changes docs/ | The workflow builds and publishes the manual. |
A pull request that changes docs/ | The workflow builds the manual. It does not publish it. |
| A manual start from the Actions tab | The workflow builds and publishes the manual. |
The manual is then at https://<owner>.github.io/<repository>/.
Writing style
Write the documentation in Simplified Technical English (ASD-STE100):
- Use short sentences. Write a maximum of 20 words in a procedure and 25 words in a description.
- Write one instruction in each sentence.
- Use the active voice.
- Use the imperative form in procedures.
- Use the same word for the same thing.
Make a release
- Change
versioninCargo.toml. This is also the version of the Python package. - Run
cargo checkto updateCargo.lock. - Commit and push these changes.
- Publish a GitHub release. The tag must be the version with a
vbefore it, for examplev0.2.0.
The Binaries workflow attaches the command-line archives to the release.
The Python workflow publishes the pyrumo wheels to PyPI.
Each workflow first compares the tag with the version in Cargo.toml.
If they are different, the workflow stops before it builds.
If the check fails, do these steps:
- Delete the GitHub release.
- Delete the tag:
git push --delete origin v0.2.0. - Change the version in
Cargo.toml, then commit and push. - Publish the release again.