From bfbe8b79a78c89d6ec90cfcbc26738f1b9085d02 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 28 Oct 2024 17:52:00 +0800 Subject: [PATCH] PyThermostat GUI: Set up packaging Co-authored-by: Egor Savkin --- flake.nix | 20 ++++++++++++++++++-- pythermostat/MANIFEST.in | 4 ++++ pythermostat/setup.py | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 pythermostat/MANIFEST.in diff --git a/flake.nix b/flake.nix index ad5bb8a..c371957 100644 --- a/flake.nix +++ b/flake.nix @@ -63,11 +63,22 @@ version = "0.0.0"; src = "${self}/pythermostat"; + nativeBuildInputs = [ pkgs.qt6.wrapQtAppsHook ]; propagatedBuildInputs = - with pkgs.python3Packages; [ + [ pkgs.qt6.qtbase ] + ++ (with pkgs.python3Packages; [ numpy matplotlib - ]; + pyqtgraph + pyqt6 + qasync + pglive + ]); + + dontWrapQtApps = true; + postFixup = '' + wrapQtApp "$out/bin/tec_qt" + ''; }; pglive = pkgs.python3Packages.buildPythonPackage rec { @@ -91,6 +102,11 @@ default = thermostat; }; + apps.x86_64-linux.thermostat_gui = { + type = "app"; + program = "${self.packages.x86_64-linux.pythermostat}/bin/tec_qt"; + }; + hydraJobs = { inherit thermostat; }; diff --git a/pythermostat/MANIFEST.in b/pythermostat/MANIFEST.in new file mode 100644 index 0000000..26af249 --- /dev/null +++ b/pythermostat/MANIFEST.in @@ -0,0 +1,4 @@ +graft examples +include pythermostat/gui/resources/artiq.ico +include pythermostat/gui/view/param_tree.json +include pythermostat/gui/view/tec_qt.ui diff --git a/pythermostat/setup.py b/pythermostat/setup.py index 7e34ea1..0d4c164 100644 --- a/pythermostat/setup.py +++ b/pythermostat/setup.py @@ -12,6 +12,7 @@ setup( entry_points={ "gui_scripts": [ "thermostat_plot = pythermostat.plot:main", + "thermostat_qt = pythermostat.thermostat_qt:main", ], "console_scripts": [ "thermostat_autotune = pythermostat.autotune:main",