From 417eb08cd3f3abebbca2bb74f031c2bd979bc304 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 28 Oct 2024 18:05:59 +0800 Subject: [PATCH 1/2] 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 c846d21..f342daf 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,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; -- 2.47.1 From f21f9257a7601c6d89dfcb58738a14ddafda8bfa Mon Sep 17 00:00:00 2001 From: atse Date: Fri, 23 Aug 2024 11:30:16 +0800 Subject: [PATCH 2/2] flake: Add PyThermostat to devShell Make Python scripts in PyThermostat available in the development shell (thermostat_plot, thermostat_autotune, and thermostat_test). --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index f342daf..ebc2072 100644 --- a/flake.nix +++ b/flake.nix @@ -94,6 +94,7 @@ ++ (with python3Packages; [ numpy matplotlib + pythermostat ]); shellHook = '' export PYTHONPATH=`git rev-parse --show-toplevel`/pythermostat:$PYTHONPATH -- 2.47.1