diff options
Diffstat (limited to 'pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix')
-rw-r--r-- | pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix index fc9636c351a05..af4cb08de9e01 100644 --- a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix +++ b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix @@ -1,29 +1,32 @@ -{ lib -, stdenv -, buildPythonPackage -, fetchPypi -, fetchpatch -, six -, attrs -, twisted -, pyopenssl -, service-identity -, autobahn -, treq -, mock -, pythonOlder +{ + 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"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + # python 3.12 support: https://github.com/magic-wormhole/magic-wormhole-mailbox-server/issues/41 + disabled = pythonOlder "3.7" || pythonAtLeast "3.12"; src = fetchPypi { inherit pname version; - sha256 = "1af10592909caaf519c00e706eac842c5e77f8d4356215fe9c61c7b2258a88fb"; + hash = "sha256-GvEFkpCcqvUZwA5wbqyELF53+NQ1YhX+nGHHsiWKiPs="; }; patches = [ @@ -35,35 +38,33 @@ buildPythonPackage rec { }) ]; + nativeBuildInputs = [ setuptools ]; + propagatedBuildInputs = [ attrs six twisted autobahn - ] ++ autobahn.optional-dependencies.twisted - ++ twisted.optional-dependencies.tls; + ] ++ autobahn.optional-dependencies.twisted ++ twisted.optional-dependencies.tls; + + pythonImportsCheck = [ "wormhole_mailbox_server" ]; nativeCheckInputs = [ + pytestCheckHook treq mock - twisted ]; - # Fails in Darwin's sandbox - postPatch = lib.optionalString stdenv.isDarwin '' - echo 'LogRequests.skip = "Operation not permitted"' >> src/wormhole_mailbox_server/test/test_web.py - echo 'WebSocketAPI.skip = "Operation not permitted"' >> src/wormhole_mailbox_server/test/test_web.py - ''; - - checkPhase = '' - trial -j$NIX_BUILD_CORES wormhole_mailbox_server - ''; + disabledTestPaths = lib.optionals stdenv.isDarwin [ + # these tests fail in Darwin's sandbox + "src/wormhole_mailbox_server/test/test_web.py" + ]; - meta = with lib; { + meta = { description = "Securely transfer data between computers"; - homepage = "https://github.com/warner/magic-wormhole-mailbox-server"; + 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 = licenses.mit; - maintainers = with maintainers; [ ]; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.mjoerg ]; }; } |