diff --git a/pkgs/development/python-modules/magic-wormhole-transit-relay/default.nix b/pkgs/development/python-modules/magic-wormhole-transit-relay/default.nix index bf8b990fe0d9d..89366bc43f1da 100644 --- a/pkgs/development/python-modules/magic-wormhole-transit-relay/default.nix +++ b/pkgs/development/python-modules/magic-wormhole-transit-relay/default.nix @@ -6,21 +6,27 @@ autobahn, mock, twisted, - pythonOlder, - pythonAtLeast, + python, pytestCheckHook, }: buildPythonPackage rec { pname = "magic-wormhole-transit-relay"; - version = "0.2.1"; + version = "0.3.1"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-y0gBtGiQ6v+XKG4OP+xi0dUv/jF9FACDtjNqH7To+l4="; + hash = "sha256-LvLvvk008OYkhw+EIln9czuncVLtMQr0NJd0piiEkA4="; }; + postPatch = '' + # Passing the environment to twistd is necessary to preserve Python's site path. + substituteInPlace src/wormhole_transit_relay/test/test_backpressure.py --replace-fail \ + 'reactor.spawnProcess(proto, exe, args)' \ + 'reactor.spawnProcess(proto, exe, args, None)' + ''; + build-system = [ setuptools ]; dependencies = [ @@ -39,13 +45,16 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; + postCheck = '' + # Avoid collision with twisted's plugin cache (#164775). + rm "$out/${python.sitePackages}/twisted/plugins/dropin.cache" + ''; + meta = { description = "Transit Relay server for Magic-Wormhole"; homepage = "https://github.com/magic-wormhole/magic-wormhole-transit-relay"; changelog = "https://github.com/magic-wormhole/magic-wormhole-transit-relay/blob/${version}/NEWS.md"; license = lib.licenses.mit; maintainers = [ lib.maintainers.mjoerg ]; - # Python 3.12 support: https://github.com/magic-wormhole/magic-wormhole-transit-relay/issues/35 - broken = pythonOlder "3.7" || pythonAtLeast "3.12"; }; } diff --git a/pkgs/development/python-modules/magic-wormhole/default.nix b/pkgs/development/python-modules/magic-wormhole/default.nix index 5abdff45c6d16..87404ab5b21e2 100644 --- a/pkgs/development/python-modules/magic-wormhole/default.nix +++ b/pkgs/development/python-modules/magic-wormhole/default.nix @@ -2,7 +2,7 @@ lib, stdenv, buildPythonPackage, - fetchPypi, + fetchFromGitHub, # build-system setuptools, @@ -36,12 +36,14 @@ buildPythonPackage rec { pname = "magic-wormhole"; - version = "0.16.0"; + version = "0.17.0"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-FObBRomNvaem0ZAmJiOmlBmVU2Pn5DTWSq0tIz1tlMk="; + src = fetchFromGitHub { + owner = "magic-wormhole"; + repo = "magic-wormhole"; + rev = "refs/tags/${version}"; + hash = "sha256-BxPF4iQ91wLBagdvQ/Y89VIZBkMxFiEHnK+BU55Bwr4="; }; postPatch = @@ -81,8 +83,12 @@ buildPythonPackage rec { nativeCheckInputs = # For Python 3.12, remove magic-wormhole-mailbox-server and magic-wormhole-transit-relay from test dependencies, # which are not yet supported with this version. - lib.optionals (!magic-wormhole-mailbox-server.meta.broken) [ magic-wormhole-mailbox-server ] - ++ lib.optionals (!magic-wormhole-transit-relay.meta.broken) [ magic-wormhole-transit-relay ] + lib.optionals + (!magic-wormhole-mailbox-server.meta.broken && !magic-wormhole-transit-relay.meta.broken) + [ + magic-wormhole-mailbox-server + magic-wormhole-transit-relay + ] ++ [ mock pytestCheckHook @@ -101,10 +107,10 @@ buildPythonPackage rec { "src/wormhole/test/dilate/test_full.py" "src/wormhole/test/test_args.py" "src/wormhole/test/test_cli.py" + "src/wormhole/test/test_transit.py" "src/wormhole/test/test_wormhole.py" "src/wormhole/test/test_xfer_util.py" - ] - ++ lib.optionals magic-wormhole-transit-relay.meta.broken [ "src/wormhole/test/test_transit.py" ]; + ]; postInstall = '' install -Dm644 docs/wormhole.1 $out/share/man/man1/wormhole.1