projects/guix·blob python-team · refs

180 lines · 7.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Leo Famulari <[email protected]>
3;;; Copyright © 2024 normally_js <[email protected]>
4;;; Copyright © 2024, 2025 Sharlatan Hellseher <[email protected]>
5;;; Copyright © 2024 TakeV <[email protected]>
6;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
7;;; Copyright © 2025 Vinicius Monego <[email protected]>
8;;; Copyright © 2025 Brendan Tildesley <[email protected]>
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages magic-wormhole)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build-system pyproject)
28 #:use-module (guix download)
29 #:use-module (guix gexp)
30 #:use-module (guix packages)
31 #:use-module (gnu packages check)
32 #:use-module (gnu packages python-build)
33 #:use-module (gnu packages python-check)
34 #:use-module (gnu packages python-compression)
35 #:use-module (gnu packages python-crypto)
36 #:use-module (gnu packages python-web)
37 #:use-module (gnu packages python-xyz))
38
39(define-public magic-wormhole-mailbox-server
40 (package
41 (name "magic-wormhole-mailbox-server")
42 (version "0.5.1")
43 (source
44 (origin
45 (method url-fetch)
46 (uri (pypi-uri "magic-wormhole-mailbox-server" version))
47 (sha256
48 (base32
49 "18cc00dfmri648psx6kzqlbmhvax0h1gbnw1frjh8ci9f8va01x0"))))
50 (build-system pyproject-build-system)
51 (native-inputs
52 (list python-mock
53 python-pytest
54 python-setuptools
55 python-wheel))
56 (propagated-inputs
57 (list python-attrs
58 python-autobahn
59 python-idna
60 python-service-identity
61 python-treq))
62 (home-page "https://github.com/magic-wormhole/magic-wormhole-mailbox-server")
63 (synopsis "Magic-Wormhole central mailbox server")
64 (description
65 "This package provides the main server that Magic-Wormhole clients
66connect to. The server performs store-and-forward delivery for small
67key-exchange and control messages. Bulk data is sent over a direct TCP
68connection, or through a transit-relay.")
69 (license license:expat)))
70
71(define-public magic-wormhole-transit-relay
72 (package
73 (name "magic-wormhole-transit-relay")
74 (version "0.4.0")
75 (source
76 (origin
77 (method url-fetch)
78 (uri (pypi-uri "magic-wormhole-transit-relay" version))
79 (sha256
80 (base32
81 "134yh50xyrr2jrws3w4q1gy660l0wnswj78ifxn2c48vl9fq6bci"))))
82 (build-system pyproject-build-system)
83 (arguments
84 (list
85 #:phases
86 #~(modify-phases %standard-phases
87 (add-after 'install 'install-docs
88 (lambda _
89 (let* ((out #$output)
90 (docs (string-append out "/share/doc/magic-wormhole-transit-relay")))
91 (for-each (lambda (file)
92 (install-file file docs))
93 (find-files "docs/")))))
94 (add-before 'check 'fix-test
95 (lambda _
96 ;; Fix for failing test (test_buffer_fills).
97 (substitute* "src/wormhole_transit_relay/test/test_backpressure.py"
98 (("reactor\\.spawnProcess\\(proto, exe, args\\)")
99 "reactor.spawnProcess(proto, exe, args, None)")))))))
100 (native-inputs
101 (list python-mock
102 python-pytest
103 python-setuptools
104 python-wheel))
105 (propagated-inputs
106 ;; python-service-identity should be propagated from python-twisted.
107 (list python-autobahn python-service-identity python-twisted))
108 (home-page "https://github.com/magic-wormhole/magic-wormhole-transit-relay")
109 (synopsis "Magic-Wormhole relay server")
110 (description
111 "This package provides the Magic-Wormhole Transit Relay server, which
112helps clients establish bulk-data transit connections even when both are
113behind NAT boxes. Each side makes a TCP connection to this server and
114presents a handshake. Two connections with identical handshakes are glued
115together, allowing them to pretend they have a direct connection.")
116 (license license:expat)))
117
118(define-public magic-wormhole
119 (package
120 (name "magic-wormhole")
121 (version "0.21.1")
122 (source
123 (origin
124 (method url-fetch)
125 (uri (pypi-uri "magic_wormhole" version))
126 (sha256
127 (base32
128 "0rx3f9v143facxpij6d0kxq2dbg0nhbq6l92w12aljwvl5r5klxn"))))
129 (build-system pyproject-build-system)
130 (arguments
131 (list
132 #:test-flags #~(list "-k" (string-append
133 "not test_receive_send"
134 " and not test_receive_receive"))
135 #:phases
136 #~(modify-phases %standard-phases
137 ;; XXX I can't figure out how to build the docs properly.
138 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34515#101
139 (add-after 'install 'install-docs
140 (lambda _
141 (install-file "docs/wormhole.1"
142 (string-append #$output "/share/man/man1")))))))
143 (native-inputs
144 (list python-mock
145 python-pytest
146 python-pytest-twisted
147 python-setuptools
148 python-wheel
149 magic-wormhole-mailbox-server
150 magic-wormhole-transit-relay))
151 (propagated-inputs
152 (list python-attrs
153 python-autobahn
154 python-automat
155 python-click
156 python-humanize
157 python-iterable-io
158 python-noiseprotocol
159 python-pynacl
160 python-qrcode
161 python-spake2
162 python-tqdm
163 python-twisted
164 python-txtorcon
165 python-zipstream-ng))
166 (home-page "https://github.com/magic-wormhole/magic-wormhole")
167 (synopsis "Securely transfer data between computers")
168 (description
169 "Magic-Wormhole is a library and a command-line tool named wormhole,
170which makes it possible to securely transfer arbitrary-sized files and
171directories (or short pieces of text) from one computer to another. The two
172endpoints are identified by using identical \"wormhole codes\": in general,
173the sending machine generates and displays the code, which must then be typed
174into the receiving machine.
175
176The codes are short and human-pronounceable, using a phonetically-distinct
177wordlist. The receiving side offers tab-completion on the codewords, so
178usually only a few characters must be typed. Wormhole codes are single-use
179and do not need to be memorized.")
180 (license license:expat)))