From 5666a978d7d289f15a92759f754c2ab6be3d92aa Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 7 Feb 2023 09:07:55 -0700 Subject: [PATCH] pkgs/promnesia: enable tests --- flake.nix | 2 +- gui/default.nix | 4 +++- pkgs/promnesia.nix | 29 +++++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 3b14620..61a384b 100644 --- a/flake.nix +++ b/flake.nix @@ -266,7 +266,7 @@ inherit (pkgs.python39Packages) appdirs tzlocal more-itertools pytz sqlalchemy urlextract fastapi uvicorn websockets uvloop httptools watchfiles decorator click - beautifulsoup4; + beautifulsoup4 mypy pandas orjson pytest; inherit (pkgs.python39Packages) lxml mistletoe logzero; }; tailscaleSystray = diff --git a/gui/default.nix b/gui/default.nix index 9fc31d6..f931c89 100644 --- a/gui/default.nix +++ b/gui/default.nix @@ -13,7 +13,8 @@ let inherit (pkgs.python39Packages) pdm-pep517 setuptools setuptools-scm; inherit (pkgs.python39Packages) appdirs tzlocal more-itertools pytz sqlalchemy urlextract fastapi uvicorn - websockets uvloop httptools watchfiles decorator beautifulsoup4; + websockets uvloop httptools watchfiles decorator beautifulsoup4 mypy + pandas orjson pytest; inherit (pkgs.python39Packages) lxml mistletoe logzero; }; promnesiaService = { @@ -95,6 +96,7 @@ in with lib; { rpr (callPackage ../pkgs/tailscale-systray.nix { }) promnesia + black ]; programs = { diff --git a/pkgs/promnesia.nix b/pkgs/promnesia.nix index 39ca4e1..d9ff01b 100644 --- a/pkgs/promnesia.nix +++ b/pkgs/promnesia.nix @@ -1,7 +1,8 @@ { lib, buildPythonPackage, fetchPypi, pdm-pep517, setuptools, setuptools-scm , appdirs, tzlocal, more-itertools, pytz, sqlalchemy, urlextract, fastapi , websockets, uvloop, httptools, watchfiles, uvicorn, lxml, mistletoe, logzero -, decorator, click, beautifulsoup4, sqlcipher, ... }: +, decorator, click, beautifulsoup4, sqlcipher, mypy, pandas, orjson, pytest, ... +}: let sqlcipher3 = buildPythonPackage rec { pname = "sqlcipher3"; @@ -10,7 +11,7 @@ let nativeBuildInputs = [ setuptools-scm ]; propagatedBuildInputs = [ sqlcipher ]; - doCheck = false; + doCheck = true; src = fetchPypi { inherit pname version; @@ -24,7 +25,9 @@ let nativeBuildInputs = [ setuptools-scm ]; #propagatedBuildInputs = [ ]; - doCheck = false; + nativeCheckInputs = [ pytest ]; + + doCheck = true; src = fetchPypi { inherit pname version; @@ -36,7 +39,20 @@ let version = "0.0.20200417"; nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ pytz appdirs more-itertools decorator click ]; + propagatedBuildInputs = [ + pytz + appdirs + more-itertools + decorator + click + mypy + pandas + logzero + orjson + lxml + ]; + + doCheck = true; src = fetchPypi { inherit pname version; @@ -49,6 +65,8 @@ let nativeBuildInputs = [ setuptools-scm ]; + doCheck = true; + propagatedBuildInputs = [ appdirs sqlalchemy ]; src = fetchPypi { @@ -65,6 +83,8 @@ in buildPythonPackage rec { sha256 = "sha256-T6sayrPkz8I0u11ZvFbkDdOyVodbaTVkRzLib5lMX+Q="; }; + doCheck = true; + nativeBuildInputs = [ pdm-pep517 setuptools-scm ]; # Optional @@ -79,6 +99,7 @@ in buildPythonPackage rec { lxml mistletoe more-itertools + mypy orgparse pytz setuptools