To install from source, you must first have a working Rust environment (see
rustup). The project may then be installed from the project
root directory using either pip
:
python -m venv venv # Or use your preferred virtual environment method...
source venv/bin/activate
pip install .[lint]
Or using cargo
:
cargo install --path fortitude
Unit tests can be run by calling:
cargo test
Integration testing is currently being performed manually using the file test.f90
:
fortitude check test.f90
The test suite is still in need of work, and we hope to include automated integration tests soon.
When contributing, please use cargo clippy
for linting and cargo fmt
for formatting.
If you edit any Python code, please also use ruff check
and ruff format
. To avoid
accidentally pushing unlinted/unformatted code to GitHub, we recommend using the Git
pre-commit hook provided:
git config --local core.hooksPath .githooks
Similarly to how Ruff names rules, the rules in
Fortitude should be categorised appropriately and their name should describe the pattern
the rule is intended to fix. Words such as 'forbid' should be omitted. For example, the
name for the rule that warns of overly long lines is LineTooLong
, and not something
like AvoidLineTooLong
or KeepLinesShort
.
To make a new release, the following steps must be completed in order:
- Make a new commit that updates the project version in
pyproject.toml
,Cargo.toml
, andCITATION.cff
.- Remember to run
cargo build
to update theCargo.lock
file too!
- Remember to run
- Open a new PR to merge this change.
- After merging, make a new release on GitHub.
- This will automatically upload the new version to PyPI.
- On your machine, pull the main branch, and run
cargo publish
.- This will upload the Rust crate to
crates.io
.
- This will upload the Rust crate to