Commit Graph

1506 Commits

Author SHA1 Message Date
Brian Warner
5335cfb8b6 Merge PR300: use pywin32 instead of pypiwin32 2018-06-16 11:09:32 -07:00
Marius Gedminas
21dbf00a7f
Add long_description_content_type to setup.py
The new PyPI code discards long_description when it's not valid ReStructuredText.  Luckily it also supports Markdown, but you have to [specify the content type](https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py) explicitly in that case.

(IIRC for this to work correctly you also have to use sufficiently recent versions of setuptools and twine to upload releases.)

Should fix #303.
2018-06-12 14:08:34 +03:00
Ofek Lev
16c48a54f1
update Windows dependency 2018-06-02 17:36:15 -04:00
Thomas Waldmann
a333a02366 use pyinstaller to build wormhole fat/standalone binary
tested with/on:
- ubuntu linux 18.04 amd64
- pyinstaller 3.3.1 (pip install pyinstaller)
- python 3.6.5

There is a good chance it also works on FreeBSD, maybe also on macOS.

The change in __main__.py was required because otherwise it complains about
__main__ not being a package when trying the dot-relative import.
2018-06-02 18:05:45 +02:00
Brian Warner
6f42433c57 docs/api: minor rephrasings 2018-05-28 23:42:04 -07:00
Vasudev Kamath
aac5980bf4 Enable checking for pep8 confirmance in tox
Also make sure to ignore E741 naming a variable as l will raise this error and
reason is l is similar to 1 and people might get confused. For me it doesn't
look like an error hence ignored in tox.ini
2018-04-21 13:00:25 +05:30
Vasudev Kamath
12dcd6a184 Make code pep-8 compliant 2018-04-21 13:00:08 +05:30
Brian Warner
355cc01aee Merge PR293: include client version in server BIND message 2018-04-03 17:11:53 -07:00
Brian Warner
5c84f6a373 wormhole: slightly different way to unicode-encode the version
(this is somewhat more in line with how this distinction is made elsewhere in
the code)
2018-04-03 17:10:46 -07:00
Brian Warner
0dd3a12546 cosmetic changes, remove debug print 2018-04-03 17:05:33 -07:00
Baime
1197e5fb6d fix py 3.x versioneer issue 2018-03-23 18:19:31 +01:00
Baime
e77a2d605b bind passes tuple, fixed implementation issues 2018-03-23 17:33:48 +01:00
Brian Warner
7b39e42df7 setup.py: add classifiers and long_description 2018-03-22 00:32:06 -07:00
Baeumla
82dc4a4e2e py 2.7 3.x fix 2018-03-09 10:20:03 +01:00
Baeumla
0322d341e8 py 2.7 fix 2018-03-09 09:31:59 +01:00
Baeumla
4f8aa5a69e report clinet version on bind 2018-03-08 11:54:27 +01:00
Baeumla
86edf01070 rendevouz server documentation update 2018-03-07 09:25:53 +01:00
Brian Warner
c5ae678417 Merge branch 'observers-4'
This factors out the various "get me a Deferred which fires when/if we
compute a value" code from the _DeferredWormhole API calls: get_code,
get_unverified_key, get_versions, get_message, etc. It uses an eventual-send
for each one, which will protect against surprises when an application
invokes an wormhole API from within a previous API's callback: without this,
the internal wormhole state isn't guaranteed to be coherent, and crashes
could result.
2018-02-26 18:32:49 -08:00
Brian Warner
be47f53e7c wormhole: switch to observers for all APIs
Tests can pass an EventualQueue into wormhole.create(), to override the
default. This lets the tests flush the queue without using a haphazard
real-time delay.

closes #23

