From 72295f19c63c5c26362845560d200e19010ebd84 Mon Sep 17 00:00:00 2001 From: eduard6 Date: Sun, 30 Apr 2017 20:38:13 -0400 Subject: [PATCH 1/5] Upgrade packages if needed (for example after getting latest git commits). Tested working with new install too --- setupall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setupall.py b/setupall.py index b6d1d2a..b9c5957 100644 --- a/setupall.py +++ b/setupall.py @@ -38,5 +38,5 @@ if mode not in packages: for x in packages[mode]: dirtorun = os.path.join(curdir, x) - p = subprocess.Popen(['pip', 'install', '.'], cwd=dirtorun) + p = subprocess.Popen(['pip', 'install', '--upgrade', '--upgrade-strategy=only-if-needed', '.'], cwd=dirtorun) p.wait() From 909dd147caf2098a762b088317ad7a664a171166 Mon Sep 17 00:00:00 2001 From: eduard6 Date: Sun, 30 Apr 2017 20:55:51 -0400 Subject: [PATCH 2/5] A few install doc fixes, document upgrade process --- docs/INSTALL.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 308211d..b6c9fdf 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -20,8 +20,9 @@ automake pkg-config libtool libffi-dev libssl-dev Then: - sudo pip install virtualenv + sudo pip install virtualenv service-identity mkdir jmvenv + virtualenv jmvenv cd jmvenv; source bin/activate; cd .. Install this repo in the virtualenv: @@ -63,3 +64,6 @@ There, you need to install the client code (without Joinmarket's bitcoin): python setupall.py --client-only +#### Upgrading + +After upgrading to a new version (or whenever the code has changed) you must re-run the applicable `python setupall.py` commands as described above. From 8050dc9d64b7191e38100f142247d7365598fb35 Mon Sep 17 00:00:00 2001 From: eduard6 Date: Tue, 2 May 2017 16:43:17 -0400 Subject: [PATCH 3/5] Add --develop mode and docs for it --- docs/INSTALL.md | 18 +++++++++++++++++- setupall.py | 15 ++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index b6c9fdf..78d9e60 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -66,4 +66,20 @@ There, you need to install the client code (without Joinmarket's bitcoin): #### Upgrading -After upgrading to a new version (or whenever the code has changed) you must re-run the applicable `python setupall.py` commands as described above. +After upgrading to a new version (or whenever the code has changed) you must re-run the +applicable `python setupall.py` commands as described above. + +#### Development (or making other changes to the code) + +If you are a developer or you plan on modifying the code (for example to add customizations), +do not run the `python setupall.py` commands above. Instead run: + + python setupall.py --develop + +The normal installation (`--daemon` or `--client-bitcoin`) would install the JoinMarket +packages to the virtualenv's `site-packages` directory. This would mean any changes you make to +the local code would not have effect until the packages are reinstalled. + +Using `--develop` causes a `.egg-link` file to be added to `site-packages` for each package. +The `.egg-link` file acts like a symlink pointing to the local code. This means any changes you +make to the code will have effect immediately. diff --git a/setupall.py b/setupall.py index b9c5957..f97a619 100644 --- a/setupall.py +++ b/setupall.py @@ -20,7 +20,9 @@ def help(): "Mode is one of:\n" "`--daemon` - for joinmarketd\n" "`--client-only` - for client not using joinmarket's own bitcoin code\n" - "`--client-bitcoin` - using joinmarket bitcoin code, installs secp256k1.") + "`--client-bitcoin` - using joinmarket bitcoin code, installs secp256k1\n" + "`--develop` - uses the local code for all packages (does not install to site-packages)." + ) sys.exit(0) if len(sys.argv) != 2: @@ -32,11 +34,18 @@ mode = sys.argv[1] packages = {"--daemon": ["jmbase", "jmdaemon"], "--client-only": ["jmbase", "jmclient"], - "--client-bitcoin": ["jmbase", "jmbitcoin", "jmclient"]} + "--client-bitcoin": ["jmbase", "jmbitcoin", "jmclient"], + "--develop": ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"]} if mode not in packages: help() for x in packages[mode]: dirtorun = os.path.join(curdir, x) - p = subprocess.Popen(['pip', 'install', '--upgrade', '--upgrade-strategy=only-if-needed', '.'], cwd=dirtorun) + + cmd = ['pip', 'install', '--upgrade', '--upgrade-strategy=only-if-needed'] + if mode == "--develop": + cmd.append('-e') + cmd.append('.') + + p = subprocess.Popen(cmd, cwd=dirtorun) p.wait() From 8d7b8fbac0f0d9521af3c7f0c7a5bf26b9e6c42c Mon Sep 17 00:00:00 2001 From: eduard6 Date: Tue, 2 May 2017 22:19:22 -0400 Subject: [PATCH 4/5] Ignore *.egg-info, and scripts/logs/*.schedule --- .gitignore | 1 + scripts/logs/.gitignore | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3329365..8bf11e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc *.swp +*.egg-info .cache/ .coverage blockchain.cache diff --git a/scripts/logs/.gitignore b/scripts/logs/.gitignore index b9f50b1..f687ece 100644 --- a/scripts/logs/.gitignore +++ b/scripts/logs/.gitignore @@ -1,4 +1,5 @@ # Ignore all logs *.log +*.schedule # Except this file -!.gitignore \ No newline at end of file +!.gitignore From 62a567ce3c02f723e50096a31129e9dee1fb259b Mon Sep 17 00:00:00 2001 From: eduard6 Date: Tue, 2 May 2017 23:36:58 -0400 Subject: [PATCH 5/5] Fix travis error --- setupall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setupall.py b/setupall.py index f97a619..4dcef71 100644 --- a/setupall.py +++ b/setupall.py @@ -42,7 +42,7 @@ if mode not in packages: for x in packages[mode]: dirtorun = os.path.join(curdir, x) - cmd = ['pip', 'install', '--upgrade', '--upgrade-strategy=only-if-needed'] + cmd = ['pip', 'install', '--upgrade'] if mode == "--develop": cmd.append('-e') cmd.append('.')