Pull requests and bug reports are welcome. For major changes, please open an issue to discuss what you would like to change.
As of writing this document, the project is still in a pre-1.0 state. This means that the API is not yet stable and breaking changes may occur frequently.
The following tools are mandatory.
rust
for working on the project at all.- Note that
curl
is required to installrust
on*NIX
systems.
- Note that
git
for version control.pre-commit
for running pre-commit hooks.- You will need this to run the pre-commit hooks, which will run various checks on your code when you commit to
git
. - The
pre-commit
hooks will try to automatically fix any issues they can, but some issues will require manual intervention. - If your code does not pass these checks, your PR will not even be reviewed or considered for merging until you fix the issues.
pre-commit
is available viapip
(python -m pip install pre-commit
),brew
(brew install pre-commit
) on macOS, or viasnap
for Linux users.
- You will need this to run the pre-commit hooks, which will run various checks on your code when you commit to
wsl2
is required to work on this project on Windows.- You will need to enable
systemd
for docker to run- Start your Ubuntu (or other Systemd) distribution under WSL
- Run the command
sudo -e /etc/wsl.conf
- Add the following to the file:
[boot] systemd=true
- In powershell, restart WSL by running the commands
wsl --shutdown
andwsl
. - In your WSL terminal, run the command
sudo systemctl start docker
to start the docker daemon. - You can have docker start automatically with WSL by running the command
sudo systemctl enable docker
. - If you run into any issues, see
here
for help.
- You will need to enable
If you are working on the Python bindings we highly recommend that you use docker
and hermit
as described in the following section.
Using hermit
to manage your python environment will be a lot easier than trying to manage it yourself.
If you know what you are doing, you can also install the following tools manually.
python
version 3.9.venv
for managing python virtual environments.python -m venv .venv
will create a virtual environment in the.venv
directory.source .venv/bin/activate
will activate the virtual environment.deactivate
will deactivate the virtual environment.
pip
for installing python dependencies.python -m pip install --upgrade pip
will upgradepip
to the latest version.
maturin
for therust
-python
bindings:cargo install maturin --locked
- Compile and install the python wrappers to work on them. For example, with the
abd-distances
package:cd crates/abd-distances
maturin develop --release --extras=dev
python -m pytest -v
The following tools are optional, but recommended.
docker
- For Windows and Mac users, you will should install Docker Desktop. This will install both the docker daemon and the docker CLI.
- For Linux users, you do not need to install Docker Desktop. You can install the CLI and daemon separately if you wish.
- You will need
docker
to test the CI/CD pipelines locally or to use Earthly to run various project commands. - You may need to start the docker daemon before running any commands. You can do this with
sudo systemctl start docker
.- Running
sudo systemctl enable docker
once will make it so that the docker daemon will start automatically when you boot your machine.
- Running
- You may need to add your user to the
docker
group to run docker commands withoutsudo
.- You can do this with
sudo usermod -aG docker $USER
. - You need to re-login or reboot after doing this.
- You can do this with
hermit
- Use the
curl
command in the hermit link above to install it - You may need to add
$HOME/bin
to your$PATH
if it's not already there.- For bash:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
- For zsh:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
- For fish:
echo 'set PATH "$HOME/bin" $PATH' >> ~/.config/fish/config.fish
- For bash:
- This tool provides binaries you may want to have at hand to work on this repo.
- You can see the full list of tools in the
./bin
directory in the repo root. - Do one of the following:
- Install each tool manually (do this if you do not want to use hermit).
- Execute the tools you want directly with
./bin/<tool>
(do this if you want to use some tools from hermit). - (Recommended) Install shell hooks (see here for more information) (do this if you want to use all tools from hermit). Installing shell-hooks will eliminate the need to reactivate your hermit environment every time you open this repository.
- Use the
Here are some of the tools we include by default with hermit that you may want to install on your own if you want all of the functionality of this repo.
earthly
- This is the build tool used by the project.
- You can use it to run various commands, such as
cargo test
orcargo fmt
. - You can also use it to build the project, run the project, or build the documentation.
- Example commands:
earthly +test
earthly +fmt
- You can see all of the current targets available with
earthly ls
make
- This is a build tool that is used by the individual crates under the
crates/
directory. - Earthly does not support wildcard imports, so we use
make
to access earthlfile targets dynamically. - You can use it to run various commands, such as
make test
ormake publish
. - Example commands:
make test
make publish
- All available make targets can be seen in the root makefile under
crates/Makefile
. Additionally, crates may override these targets or define new ones, so be sure to check the individual crate makefile before calling targets.
- This is a build tool that is used by the individual crates under the
python
- Some of our crates will offer python bindings, so we include python in hermit.
- You can use it to run various commands, such as
python -m pytest
orpython -m pip install -r requirements.txt
. - Example commands:
python -m pytest
python -m pip install -r requirements.txt
- Fork the repository to your own GitHub account. You should make changes in your own fork and contribute back to the base repository (under URI-ABD) via pull requests.
- Clone the repo from your fork.
git clone ...
- Test that things work.
cargo test --release
earthly +test
- Install pre-commit hooks
pre-commit install
pre-commit run --all-files
- Make a new branch.
- Make sure to branch from the head of the
master
branch. - Have a plan and scope in mind for your changes.
- You may not have merge commits in your branch because we wish to keep a linear history on the
master
branch. Usegit rebase
to keep your branch up-to-date with themaster
branch.
- Make sure to branch from the head of the
- Make your changes.
- Remember to add tests and documentation.
- Commit and push your changes.
- Open a pull request.
- Bump the version.
- We use
bump2version
to manage versioning and to keep the version numbers in sync. - You should ask someone to review your changes before bumping the version. You should also ask which
part
to bump.
- We use