Skip to content

Commit

Permalink
python312Packages.{magic-wormhole-transit-relay: 0.2.1 -> 0.3.1, magi…
Browse files Browse the repository at this point in the history
…c-wormhole: 0.16.0 -> 0.17.0} (#351444)
  • Loading branch information
jopejoe1 authored Nov 2, 2024
2 parents 2f7095a + 254e934 commit c63b724
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
autobahn,
mock,
twisted,
pythonOlder,
pythonAtLeast,
python,
pytestCheckHook,
}:

Expand All @@ -21,6 +20,13 @@ buildPythonPackage rec {
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 = [
Expand All @@ -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";
};
}
24 changes: 15 additions & 9 deletions pkgs/development/python-modules/magic-wormhole/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,

# build-system
setuptools,
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c63b724

Please sign in to comment.