diff options
Diffstat (limited to 'pkgs/development/python-modules/p1monitor/default.nix')
-rw-r--r-- | pkgs/development/python-modules/p1monitor/default.nix | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/p1monitor/default.nix b/pkgs/development/python-modules/p1monitor/default.nix index d1530c7971984..7a8bc9fd050ba 100644 --- a/pkgs/development/python-modules/p1monitor/default.nix +++ b/pkgs/development/python-modules/p1monitor/default.nix @@ -1,8 +1,11 @@ { lib , aiohttp +, aresponses , buildPythonPackage , fetchFromGitHub , poetry-core +, pytest-asyncio +, pytestCheckHook , pythonOlder , yarl }: @@ -12,13 +15,13 @@ buildPythonPackage rec { version = "1.1.0"; format = "pyproject"; - disabled = pythonOlder "3.8"; + disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "klaasnicolaas"; repo = "python-p1monitor"; rev = "v${version}"; - sha256 = "1ciaclgq4aknldjqlqa08jcab28sbqrjxy5nqqwlnb2wlprg5ijz"; + hash = "sha256-X8by8qVcLEs5xrb4LjNeGomlmERAYYplo3Yqgh9lKrI="; }; nativeBuildInputs = [ @@ -30,13 +33,24 @@ buildPythonPackage rec { yarl ]; - # Project has no tests - doCheck = false; + checkInputs = [ + aresponses + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace '"0.0.0"' '"${version}"' \ + --replace 'addopts = "--cov"' "" + ''; - pythonImportsCheck = [ "p1monitor" ]; + pythonImportsCheck = [ + "p1monitor" + ]; meta = with lib; { - description = "Python client for the P1 Monitor"; + description = "Module for interacting with the P1 Monitor"; homepage = "https://github.com/klaasnicolaas/python-p1monitor"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; |