depot/third_party/nixpkgs/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

70 lines
1.8 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
fetchpatch,
setuptools,
six,
attrs,
twisted,
autobahn,
treq,
mock,
pythonOlder,
pythonAtLeast,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "magic-wormhole-mailbox-server";
version = "0.4.1";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-GvEFkpCcqvUZwA5wbqyELF53+NQ1YhX+nGHHsiWKiPs=";
};
patches = [
(fetchpatch {
# Remove the 'U' open mode removed, https://github.com/magic-wormhole/magic-wormhole-mailbox-server/pull/34
name = "fix-for-python-3.11.patch";
url = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/commit/4b358859ba80de37c3dc0a5f67ec36909fd48234.patch";
hash = "sha256-RzZ5kD+xhmFYusVzAbGE+CODXtJVR1zN2rZ+VGApXiQ=";
})
];
build-system = [ setuptools ];
dependencies = [
attrs
autobahn
setuptools # pkg_resources is referenced at runtime
six
twisted
] ++ autobahn.optional-dependencies.twisted ++ twisted.optional-dependencies.tls;
pythonImportsCheck = [ "wormhole_mailbox_server" ];
nativeCheckInputs = [
pytestCheckHook
treq
mock
];
disabledTestPaths = lib.optionals stdenv.isDarwin [
# these tests fail in Darwin's sandbox
"src/wormhole_mailbox_server/test/test_web.py"
];
meta = {
description = "Securely transfer data between computers";
homepage = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server";
changelog = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/blob/${version}/NEWS.md";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.mjoerg ];
# Python 3.12 support: https://github.com/magic-wormhole/magic-wormhole-mailbox-server/issues/41
broken = pythonOlder "3.7" || pythonAtLeast "3.12";
};
}