From 0765a567ff02bd7920cfc24e5035dd3a0a819483 Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Tue, 23 May 2017 19:43:18 -0400 Subject: [PATCH 1/2] Add development instructions. --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index 15bd17c..1807234 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,60 @@ connection is established, data can flow in either direction. All data is encrypted (using nacl/libsodium "secretbox") using a key derived from the PAKE phase. See `src/wormhole/cli/cmd_send.py` for examples. +## Development + +To set up Magic Wormhole for development, you will first need to +install [virtualenv][]. + +Once you've done that, `cd` into the root of the repository and run: + +``` +virtualenv venv +source venv/bin/activate +pip install --upgrade pip setuptools +``` + +Now your virtualenv has been activated. You'll want to re-run +`source venv/bin/activate` for every new terminal session you open. + +To install Magic Wormhole and its development dependencies into your +virtualenv, run: + +``` +pip install -e .[dev] +``` + +### Running Tests + +Within your virtualenv, the command-line program `trial` will +run the test suite: + +``` +trial wormhole +``` + +This tests the entire `wormhole` package. If you want to run +only the tests for a specific module, or even just a specific test, +you can specify it instead via Python's standard dotted +import notation, e.g.: + +``` +trial wormhole.test.test_cli.PregeneratedCode.test_file_tor +``` + +### Troubleshooting + +Every so often, you might get a traceback with the following +kind of error: + +``` +pkg_resources.DistributionNotFound: The 'magic-wormhole==0.9.1-268.g66e0d86.dirty' distribution was not found and is required by the application +``` + +If this happens, run `pip install -e .[dev]` again. + +[virtualenv]: http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/ + ## License, Compatibility This library is released under the MIT license, see LICENSE for details. From 749db2d8c02e5392fed6d46fad1c9126d52b9820 Mon Sep 17 00:00:00 2001 From: Atul Varma Date: Tue, 23 May 2017 19:45:49 -0400 Subject: [PATCH 2/2] Add 'venv' to .gitignore. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index d1e78f0..7acd6d7 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ target/ /misc/node_modules/ /.automat_visualize/ /docs/state-machines/*.png + +# Virtual environment stuff +venv/