diff --git a/.envrc.example b/.envrc.example new file mode 100644 index 0000000..5307aee --- /dev/null +++ b/.envrc.example @@ -0,0 +1,2 @@ +use flake +export DIRENV_ACTIVE=1 # force direnv to always activate by adding a dummy environment variable diff --git a/docs/setup.md b/docs/setup.md new file mode 100644 index 0000000..61ec612 --- /dev/null +++ b/docs/setup.md @@ -0,0 +1,28 @@ +# Project Setup + +1. Copy `.envrc.example` to `.envrc`. +2. Install [nix](https://nixos.org/download/). +3. Install [direnv](https://direnv.net/) and [nix-direnv](https://github.com/nix-community/nix-direnv). +4. Run `direnv allow` at project root. This is to automatically load the environment when you `cd` into the project directory in the terminal in the future. +5. Run `which python` to verify that the Python interpreter is from the nix environment. + + ```shell + $ which python + /nix/store/9l232zbyi3nisqn9s3li4imyv37753vc-python3-3.11.9-env/bin/python + ``` + + Path should look similar to the above from `/nix/store`. This confirms that you are using the correct Python interpreter. + +6. Run `python -mpytest` to execute all tests. + +If you are able to run all tests, you are ready to go! + +## VS Code + +1. For intellisense in VS Code, add result of `which python` to your `.vscode/settings.json`: + + ```json + { + "python.defaultInterpreterPath": "output of `which python`" + } + ```