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/docs/INSTALL.md b/docs/INSTALL.md index 308211d..78d9e60 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,22 @@ 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. + +#### 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/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 diff --git a/setupall.py b/setupall.py index b6d1d2a..4dcef71 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', '.'], cwd=dirtorun) + + cmd = ['pip', 'install', '--upgrade'] + if mode == "--develop": + cmd.append('-e') + cmd.append('.') + + p = subprocess.Popen(cmd, cwd=dirtorun) p.wait()