diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2024-03-20 23:55:12 +0100 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2024-03-21 21:46:26 +0100 |
commit | e9ee6bc61d38bab50e01c42af0b262bced7b308d (patch) | |
tree | 340f88844398813872e44cf71abb18c525155acb /pkgs/applications/networking/instant-messengers | |
parent | 1ef89220b27e8f120f7c58998614bff10e19fdf5 (diff) |
pantalaimon: refactor
- use default callPackage and consume python3Packages
- use pep517 builder
- relax matrix-nio constraint
- add missing cachetools dependency
- expose optional-dependencies
- use pytestCheckHook
Diffstat (limited to 'pkgs/applications/networking/instant-messengers')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/pantalaimon/default.nix | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix index dbe944d189b6..5b5669a3a6a2 100644 --- a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix +++ b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix @@ -1,31 +1,41 @@ -{ lib, stdenv, buildPythonApplication, fetchFromGitHub, pythonOlder, - attrs, aiohttp, appdirs, click, keyring, logbook, peewee, janus, - prompt-toolkit, matrix-nio, dbus-python, pydbus, notify2, pygobject3, - setuptools, installShellFiles, nixosTests, - - pytest, faker, pytest-aiohttp, aioresponses, - - enableDbusUi ? true +{ lib +, stdenv +, python3Packages +, fetchFromGitHub +, installShellFiles +, nixosTests +, enableDbusUi ? true }: -buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "pantalaimon"; version = "0.10.5"; - - disabled = pythonOlder "3.6"; + pyproject = true; # pypi tarball miss tests src = fetchFromGitHub { owner = "matrix-org"; - repo = pname; + repo = "pantalaimon"; rev = version; - sha256 = "sha256-yMhE3wKRbFHoL0vdFR8gMkNU7Su4FHbAwKQYADaaWpk="; + hash = "sha256-yMhE3wKRbFHoL0vdFR8gMkNU7Su4FHbAwKQYADaaWpk="; }; - propagatedBuildInputs = [ + build-system = [ + installShellFiles + ] ++ (with python3Packages; [ + setuptools + pythonRelaxDepsHook + ]); + + pythonRelaxDeps = [ + "matrix-nio" + ]; + + dependencies = with python3Packages; [ aiohttp appdirs attrs + cachetools click janus keyring @@ -33,34 +43,28 @@ buildPythonApplication rec { matrix-nio peewee prompt-toolkit - setuptools ] ++ matrix-nio.optional-dependencies.e2e - ++ lib.optionals enableDbusUi [ - dbus-python - notify2 - pygobject3 - pydbus + ++ lib.optionals enableDbusUi optional-dependencies.ui; + + optional-dependencies.ui = with python3Packages; [ + dbus-python + notify2 + pygobject3 + pydbus ]; - nativeCheckInputs = [ - pytest + nativeCheckInputs = with python3Packages; [ + aioresponses faker pytest-aiohttp - aioresponses - ]; - - nativeBuildInputs = [ - installShellFiles - ]; + pytestCheckHook + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # darwin has difficulty communicating with server, fails some integration tests doCheck = !stdenv.isDarwin; - checkPhase = '' - pytest - ''; - postInstall = '' installManPage docs/man/*.[1-9] ''; |