(in fact, we added multiple-Deferreds-per-API a while ago, but this does it
in a much cleaner fashion, and with the safety of an eventual-send)
2018-02-26 17:50:40 -08:00
Brian Warner
caabb3510c add OneShotObserver and SequenceObserver, with tests
This factors out the various "give me a Deferred for an value that may or may
not eventually be successfully generated" routines in _DeferredWormhole. It
uses an eventual-send to fire the Deferreds to avoid plan-coordination
hazards when the attached callbacks then call back into the Wormhole object
before the rest of the state transition has finished.
2018-02-26 17:50:40 -08:00
Brian Warner
43965d5289 add eventual-send queue
We defer starting a new timer until we've completely emptied the queue, since
we know we'll get to any new events added inside one of our callbacks. The
old design in Foolscap (which copied the list, cleared the original, then
fired everything in the copy) didn't look at these new events. OTOH, this
pop(0)-until-empty approach makes it easier to get into an infinite loop (any
callback which queues a new callback will get priority over anything else).
But the code is simpler.
2018-02-26 17:50:40 -08:00
Brian Warner
323044e9f5 stop supporting py3.4 on windows
Python.org is still supporting 3.4, but the lastest pypiwin32 stopped
providing binary wheels for windows for 3.4, so we can't run the appveyor CI
tests any more. It might still work there, but you'll have to find a way to
build pypiwin32 yourself.

We still support py3.4 on non-windows platforms.
2018-02-26 17:23:27 -08:00
Brian Warner
1c21119a73 add test_ipaddrs, adapted from tahoe's test_iputil 2018-02-22 21:32:44 -08:00
Brian Warner
9cb763e83a add "pragma: no cover" to set_trace() and debug code
we've got some tests to exercise this, so it shouldn't bitrot completely, but
there are some branches-not-taken warnings that I think are spurious
2018-02-22 09:42:43 -08:00
Brian Warner
7e22949b70 Merge branch 'remove-rendezvous'
Remove the mailbox/rendezvous server code (and tests), since that now lives
in the magic-wormhole-mailbox-server repository. Also remove the
munin (monitoring) plugins and the man page.

We declare magic-wormhole-mailbox-server as a dependency for the "[dev]"
extra (i.e. only for tests). A few tests needed updating to handle the new
structure, but this was mostly confined to test/common.py .

refs #240
2018-02-21 15:00:31 -08:00
Brian Warner
e7d0dbbb88 oops, typo 2018-02-21 01:57:07 -08:00
Brian Warner
9ae2307a72 fix tests 2018-02-21 00:38:19 -08:00
Brian Warner
37a7ed7adc WIP: remove unused server tests, minor syntax fixes. still fails. 2018-02-20 23:54:28 -08:00
Brian Warner
9957044a99 WIP: start replacing ServerBase with imported server
doesn't work yet at all
2018-02-20 23:46:29 -08:00
Brian Warner
77201966b4 remove server-related source files, munin plugins
setup.py: pin to magic-wormhole-mailbox-server 0.1.0, the current version
2018-02-20 23:46:29 -08:00
Brian Warner
d42ac47ac8 let tests override KEY_TIMER/VERIFY_TIMER to tolerate slow test hosts
I've seen intermittent failures in
test_cli.PregeneratedCode.test_text_subprocess where the host was slow (or
overloaded) enough that the "Waiting for sender.." pacifier message was
displayed, which flunks the test because we're looking for a specific output
string. We patch this 1-second timer in the non-subprocess tests, but you
can't patch across a process boundary.

This patch adds an undocumented environment variable that lets you override
the timer values. The test then sets it to something large.

For future consideration: another approach would be to change the test to
tolerate the extra message. This would be trickier to validate, though.
2018-02-20 18:14:57 -08:00
Brian Warner
e4e8216d2c tests: pin transit-relay to 0.1.1, that's the new version 2018-02-19 17:24:27 -08:00
Brian Warner
be41563ef4 README: fix pypi badge: we're magic-wormhole, not zfec 2018-02-17 19:37:25 -08:00
Brian Warner
dfca0209b3 README: add PyPI badge 2018-02-17 19:36:45 -08:00
Brian Warner
13b1539409 setup.py: remove the dependency on ipaddress
Do we still need this? Nothing in wormhole uses it.

