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()