1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 setuptools, 7 attrs, 8 twisted, 9 autobahn, 10 treq, 11 nixosTests, 12 pytestCheckHook, 13}: 14 15buildPythonPackage rec { 16 pname = "magic-wormhole-mailbox-server"; 17 version = "0.5.1"; 18 pyproject = true; 19 20 src = fetchPypi { 21 inherit pname version; 22 hash = "sha256-oAegNnIpMgRldoHb9QIEXW1YF8V/mq4vIibm6hoAjKE="; 23 }; 24 25 build-system = [ setuptools ]; 26 27 dependencies = 28 [ 29 attrs 30 autobahn 31 setuptools # pkg_resources is referenced at runtime 32 twisted 33 ] 34 ++ autobahn.optional-dependencies.twisted 35 ++ twisted.optional-dependencies.tls; 36 37 pythonImportsCheck = [ "wormhole_mailbox_server" ]; 38 39 nativeCheckInputs = [ 40 pytestCheckHook 41 treq 42 ]; 43 44 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ 45 # these tests fail in Darwin's sandbox 46 "src/wormhole_mailbox_server/test/test_web.py" 47 ]; 48 49 passthru.tests = { 50 inherit (nixosTests) magic-wormhole-mailbox-server; 51 }; 52 53 meta = { 54 description = "Securely transfer data between computers"; 55 homepage = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server"; 56 changelog = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/blob/${version}/NEWS.md"; 57 license = lib.licenses.mit; 58 maintainers = [ lib.maintainers.mjoerg ]; 59 }; 60}