Contributing

If you would like to contribute to the project, there’s a few things you should know, to assist your development efforts and make the pull request workflow easier on everyone

Running locally

To test your changes locally, we recommend pip installing the local changes - this ensures the build process is also working fine. While in the top level directory, you can run

pip install -e  ./

or

python setup.py develop

To install the project. This creates a .pth link from your python installation to your ev3sim directory. This means any changes made will immediately take effect. Note that this will remove your existing install of stable ev3sim (if installed via pip), so be aware of this.

Linting code

Pull requests are linted with black. To run black locally to fix any formatting errors you’ve made, run the following:

black --config pyproject.toml .

Building with Nix

The Nix package manager can be used to create reproducible builds on Linux and Mac.

Setup

First install Nix with experimental Flakes support.

curl -L https://nixos.org/nix/install | sh
. /home/$USER/.nix-profile/etc/profile.d/nix.sh

nix-env -iA nixpkgs.nixUnstable
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

Then set up the binary cache for faster builds.

nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use melbournehighschoolrobotics

Release

To build installers for Windows:

nix build ".#windows"

To build for Linux:

nix build ".#linux"