python313Packages.slixmpp: fix build and modernize

This commit is contained in:
Martin Weinelt 2025-04-05 02:43:24 +02:00
parent 282668a6cf
commit c7115c1fc3
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -3,19 +3,23 @@
buildPythonPackage,
aiodns,
aiohttp,
cryptography,
defusedxml,
emoji,
fetchPypi,
gnupg,
pyasn1,
pyasn1-modules,
pytestCheckHook,
replaceVars,
rustPlatform,
pythonOlder,
}:
buildPythonPackage rec {
pname = "slixmpp";
version = "1.10.0";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.9";
@ -24,25 +28,47 @@ buildPythonPackage rec {
hash = "sha256-RrxdAVB8tChcglXOXHF8C19o5U38HxcSiDmY1tciV4o=";
};
propagatedBuildInputs = [
aiodns
aiohttp
pyasn1
pyasn1-modules
];
nativeCheckInputs = [ pytestCheckHook ];
patches = [
(replaceVars ./hardcode-gnupg-path.patch {
inherit gnupg;
})
];
build-system = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname src;
hash = "sha256-CeuClBYEG2YCm5lnxFs5RhjIgYEOe76rzHpauLZeQR0=";
};
dependencies = [
aiodns
pyasn1
pyasn1-modules
];
optional-dependencies = {
xep-0363 = [ aiohttp ];
xep-0444-compliance = [ emoji ];
xep-0464 = [ cryptography ];
safer-xml-parserig = [ defusedxml ];
};
nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);
preCheck = ''
# don't test against pure python version in the source tree
rm -rf slixmpp
'';
disabledTestPaths = [
# Exclude integration tests
"itests/"
# Exclude live tests
"tests/live_test.py"
"tests/test_xep_0454.py"
];
pythonImportsCheck = [ "slixmpp" ];