refs #274
2018-02-15 17:02:19 -08:00
Brian Warner
43f45aa2c9 munin/wormhole_event_rate: fix calculation of 'scary' and 'incomplete'
I made a cut-and-paste error before, and these two values were derived from
'happy' instead of their own counts.
2018-02-15 11:55:31 -08:00
Brian Warner
6b6154bc29 NEWS: update for 0.10.5 2018-02-14 23:41:08 -08:00
Brian Warner
83d0d15a39 update to spake2-0.8, which loads much faster 2018-02-14 18:58:25 -08:00
Brian Warner
6061ec7869 _key: note places where we should use eventual-send
This will be necessary to avoid reentrancy hazards, in case the application
code makes other wormhole API calls from the callbacks for
get_unverified_key(), get_verifier(), or get_message().
2018-02-14 02:12:33 -08:00
Brian Warner
593b359166 Merge branch '280-input-threading'
closes #280
2018-02-14 02:12:04 -08:00
Brian Warner
af406a600e _rlcompleter: use blockingCallFromThread for all Helper APIs
We were missing two (the calls to choose_nameplate() and choose_words() that
happen after the input() function has finished, but while we're still inside
the thread that makes it safe for input() to block). This almost certainly
caused the crash seen in issue #280.

Update the tests to match: CodeInputter.finish must now be called with
deferToThread from inside tests, or the internal blockingCallFromThread must
be stubbed out.
2018-02-14 01:13:30 -08:00
Brian Warner
3847339f43 _input: reject attempts to call Helper from a non-main thread
This causes two threads to use the reactor at the same time, with horrible
results. The _rlcompleter code currently violates this requirement, causing
occasional failures if the messages arrive in just the wrong way (refs #280).
2018-02-14 00:56:18 -08:00
Brian Warner
dce01174eb improve debug_set_trace: add Allocate and Input events
Also log events at the beginning and end of Input.choose_nameplate and
Input.choose_words, since those are the two big locally-driven (UI) triggers
that cause multiple messages to be fired and lots of work to happen.
2018-02-14 00:56:14 -08:00
Brian Warner
2fadadc4db NEWS: update for 0.10.4 release 2018-01-28 16:04:50 -08:00
Brian Warner
c6fbaf5a4d _version.py: hush lgtm.com alert
This needs to be upstreamed into Versioneer, as it will disappear the next
time we upgrade.
2018-01-02 08:19:08 +01:00
Brian Warner
624072c111 hush more lgtm.com -discovered static-analysis problems 2018-01-02 08:18:45 +01:00
Brian Warner
443c402f60 remove WormholeClosedError, simplify control paths in cmd_send/receive
lgtm.com noticed some unreachable code paths, and it turns out that nothing
in the rest of the code base could ever raise WormholeClosedError (I guess it
was leftover from before the big API refactoring). Both sender and receiver
are simpler without the unnecessary checks and state variables.
2018-01-01 16:56:18 +01:00
Brian Warner
e13f3e3e13 hush some unreachable-code errors found by lgtm.com
This comments out some "if 0: debug()" stuff I keep around to investigate
problems, since lgtm thinks of it as accidentally-unreachable code.

I also deleted a server usage command
entirely (src/wormhole/server/cmd_usage.py show_usage) which was disabled
while I rewrote that schema: the new plan is to move the server into a new
repository altogether, and use a completely different approach to the
usage database.
2018-01-01 16:53:18 +01:00
Jonathan Lange
cb67511848 Do not refer to transit server in Dockerfile
https://github.com/warner/magic-wormhole/pull/263 removed the transit server,
breaking the Dockerfile.

This fixes the Dockerfile to run just the rendezvous server.
2018-01-01 13:07:36 +00:00
Brian Warner
80852fb2de Merge PR267: improve sender-side instruction text 2017-12-19 15:07:33 -08:00