diff --git a/.coveragerc b/.coveragerc index 09b3d7b..e33c860 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,15 +1,4 @@ # .coveragerc to control coverage.py [run] omit = - jmclient/jmclient/jsonrpc.py - jmclient/jmclient/electruminterface.py - jmclient/jmclient/btc.py - jmclient/test/* - jmclient/setup.py - jmbitcoin/test/* - jmbitcoin/setup.py - jmbase/test/* - jmbase/setup.py - jmdaemon/test/* - jmdaemon/setup.py - jmdaemon/jmdaemon/socks.py + src/jmclient/jsonrpc.py \ No newline at end of file diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 419bc4e..ae3450e 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -18,23 +18,21 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} -# - name: Cache venv -# id: cache-venv -# uses: actions/cache@v3 -# env: -# cache-name: venv -# with: -# path: jmvenv -# key: ${{ runner.os }}-${{ matrix.python-version }}-${{ env.cache-name }}-${{ hashFiles('requirements/*.txt', 'install.sh', '*/setup.py') }} + - name: Cache venv + id: cache-venv + uses: actions/cache@v3 + env: + cache-name: venv + with: + path: jmvenv + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ env.cache-name }}-${{ hashFiles('requirements/*.txt', 'install.sh', '*/setup.py') }} - name: Setup joinmarket + virtualenv -# if: steps.cache-venv.outputs.cache-hit != 'true' + if: steps.cache-venv.outputs.cache-hit != 'true' run: | - sed -i.bak 's/-e //g' requirements/base.txt - sed -i.bak 's/-e //g' requirements/gui.txt ./install.sh --develop --with-qt - ./jmvenv/bin/pip install -r requirements/testing.txt + ./jmvenv/bin/python -m pip install --upgrade pip - name: Lint with flake8 - run: ./jmvenv/bin/flake8 -v jmclient jmbase jmbitcoin jmdaemon scripts + run: ./jmvenv/bin/flake8 -v src - name: Cache bitcoind uses: actions/cache@v3 env: diff --git a/README.md b/README.md index 8c2ed77..624b119 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ If binaries are built, they will be gpg signed and announced on the Releases pag If you haven't chosen the Qt option during installation with `install.sh`, then to run the script `joinmarket-qt.py` from the command line you will need to install two more packages. Use these 2 commands while the `jmvenv` virtual environment is activated: ``` -pip install -r requirements/gui.txt +pip install .[gui] ``` After this, the command `python joinmarket-qt.py` from within the `scripts` subdirectory should work. There is a [walkthrough](docs/JOINMARKET-QT-GUIDE.md) for what to do next. diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 5bbb2bb..e796502 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -75,7 +75,7 @@ Then build and install a local copy of libsecp256k1 for python-bitcointx: > *NOTE*: It is very important to have activated the virtual environment before running this step. Otherwise, `pip install` will fail, you may be tempted to re-run it with `sudo pip install` which will cause problems in the future. - pip install -r requirements/base.txt + pip install .[services] If you have installed this "full" version of the client, you can use it with the command line scripts as explained in the [usage guide](USAGE.md). @@ -122,7 +122,7 @@ If you have installed this "full" version of the client, you can use it with the 7) Setup joinmarket-qt ``` - pip install -r requirements/gui.txt + pip install .[gui] ``` 8) Start joinmarket-qt ``` @@ -165,10 +165,9 @@ Unzip the `joinmarket-clientserver-x.x.x` (where `x.x.x` is the release number) Using the command prompt in Administrator mode, go to that directory and run the commands: -`pip install -r requirements\base.txt` -`pip install -r requirements\gui.txt` +`pip install joinmarket[services]` -(the latter is needed for Joinmarket-Qt). +(replace `services` with `gui` for Joinmarket-Qt). The final step is to manually add the libsodium dependency, as mentioned. Do the following: diff --git a/docs/JSON-RPC-API-using-jmwalletd.md b/docs/JSON-RPC-API-using-jmwalletd.md index 66c2ef0..d6ba7b1 100644 --- a/docs/JSON-RPC-API-using-jmwalletd.md +++ b/docs/JSON-RPC-API-using-jmwalletd.md @@ -28,7 +28,7 @@ On initially creating, unlocking or recovering a wallet, a new access and refres Tokens are signed with HS256 (HMAC with SHA-256), a symmetric keyed hashing algorithm that uses one secret key. Signature keys (differentiated between access and refresh tokens) are generated from random bytes upon the following events, implying that any previously issued token is invalidated. -- starting Joinmarket wallet deamon +- starting Joinmarket wallet daemon - creating, unlocking or recovering a wallet if RPC API is already serving another wallet - locking wallet diff --git a/docs/TESTING.md b/docs/TESTING.md index 759997d..c296f19 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -7,7 +7,7 @@ Work in your `jmvenv` virtual environment as for all Joinmarket work. Make sure Install the test requirements: - (jmvenv)$ pip install -r requirements/testing.txt + (jmvenv)$ pip install .[test] #### Running the test suite. diff --git a/install.sh b/install.sh index 6f04365..16afd2c 100755 --- a/install.sh +++ b/install.sh @@ -434,16 +434,17 @@ CookieAuthentication 1 joinmarket_install () { - reqs=( 'base.txt' ) + reqs='services' if [[ ${with_qt} == "1" ]]; then - reqs+=( 'gui.txt' ) + reqs='gui' + fi + if [[ ${develop} == "1" ]]; then + reqs+=',test' fi - for req in "${reqs[@]}"; do - if [ "$with_jmvenv" == 1 ]; then pip_command=pip; else pip_command=pip3; fi - $pip_command install -r "requirements/${req}" || return 1 - done + if [ "$with_jmvenv" == 1 ]; then pip_command=pip; else pip_command=pip3; fi + $pip_command install -e ".[${reqs}]" || return 1 if [[ ${with_qt} == "1" ]]; then if [[ -d ~/.local/share/icons ]] && [[ -d ~/.local/share/applications ]]; then @@ -462,7 +463,9 @@ parse_flags () while :; do case $1 in --develop) - # no-op for backwards compatibility + # editable install is currently always on + # option solely triggers test dependencies installation for now + develop='1' ;; --disable-os-deps-check) use_os_deps_check='0' diff --git a/jmbase/setup.py b/jmbase/setup.py deleted file mode 100644 index 652899f..0000000 --- a/jmbase/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -from setuptools import setup - - -setup(name='joinmarketbase', - version='0.9.11dev', - description='Joinmarket client library for Bitcoin coinjoins', - url='https://github.com/JoinMarket-Org/joinmarket-clientserver/tree/master/jmbase', - author='', - author_email='', - license='GPL', - packages=['jmbase'], - install_requires=['twisted==22.4.0', 'service-identity==21.1.0', - 'chromalog==1.0.5', 'pyaes==1.6.1', - 'txtorcon==22.0.0'], - python_requires='>=3.7', - zip_safe=False) diff --git a/jmbitcoin/setup.py b/jmbitcoin/setup.py deleted file mode 100644 index 6edc407..0000000 --- a/jmbitcoin/setup.py +++ /dev/null @@ -1,14 +0,0 @@ -from setuptools import setup - - -setup(name='joinmarketbitcoin', - version='0.9.11dev', - description='Joinmarket client library for Bitcoin coinjoins', - url='https://github.com/JoinMarket-Org/joinmarket-clientserver/tree/master/jmbitcoin', - author='', - author_email='', - license='GPL', - packages=['jmbitcoin'], - python_requires='>=3.7', - install_requires=['python-bitcointx==1.1.3'], - zip_safe=False) diff --git a/jmclient/setup.py b/jmclient/setup.py deleted file mode 100644 index 30a9b97..0000000 --- a/jmclient/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -from setuptools import setup - - -setup(name='joinmarketclient', - version='0.9.11dev', - description='Joinmarket client library for Bitcoin coinjoins', - url='https://github.com/JoinMarket-Org/joinmarket-clientserver/tree/master/jmclient', - author='', - author_email='', - license='GPL', - packages=['jmclient'], - install_requires=['joinmarketbase==0.9.11dev', 'mnemonic==0.20', - 'argon2_cffi==21.3.0', 'bencoder.pyx==3.0.1', - 'klein==20.6.0', 'pyjwt==2.4.0', - 'autobahn==20.12.3', 'werkzeug==2.2.3'], - python_requires='>=3.7', - zip_safe=False) diff --git a/jmdaemon/setup.py b/jmdaemon/setup.py deleted file mode 100644 index 3c687b6..0000000 --- a/jmdaemon/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -from setuptools import setup - - -setup(name='joinmarketdaemon', - version='0.9.11dev', - description='Joinmarket client library for Bitcoin coinjoins', - url='https://github.com/JoinMarket-Org/joinmarket-clientserver/tree/master/jmdaemon', - author='', - author_email='', - license='GPL', - packages=['jmdaemon'], - install_requires=['cryptography==3.3.2; platform_machine != "aarch64" and platform_machine != "amd64" and platform_machine != "x86_64"', - 'cryptography==41.0.2; platform_machine == "aarch64" or platform_machine == "amd64" or platform_machine == "x86_64"', - 'pyopenssl==23.2.0', 'libnacl==1.8.0', - 'joinmarketbase==0.9.11dev'], - python_requires='>=3.7', - zip_safe=False) diff --git a/jmqtui/setup.py b/jmqtui/setup.py deleted file mode 100644 index acef020..0000000 --- a/jmqtui/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import setup - -setup(name='joinmarketui', - version='0.9.11dev', - description='Joinmarket client library for Bitcoin coinjoins', - url='https://github.com/JoinMarket-Org/joinmarket-clientserver/tree/master/jmqtui', - author='', - author_email='', - license='GPL', - packages=['jmqtui'], - install_requires=['PyQt5!=5.15.0,!=5.15.1,!=5.15.2,!=6.0'], - python_requires='>=3.7', - zip_safe=False) - -# The following command should be executed whenever `open_wallet_dialog.ui` is updated. -# We have commented out this command so that we wouldn't require every user of JoinMarket-qt -# to install the correct version of pyside2-uic. -#import os -#os.system('pyside2-uic jmqtui/open_wallet_dialog.ui -o jmqtui/open_wallet_dialog.py') diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..880970c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,81 @@ +[build-system] +requires = ["setuptools>=64", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "joinmarket" +version = "0.9.11dev" +description = "Joinmarket client library for Bitcoin coinjoins" +readme = "README.md" +requires-python = ">=3.7" +license = {file = "LICENSE"} +dependencies = [ + "chromalog==1.0.5", + "pyaes==1.6.1", + "service-identity==21.1.0", + "txtorcon==22.0.0", + "twisted==22.4.0", +] + +[project.optional-dependencies] +jmbitcoin = [ + "python-bitcointx==1.1.3", +] +jmclient = [ + "argon2_cffi==21.3.0", + "autobahn==20.12.3", + "bencoder.pyx==3.0.1", + "klein==20.6.0", + "mnemonic==0.20", + "pyjwt==2.4.0", + "werkzeug==2.2.3", +] +jmdaemon = [ + "libnacl==1.8.0", + "pyopenssl==23.2.0", + 'cryptography==3.3.2; platform_machine != "aarch64" and platform_machine != "amd64" and platform_machine != "x86_64"', + 'cryptography==41.0.2; platform_machine == "aarch64" or platform_machine == "amd64" or platform_machine == "x86_64"', +] +jmqtui = [ + "PyQt5!=5.15.0,!=5.15.1,!=5.15.2,!=6.0", + "PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0", # https://bugreports.qt.io/browse/QTBUG-88688 + "qrcode[pil]==7.3.1", + 'pywin32; platform_system == "Windows"', + "qt5reactor==0.6.3", +] +client = [ + "joinmarket[jmclient]", + "joinmarket[jmbitcoin]", +] +daemon = [ + "joinmarket[jmdaemon]", +] +services = [ + "joinmarket[client]", + "joinmarket[daemon]", +] +test = [ + "joinmarket[services]", + "coverage==5.2.1", + "flake8", + "freezegun", + "mock", + "pexpect", + "pytest-cov>=2.4.0,<2.6", + "pytest==6.2.5", + "python-coveralls", +] +gui = [ + "joinmarket[services]", + "joinmarket[jmqtui]", +] + +[project.urls] +repository = "https://github.com/JoinMarket-Org/joinmarket-clientserver.git" + +[tool.setuptools.packages.find] +where = ["src"] +exclude = ["*.test"] + +[tool.pytest.ini_options] +testpaths = ["test"] \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt deleted file mode 100644 index 0880df1..0000000 --- a/requirements/base.txt +++ /dev/null @@ -1,4 +0,0 @@ --e ./jmbase --e ./jmbitcoin --e ./jmclient --e ./jmdaemon diff --git a/requirements/gui.txt b/requirements/gui.txt deleted file mode 100644 index 37aa1d7..0000000 --- a/requirements/gui.txt +++ /dev/null @@ -1,9 +0,0 @@ --r base.txt -pywin32; platform_system == "Windows" -# https://bugreports.qt.io/browse/QTBUG-88688 -PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0 -PyQt5!=5.15.0,!=5.15.1,!=5.15.2,!=6.0 -qrcode[pil]==7.3.1 -https://github.com/sunu/qt5reactor/archive/58410aaead2185e9917ae9cac9c50fe7b70e4a60.zip#egg=qt5reactor - --e ./jmqtui \ No newline at end of file diff --git a/requirements/testing.txt b/requirements/testing.txt deleted file mode 100644 index 21496d6..0000000 --- a/requirements/testing.txt +++ /dev/null @@ -1,11 +0,0 @@ --r base.txt -# matplotlib -# numpy -pexpect -coverage==5.2.1 -pytest==6.2.5 -pytest-cov>=2.4.0,<2.6 -python-coveralls -mock -flake8 -freezegun diff --git a/setup.cfg b/setup.cfg index d9da472..23f61fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,10 @@ -# content of pytest.ini -[tool:pytest] -testpaths = jmbitcoin jmclient jmbase jmdaemon test - [flake8] exclude = # defaults .svn,CVS,.bzr,.hg,.git,__pycache__,.tox, # lots of "unused imports" __init__.py + jmqtui max-line-length = 79 diff --git a/setupall.py b/setupall.py deleted file mode 100644 index 0dcd32a..0000000 --- a/setupall.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -import sys, os, subprocess - -"""A script to install in one of 3 modes: -(a) daemon - installs jmbase, jmdaemon -(b) client-only - installs jmbase, jmclient -(c) client-bitcoin - installs jmbase, jmclient, jmbitcoin -(d) all - installs jmbase, jmclient, jmbitcoin, jmdaemon -(e) develop - installs jmbase, jmclient, jmbitcoin, jmdaemon linked to the source directoy - -Note that b and c are distinct mainly due to the fact that -the latter requires the secp256k1 (libsecp256k1 via the secp256k1-py binding), -which is something that would be an annoyance if you don't need it (wallets). -While only (a) has a similarly annoying dependency on libnacl as the binding -to libsodium. -All modes require and install twisted. -""" - -if sys.version_info < (3, 7): - raise RuntimeError("This package requres Python 3.7+") - -def help(): - print("Usage: python setupall.py \n" - "Mode is one of:\n" - "`--all` - for the full joinmarket package with secp256k1\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\n" - "`--develop` - uses the local code for all packages (does not install to site-packages)." - ) - sys.exit(2) - -if len(sys.argv) != 2: - help() - -curdir = os.getcwd() - -mode = sys.argv[1] - -packages = {"--all": ["jmbase", "jmbitcoin", "jmclient", "jmdaemon"], - "--daemon": ["jmbase", "jmdaemon"], - "--client-only": ["jmbase", "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) - - cmd = ['pip', 'install', '--upgrade'] - if mode == "--develop": - cmd.append('-e') - cmd.append('.') - - p = subprocess.Popen(cmd, cwd=dirtorun) - p.wait() diff --git a/jmbase/jmbase/__init__.py b/src/jmbase/__init__.py similarity index 100% rename from jmbase/jmbase/__init__.py rename to src/jmbase/__init__.py diff --git a/jmbase/jmbase/arguments.py b/src/jmbase/arguments.py similarity index 100% rename from jmbase/jmbase/arguments.py rename to src/jmbase/arguments.py diff --git a/jmbase/jmbase/bigstring.py b/src/jmbase/bigstring.py similarity index 100% rename from jmbase/jmbase/bigstring.py rename to src/jmbase/bigstring.py diff --git a/jmbase/jmbase/bytesprod.py b/src/jmbase/bytesprod.py similarity index 100% rename from jmbase/jmbase/bytesprod.py rename to src/jmbase/bytesprod.py diff --git a/jmbase/jmbase/commands.py b/src/jmbase/commands.py similarity index 100% rename from jmbase/jmbase/commands.py rename to src/jmbase/commands.py diff --git a/jmbase/jmbase/crypto.py b/src/jmbase/crypto.py similarity index 100% rename from jmbase/jmbase/crypto.py rename to src/jmbase/crypto.py diff --git a/jmbase/jmbase/proof_of_work.py b/src/jmbase/proof_of_work.py similarity index 100% rename from jmbase/jmbase/proof_of_work.py rename to src/jmbase/proof_of_work.py diff --git a/jmbase/jmbase/support.py b/src/jmbase/support.py similarity index 100% rename from jmbase/jmbase/support.py rename to src/jmbase/support.py diff --git a/jmbase/jmbase/twisted_utils.py b/src/jmbase/twisted_utils.py similarity index 100% rename from jmbase/jmbase/twisted_utils.py rename to src/jmbase/twisted_utils.py diff --git a/jmbitcoin/jmbitcoin/__init__.py b/src/jmbitcoin/__init__.py similarity index 100% rename from jmbitcoin/jmbitcoin/__init__.py rename to src/jmbitcoin/__init__.py diff --git a/jmbitcoin/jmbitcoin/amount.py b/src/jmbitcoin/amount.py similarity index 100% rename from jmbitcoin/jmbitcoin/amount.py rename to src/jmbitcoin/amount.py diff --git a/jmbitcoin/jmbitcoin/bip21.py b/src/jmbitcoin/bip21.py similarity index 100% rename from jmbitcoin/jmbitcoin/bip21.py rename to src/jmbitcoin/bip21.py diff --git a/jmbitcoin/jmbitcoin/blocks.py b/src/jmbitcoin/blocks.py similarity index 100% rename from jmbitcoin/jmbitcoin/blocks.py rename to src/jmbitcoin/blocks.py diff --git a/jmbitcoin/jmbitcoin/output_descriptors.py b/src/jmbitcoin/output_descriptors.py similarity index 100% rename from jmbitcoin/jmbitcoin/output_descriptors.py rename to src/jmbitcoin/output_descriptors.py diff --git a/jmbitcoin/jmbitcoin/secp256k1_deterministic.py b/src/jmbitcoin/secp256k1_deterministic.py similarity index 100% rename from jmbitcoin/jmbitcoin/secp256k1_deterministic.py rename to src/jmbitcoin/secp256k1_deterministic.py diff --git a/jmbitcoin/jmbitcoin/secp256k1_ecies.py b/src/jmbitcoin/secp256k1_ecies.py similarity index 100% rename from jmbitcoin/jmbitcoin/secp256k1_ecies.py rename to src/jmbitcoin/secp256k1_ecies.py diff --git a/jmbitcoin/jmbitcoin/secp256k1_main.py b/src/jmbitcoin/secp256k1_main.py similarity index 100% rename from jmbitcoin/jmbitcoin/secp256k1_main.py rename to src/jmbitcoin/secp256k1_main.py diff --git a/jmbitcoin/jmbitcoin/secp256k1_transaction.py b/src/jmbitcoin/secp256k1_transaction.py similarity index 100% rename from jmbitcoin/jmbitcoin/secp256k1_transaction.py rename to src/jmbitcoin/secp256k1_transaction.py diff --git a/jmbitcoin/jmbitcoin/snicker.py b/src/jmbitcoin/snicker.py similarity index 100% rename from jmbitcoin/jmbitcoin/snicker.py rename to src/jmbitcoin/snicker.py diff --git a/jmclient/jmclient/__init__.py b/src/jmclient/__init__.py similarity index 100% rename from jmclient/jmclient/__init__.py rename to src/jmclient/__init__.py diff --git a/jmclient/jmclient/auth.py b/src/jmclient/auth.py similarity index 100% rename from jmclient/jmclient/auth.py rename to src/jmclient/auth.py diff --git a/jmclient/jmclient/blockchaininterface.py b/src/jmclient/blockchaininterface.py similarity index 100% rename from jmclient/jmclient/blockchaininterface.py rename to src/jmclient/blockchaininterface.py diff --git a/jmclient/jmclient/bond_calc.py b/src/jmclient/bond_calc.py similarity index 100% rename from jmclient/jmclient/bond_calc.py rename to src/jmclient/bond_calc.py diff --git a/jmclient/jmclient/cli_options.py b/src/jmclient/cli_options.py similarity index 100% rename from jmclient/jmclient/cli_options.py rename to src/jmclient/cli_options.py diff --git a/jmclient/jmclient/client_protocol.py b/src/jmclient/client_protocol.py similarity index 100% rename from jmclient/jmclient/client_protocol.py rename to src/jmclient/client_protocol.py diff --git a/jmclient/jmclient/commitment_utils.py b/src/jmclient/commitment_utils.py similarity index 100% rename from jmclient/jmclient/commitment_utils.py rename to src/jmclient/commitment_utils.py diff --git a/jmclient/jmclient/configure.py b/src/jmclient/configure.py similarity index 100% rename from jmclient/jmclient/configure.py rename to src/jmclient/configure.py diff --git a/jmclient/jmclient/cryptoengine.py b/src/jmclient/cryptoengine.py similarity index 100% rename from jmclient/jmclient/cryptoengine.py rename to src/jmclient/cryptoengine.py diff --git a/jmclient/jmclient/fidelity_bond.py b/src/jmclient/fidelity_bond.py similarity index 100% rename from jmclient/jmclient/fidelity_bond.py rename to src/jmclient/fidelity_bond.py diff --git a/jmclient/jmclient/jsonrpc.py b/src/jmclient/jsonrpc.py similarity index 100% rename from jmclient/jmclient/jsonrpc.py rename to src/jmclient/jsonrpc.py diff --git a/jmclient/jmclient/maker.py b/src/jmclient/maker.py similarity index 100% rename from jmclient/jmclient/maker.py rename to src/jmclient/maker.py diff --git a/jmclient/jmclient/old_mnemonic.py b/src/jmclient/old_mnemonic.py similarity index 100% rename from jmclient/jmclient/old_mnemonic.py rename to src/jmclient/old_mnemonic.py diff --git a/jmclient/jmclient/output.py b/src/jmclient/output.py similarity index 100% rename from jmclient/jmclient/output.py rename to src/jmclient/output.py diff --git a/jmclient/jmclient/payjoin.py b/src/jmclient/payjoin.py similarity index 100% rename from jmclient/jmclient/payjoin.py rename to src/jmclient/payjoin.py diff --git a/jmclient/jmclient/podle.py b/src/jmclient/podle.py similarity index 100% rename from jmclient/jmclient/podle.py rename to src/jmclient/podle.py diff --git a/jmclient/jmclient/schedule.py b/src/jmclient/schedule.py similarity index 100% rename from jmclient/jmclient/schedule.py rename to src/jmclient/schedule.py diff --git a/jmclient/jmclient/snicker_receiver.py b/src/jmclient/snicker_receiver.py similarity index 100% rename from jmclient/jmclient/snicker_receiver.py rename to src/jmclient/snicker_receiver.py diff --git a/jmclient/jmclient/storage.py b/src/jmclient/storage.py similarity index 100% rename from jmclient/jmclient/storage.py rename to src/jmclient/storage.py diff --git a/jmclient/jmclient/support.py b/src/jmclient/support.py similarity index 100% rename from jmclient/jmclient/support.py rename to src/jmclient/support.py diff --git a/jmclient/jmclient/taker.py b/src/jmclient/taker.py similarity index 100% rename from jmclient/jmclient/taker.py rename to src/jmclient/taker.py diff --git a/jmclient/jmclient/taker_utils.py b/src/jmclient/taker_utils.py similarity index 100% rename from jmclient/jmclient/taker_utils.py rename to src/jmclient/taker_utils.py diff --git a/jmclient/jmclient/wallet.py b/src/jmclient/wallet.py similarity index 100% rename from jmclient/jmclient/wallet.py rename to src/jmclient/wallet.py diff --git a/jmclient/jmclient/wallet_rpc.py b/src/jmclient/wallet_rpc.py similarity index 100% rename from jmclient/jmclient/wallet_rpc.py rename to src/jmclient/wallet_rpc.py diff --git a/jmclient/jmclient/wallet_service.py b/src/jmclient/wallet_service.py similarity index 100% rename from jmclient/jmclient/wallet_service.py rename to src/jmclient/wallet_service.py diff --git a/jmclient/jmclient/wallet_utils.py b/src/jmclient/wallet_utils.py similarity index 100% rename from jmclient/jmclient/wallet_utils.py rename to src/jmclient/wallet_utils.py diff --git a/jmclient/jmclient/websocketserver.py b/src/jmclient/websocketserver.py similarity index 100% rename from jmclient/jmclient/websocketserver.py rename to src/jmclient/websocketserver.py diff --git a/jmclient/jmclient/yieldgenerator.py b/src/jmclient/yieldgenerator.py similarity index 100% rename from jmclient/jmclient/yieldgenerator.py rename to src/jmclient/yieldgenerator.py diff --git a/jmdaemon/jmdaemon/__init__.py b/src/jmdaemon/__init__.py similarity index 100% rename from jmdaemon/jmdaemon/__init__.py rename to src/jmdaemon/__init__.py diff --git a/jmdaemon/jmdaemon/daemon_protocol.py b/src/jmdaemon/daemon_protocol.py similarity index 100% rename from jmdaemon/jmdaemon/daemon_protocol.py rename to src/jmdaemon/daemon_protocol.py diff --git a/jmdaemon/jmdaemon/enc_wrapper.py b/src/jmdaemon/enc_wrapper.py similarity index 100% rename from jmdaemon/jmdaemon/enc_wrapper.py rename to src/jmdaemon/enc_wrapper.py diff --git a/jmdaemon/jmdaemon/fidelity_bond_sanity_check.py b/src/jmdaemon/fidelity_bond_sanity_check.py similarity index 100% rename from jmdaemon/jmdaemon/fidelity_bond_sanity_check.py rename to src/jmdaemon/fidelity_bond_sanity_check.py diff --git a/jmdaemon/jmdaemon/irc.py b/src/jmdaemon/irc.py similarity index 100% rename from jmdaemon/jmdaemon/irc.py rename to src/jmdaemon/irc.py diff --git a/jmdaemon/jmdaemon/message_channel.py b/src/jmdaemon/message_channel.py similarity index 100% rename from jmdaemon/jmdaemon/message_channel.py rename to src/jmdaemon/message_channel.py diff --git a/jmdaemon/jmdaemon/onionmc.py b/src/jmdaemon/onionmc.py similarity index 100% rename from jmdaemon/jmdaemon/onionmc.py rename to src/jmdaemon/onionmc.py diff --git a/jmdaemon/jmdaemon/orderbookwatch.py b/src/jmdaemon/orderbookwatch.py similarity index 100% rename from jmdaemon/jmdaemon/orderbookwatch.py rename to src/jmdaemon/orderbookwatch.py diff --git a/jmdaemon/jmdaemon/protocol.py b/src/jmdaemon/protocol.py similarity index 100% rename from jmdaemon/jmdaemon/protocol.py rename to src/jmdaemon/protocol.py diff --git a/jmqtui/jmqtui/__init__.py b/src/jmqtui/__init__.py similarity index 100% rename from jmqtui/jmqtui/__init__.py rename to src/jmqtui/__init__.py diff --git a/src/jmqtui/_compile.py b/src/jmqtui/_compile.py new file mode 100644 index 0000000..278c1bc --- /dev/null +++ b/src/jmqtui/_compile.py @@ -0,0 +1,7 @@ +import os + +# The following command should be executed whenever `open_wallet_dialog.ui` is updated. +# `gui-dev` dependencies must be installed prior to execution. + +def compile_ui(): + os.system('pyside2-uic jmqtui/open_wallet_dialog.ui -o jmqtui/open_wallet_dialog.py') diff --git a/jmqtui/jmqtui/open_wallet_dialog.py b/src/jmqtui/open_wallet_dialog.py similarity index 100% rename from jmqtui/jmqtui/open_wallet_dialog.py rename to src/jmqtui/open_wallet_dialog.py diff --git a/jmqtui/jmqtui/open_wallet_dialog.ui b/src/jmqtui/open_wallet_dialog.ui similarity index 100% rename from jmqtui/jmqtui/open_wallet_dialog.ui rename to src/jmqtui/open_wallet_dialog.ui diff --git a/jmbase/test/test_base_support.py b/test/jmbase/test_base_support.py similarity index 100% rename from jmbase/test/test_base_support.py rename to test/jmbase/test_base_support.py diff --git a/jmbase/test/test_commands.py b/test/jmbase/test_commands.py similarity index 100% rename from jmbase/test/test_commands.py rename to test/jmbase/test_commands.py diff --git a/jmbitcoin/test/base58_keys_invalid.json b/test/jmbitcoin/base58_keys_invalid.json similarity index 100% rename from jmbitcoin/test/base58_keys_invalid.json rename to test/jmbitcoin/base58_keys_invalid.json diff --git a/jmbitcoin/test/base58_keys_valid.json b/test/jmbitcoin/base58_keys_valid.json similarity index 100% rename from jmbitcoin/test/base58_keys_valid.json rename to test/jmbitcoin/base58_keys_valid.json diff --git a/jmbitcoin/test/ecc_sigs_rfc6979_valid.json b/test/jmbitcoin/ecc_sigs_rfc6979_valid.json similarity index 100% rename from jmbitcoin/test/ecc_sigs_rfc6979_valid.json rename to test/jmbitcoin/ecc_sigs_rfc6979_valid.json diff --git a/jmbitcoin/test/test_amounts.py b/test/jmbitcoin/test_amounts.py similarity index 100% rename from jmbitcoin/test/test_amounts.py rename to test/jmbitcoin/test_amounts.py diff --git a/jmbitcoin/test/test_bip21.py b/test/jmbitcoin/test_bip21.py similarity index 100% rename from jmbitcoin/test/test_bip21.py rename to test/jmbitcoin/test_bip21.py diff --git a/jmbitcoin/test/test_bip32.py b/test/jmbitcoin/test_bip32.py similarity index 100% rename from jmbitcoin/test/test_bip32.py rename to test/jmbitcoin/test_bip32.py diff --git a/jmbitcoin/test/test_btc_snicker.py b/test/jmbitcoin/test_btc_snicker.py similarity index 100% rename from jmbitcoin/test/test_btc_snicker.py rename to test/jmbitcoin/test_btc_snicker.py diff --git a/jmbitcoin/test/test_ecc_signing.py b/test/jmbitcoin/test_ecc_signing.py similarity index 100% rename from jmbitcoin/test/test_ecc_signing.py rename to test/jmbitcoin/test_ecc_signing.py diff --git a/jmbitcoin/test/test_ecdh.py b/test/jmbitcoin/test_ecdh.py similarity index 100% rename from jmbitcoin/test/test_ecdh.py rename to test/jmbitcoin/test_ecdh.py diff --git a/jmbitcoin/test/test_ecies.py b/test/jmbitcoin/test_ecies.py similarity index 100% rename from jmbitcoin/test/test_ecies.py rename to test/jmbitcoin/test_ecies.py diff --git a/jmbitcoin/test/test_output_descriptors.py b/test/jmbitcoin/test_output_descriptors.py similarity index 100% rename from jmbitcoin/test/test_output_descriptors.py rename to test/jmbitcoin/test_output_descriptors.py diff --git a/jmbitcoin/test/test_tx_signing.py b/test/jmbitcoin/test_tx_signing.py similarity index 100% rename from jmbitcoin/test/test_tx_signing.py rename to test/jmbitcoin/test_tx_signing.py diff --git a/jmbitcoin/test/tx_valid.json b/test/jmbitcoin/tx_valid.json similarity index 100% rename from jmbitcoin/test/tx_valid.json rename to test/jmbitcoin/tx_valid.json diff --git a/jmclient/test/base58_keys_invalid.json b/test/jmclient/base58_keys_invalid.json similarity index 100% rename from jmclient/test/base58_keys_invalid.json rename to test/jmclient/base58_keys_invalid.json diff --git a/jmclient/test/base58_keys_valid.json b/test/jmclient/base58_keys_valid.json similarity index 100% rename from jmclient/test/base58_keys_valid.json rename to test/jmclient/base58_keys_valid.json diff --git a/jmclient/test/bip341_wallet_test_vectors.json b/test/jmclient/bip341_wallet_test_vectors.json similarity index 100% rename from jmclient/test/bip341_wallet_test_vectors.json rename to test/jmclient/bip341_wallet_test_vectors.json diff --git a/jmclient/test/bip39vectors.json b/test/jmclient/bip39vectors.json similarity index 100% rename from jmclient/test/bip39vectors.json rename to test/jmclient/bip39vectors.json diff --git a/jmclient/test/commontest.py b/test/jmclient/commontest.py similarity index 100% rename from jmclient/test/commontest.py rename to test/jmclient/commontest.py diff --git a/jmclient/test/taker_test_data.py b/test/jmclient/taker_test_data.py similarity index 100% rename from jmclient/test/taker_test_data.py rename to test/jmclient/taker_test_data.py diff --git a/jmclient/test/test_argon2.py b/test/jmclient/test_argon2.py similarity index 100% rename from jmclient/test/test_argon2.py rename to test/jmclient/test_argon2.py diff --git a/jmclient/test/test_auth.py b/test/jmclient/test_auth.py similarity index 100% rename from jmclient/test/test_auth.py rename to test/jmclient/test_auth.py diff --git a/jmclient/test/test_blockchaininterface.py b/test/jmclient/test_blockchaininterface.py similarity index 100% rename from jmclient/test/test_blockchaininterface.py rename to test/jmclient/test_blockchaininterface.py diff --git a/jmclient/test/test_bond_calc.py b/test/jmclient/test_bond_calc.py similarity index 100% rename from jmclient/test/test_bond_calc.py rename to test/jmclient/test_bond_calc.py diff --git a/jmclient/test/test_client_protocol.py b/test/jmclient/test_client_protocol.py similarity index 100% rename from jmclient/test/test_client_protocol.py rename to test/jmclient/test_client_protocol.py diff --git a/jmclient/test/test_coinjoin.py b/test/jmclient/test_coinjoin.py similarity index 100% rename from jmclient/test/test_coinjoin.py rename to test/jmclient/test_coinjoin.py diff --git a/jmclient/test/test_commitment_utils.py b/test/jmclient/test_commitment_utils.py similarity index 100% rename from jmclient/test/test_commitment_utils.py rename to test/jmclient/test_commitment_utils.py diff --git a/jmclient/test/test_configure.py b/test/jmclient/test_configure.py similarity index 100% rename from jmclient/test/test_configure.py rename to test/jmclient/test_configure.py diff --git a/jmclient/test/test_core_nohistory_sync.py b/test/jmclient/test_core_nohistory_sync.py similarity index 100% rename from jmclient/test/test_core_nohistory_sync.py rename to test/jmclient/test_core_nohistory_sync.py diff --git a/jmclient/test/test_maker.py b/test/jmclient/test_maker.py similarity index 100% rename from jmclient/test/test_maker.py rename to test/jmclient/test_maker.py diff --git a/jmclient/test/test_mnemonic.py b/test/jmclient/test_mnemonic.py similarity index 100% rename from jmclient/test/test_mnemonic.py rename to test/jmclient/test_mnemonic.py diff --git a/jmclient/test/test_payjoin.py b/test/jmclient/test_payjoin.py similarity index 100% rename from jmclient/test/test_payjoin.py rename to test/jmclient/test_payjoin.py diff --git a/jmclient/test/test_podle.py b/test/jmclient/test_podle.py similarity index 100% rename from jmclient/test/test_podle.py rename to test/jmclient/test_podle.py diff --git a/jmclient/test/test_privkeys.py b/test/jmclient/test_privkeys.py similarity index 100% rename from jmclient/test/test_privkeys.py rename to test/jmclient/test_privkeys.py diff --git a/jmclient/test/test_psbt_wallet.py b/test/jmclient/test_psbt_wallet.py similarity index 100% rename from jmclient/test/test_psbt_wallet.py rename to test/jmclient/test_psbt_wallet.py diff --git a/jmclient/test/test_schedule.py b/test/jmclient/test_schedule.py similarity index 100% rename from jmclient/test/test_schedule.py rename to test/jmclient/test_schedule.py diff --git a/jmclient/test/test_snicker.py b/test/jmclient/test_snicker.py similarity index 100% rename from jmclient/test/test_snicker.py rename to test/jmclient/test_snicker.py diff --git a/jmclient/test/test_storage.py b/test/jmclient/test_storage.py similarity index 100% rename from jmclient/test/test_storage.py rename to test/jmclient/test_storage.py diff --git a/jmclient/test/test_support.py b/test/jmclient/test_support.py similarity index 100% rename from jmclient/test/test_support.py rename to test/jmclient/test_support.py diff --git a/jmclient/test/test_taker.py b/test/jmclient/test_taker.py similarity index 100% rename from jmclient/test/test_taker.py rename to test/jmclient/test_taker.py diff --git a/jmclient/test/test_tx_creation.py b/test/jmclient/test_tx_creation.py similarity index 100% rename from jmclient/test/test_tx_creation.py rename to test/jmclient/test_tx_creation.py diff --git a/jmclient/test/test_utxomanager.py b/test/jmclient/test_utxomanager.py similarity index 100% rename from jmclient/test/test_utxomanager.py rename to test/jmclient/test_utxomanager.py diff --git a/jmclient/test/test_valid_addresses.py b/test/jmclient/test_valid_addresses.py similarity index 100% rename from jmclient/test/test_valid_addresses.py rename to test/jmclient/test_valid_addresses.py diff --git a/jmclient/test/test_wallet.py b/test/jmclient/test_wallet.py similarity index 100% rename from jmclient/test/test_wallet.py rename to test/jmclient/test_wallet.py diff --git a/jmclient/test/test_wallet_rpc.py b/test/jmclient/test_wallet_rpc.py similarity index 100% rename from jmclient/test/test_wallet_rpc.py rename to test/jmclient/test_wallet_rpc.py diff --git a/jmclient/test/test_wallets.py b/test/jmclient/test_wallets.py similarity index 100% rename from jmclient/test/test_wallets.py rename to test/jmclient/test_wallets.py diff --git a/jmclient/test/test_walletservice.py b/test/jmclient/test_walletservice.py similarity index 100% rename from jmclient/test/test_walletservice.py rename to test/jmclient/test_walletservice.py diff --git a/jmclient/test/test_walletutils.py b/test/jmclient/test_walletutils.py similarity index 100% rename from jmclient/test/test_walletutils.py rename to test/jmclient/test_walletutils.py diff --git a/jmclient/test/test_websocket.py b/test/jmclient/test_websocket.py similarity index 100% rename from jmclient/test/test_websocket.py rename to test/jmclient/test_websocket.py diff --git a/jmclient/test/test_yieldgenerator.py b/test/jmclient/test_yieldgenerator.py similarity index 100% rename from jmclient/test/test_yieldgenerator.py rename to test/jmclient/test_yieldgenerator.py diff --git a/jmdaemon/test/dummy_mc.py b/test/jmdaemon/dummy_mc.py similarity index 100% rename from jmdaemon/test/dummy_mc.py rename to test/jmdaemon/dummy_mc.py diff --git a/jmdaemon/test/msgdata.py b/test/jmdaemon/msgdata.py similarity index 100% rename from jmdaemon/test/msgdata.py rename to test/jmdaemon/msgdata.py diff --git a/jmdaemon/test/test_daemon_protocol.py b/test/jmdaemon/test_daemon_protocol.py similarity index 100% rename from jmdaemon/test/test_daemon_protocol.py rename to test/jmdaemon/test_daemon_protocol.py diff --git a/jmdaemon/test/test_enc_wrapper.py b/test/jmdaemon/test_enc_wrapper.py similarity index 100% rename from jmdaemon/test/test_enc_wrapper.py rename to test/jmdaemon/test_enc_wrapper.py diff --git a/jmdaemon/test/test_irc_messaging.py b/test/jmdaemon/test_irc_messaging.py similarity index 100% rename from jmdaemon/test/test_irc_messaging.py rename to test/jmdaemon/test_irc_messaging.py diff --git a/jmdaemon/test/test_message_channel.py b/test/jmdaemon/test_message_channel.py similarity index 100% rename from jmdaemon/test/test_message_channel.py rename to test/jmdaemon/test_message_channel.py diff --git a/jmdaemon/test/test_orderbookwatch.py b/test/jmdaemon/test_orderbookwatch.py similarity index 100% rename from jmdaemon/test/test_orderbookwatch.py rename to test/jmdaemon/test_orderbookwatch.py diff --git a/test/run_tests.sh b/test/run_tests.sh index a7f99d4..f138172 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -170,7 +170,6 @@ run_jm_tests () \`source ./jmvenv/bin/activate\`" return 1 fi - jm_requirements="requirements/testing.txt" jm_source="${VIRTUAL_ENV}/.." pushd "${jm_source}" || return 1 @@ -182,8 +181,8 @@ run_jm_tests () mkdir -p miniircd tar -xzf miniircd.tar.gz -C ./miniircd --strip-components=1 fi - if ! pip install -r "${jm_requirements}"; then - echo "Packages in '${jm_requirements}' could not be installed. Exiting." + if ! pip install -e .[test]; then + echo "Joinmarket could not be installed. Exiting." return 1 fi if [[ ! -L ./joinmarket.cfg && -e ./joinmarket.cfg ]]; then diff --git a/test/common.py b/test/unified/common.py similarity index 98% rename from test/common.py rename to test/unified/common.py index c48bc07..723a01a 100644 --- a/test/common.py +++ b/test/unified/common.py @@ -82,7 +82,7 @@ def make_wallets(n, Default Wallet constructor is joinmarket.Wallet, else use TestWallet, which takes a password parameter as in the list passwords. ''' - # FIXME: this is basically the same code as jmclient/test/commontest.py + # FIXME: this is basically the same code as test/jmclient/commontest.py if len(wallet_structures) != n: raise Exception("Number of wallets doesn't match wallet structures") if not fixed_seeds: diff --git a/test/payjoinclient.py b/test/unified/payjoinclient.py similarity index 100% rename from test/payjoinclient.py rename to test/unified/payjoinclient.py diff --git a/test/payjoinserver.py b/test/unified/payjoinserver.py similarity index 100% rename from test/payjoinserver.py rename to test/unified/payjoinserver.py diff --git a/test/test_bumpfee.py b/test/unified/test_bumpfee.py similarity index 100% rename from test/test_bumpfee.py rename to test/unified/test_bumpfee.py diff --git a/test/test_e2e_coinjoin.py b/test/unified/test_e2e_coinjoin.py similarity index 100% rename from test/test_e2e_coinjoin.py rename to test/unified/test_e2e_coinjoin.py diff --git a/test/test_segwit.py b/test/unified/test_segwit.py similarity index 100% rename from test/test_segwit.py rename to test/unified/test_segwit.py diff --git a/test/ygrunner.py b/test/unified/ygrunner.py similarity index 100% rename from test/ygrunner.py rename to test/unified/ygrunner.py