From e6a9ce7fe531542d76e2de7f5afd33c84edeb630 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 28 Oct 2024 18:05:59 +0800 Subject: [PATCH] flake: Add PyThermostat to PYTHONPATH in devshell For easier testing of PyThermostat code in the development shell, so that the following is possible right in the repo root: ``` $ python -m pythermostat.plot Channel 0 target temperature: 25.000 $ python Python 3.11.9 (main, Apr 2 2024, 08:25:04) [GCC 13.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pythermostat.client import Client >>> c = Client() >>> c >>> ``` --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index eafafa2..8c81be8 100644 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,9 @@ numpy matplotlib ]); + shellHook = '' + export PYTHONPATH=`git rev-parse --show-toplevel`/pythermostat:$PYTHONPATH + ''; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;