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 attrs
29 autobahn
30 setuptools # pkg_resources is referenced at runtime
31 twisted
32 ]
33 ++ autobahn.optional-dependencies.twisted
34 ++ twisted.optional-dependencies.tls;
35
36 pythonImportsCheck = [ "wormhole_mailbox_server" ];
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 treq
41 ];
42
43 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
44 # these tests fail in Darwin's sandbox
45 "src/wormhole_mailbox_server/test/test_web.py"
46 ];
47
48 passthru.tests = {
49 inherit (nixosTests) magic-wormhole-mailbox-server;
50 };
51
52 meta = {
53 description = "Securely transfer data between computers";
54 homepage = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server";
55 changelog = "https://github.com/magic-wormhole/magic-wormhole-mailbox-server/blob/${version}/NEWS.md";
56 license = lib.licenses.mit;
57 maintainers = [ lib.maintainers.mjoerg ];
58 };
59}