python313Packages.slixmpp: fix build and modernize

+36 -10
+36 -10
pkgs/development/python-modules/slixmpp/default.nix
··· 3 3 buildPythonPackage, 4 4 aiodns, 5 5 aiohttp, 6 + cryptography, 7 + defusedxml, 8 + emoji, 6 9 fetchPypi, 7 10 gnupg, 8 11 pyasn1, 9 12 pyasn1-modules, 10 13 pytestCheckHook, 11 14 replaceVars, 15 + rustPlatform, 12 16 pythonOlder, 13 17 }: 14 18 15 19 buildPythonPackage rec { 16 20 pname = "slixmpp"; 17 21 version = "1.10.0"; 18 - format = "setuptools"; 22 + pyproject = true; 19 23 20 24 disabled = pythonOlder "3.9"; 21 25 ··· 24 28 hash = "sha256-RrxdAVB8tChcglXOXHF8C19o5U38HxcSiDmY1tciV4o="; 25 29 }; 26 30 27 - propagatedBuildInputs = [ 31 + patches = [ 32 + (replaceVars ./hardcode-gnupg-path.patch { 33 + inherit gnupg; 34 + }) 35 + ]; 36 + 37 + build-system = with rustPlatform; [ 38 + cargoSetupHook 39 + maturinBuildHook 40 + ]; 41 + 42 + cargoDeps = rustPlatform.fetchCargoVendor { 43 + inherit pname src; 44 + hash = "sha256-CeuClBYEG2YCm5lnxFs5RhjIgYEOe76rzHpauLZeQR0="; 45 + }; 46 + 47 + dependencies = [ 28 48 aiodns 29 - aiohttp 30 49 pyasn1 31 50 pyasn1-modules 32 51 ]; 33 52 34 - nativeCheckInputs = [ pytestCheckHook ]; 53 + optional-dependencies = { 54 + xep-0363 = [ aiohttp ]; 55 + xep-0444-compliance = [ emoji ]; 56 + xep-0464 = [ cryptography ]; 57 + safer-xml-parserig = [ defusedxml ]; 58 + }; 35 59 36 - patches = [ 37 - (replaceVars ./hardcode-gnupg-path.patch { 38 - inherit gnupg; 39 - }) 40 - ]; 60 + nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies); 61 + 62 + preCheck = '' 63 + # don't test against pure python version in the source tree 64 + rm -rf slixmpp 65 + ''; 41 66 42 67 disabledTestPaths = [ 68 + # Exclude integration tests 69 + "itests/" 43 70 # Exclude live tests 44 71 "tests/live_test.py" 45 - "tests/test_xep_0454.py" 46 72 ]; 47 73 48 74 pythonImportsCheck = [ "slixmpp" ];