From 8c21b04846c0dacb42a78c693eb6f6866c132e7a Mon Sep 17 00:00:00 2001 From: Tim Akinbo <41004+takinbo@users.noreply.github.com> Date: Tue, 14 Jan 2020 18:55:00 +0000 Subject: [PATCH] Sunsetting support for Python 2 --- .travis.yml | 16 +------- README.md | 6 +-- install.sh | 25 ++++++------- test/Dockerfiles/bionic-py2.Dockerfile | 34 ----------------- ...-py2.Dockerfile => centos7-py3.Dockerfile} | 4 +- test/Dockerfiles/fedora27-py2.Dockerfile | 35 ------------------ test/Dockerfiles/stretch-py2.Dockerfile | 37 ------------------- test/Dockerfiles/stretch-py3.Dockerfile | 2 +- test/Dockerfiles/xenial-py2.Dockerfile | 37 ------------------- test/Dockerfiles/xenial-py3.Dockerfile | 2 +- 10 files changed, 20 insertions(+), 178 deletions(-) delete mode 100755 test/Dockerfiles/bionic-py2.Dockerfile rename test/Dockerfiles/{centos7-py2.Dockerfile => centos7-py3.Dockerfile} (89%) delete mode 100755 test/Dockerfiles/fedora27-py2.Dockerfile delete mode 100755 test/Dockerfiles/stretch-py2.Dockerfile delete mode 100755 test/Dockerfiles/xenial-py2.Dockerfile diff --git a/.travis.yml b/.travis.yml index 5a63016..7af0321 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,30 +23,18 @@ matrix: - python3-pip - python-virtualenv - libsodium18 - - os: linux - services: docker - env: DOCKER_IMG_JM=xenial-py2 - os: linux services: docker env: DOCKER_IMG_JM=xenial-py3 - - os: linux - services: docker - env: DOCKER_IMG_JM=bionic-py2 - os: linux services: docker env: DOCKER_IMG_JM=bionic-py3 - - os: linux - services: docker - env: DOCKER_IMG_JM=stretch-py2 - os: linux services: docker env: DOCKER_IMG_JM=stretch-py3 - os: linux services: docker - env: DOCKER_IMG_JM=centos7-py2 - - os: linux - services: docker - env: DOCKER_IMG_JM=fedora27-py2 + env: DOCKER_IMG_JM=centos7-py3 - os: linux services: docker env: DOCKER_IMG_JM=fedora27-py3 @@ -68,7 +56,7 @@ install: - mkdir -p "$HOME/downloads" - mkdir -p "$TRAVIS_BUILD_DIR/deps/cache/" - find "$HOME/downloads" -type f -exec cp -v {} "$TRAVIS_BUILD_DIR/deps/cache/" \; - - on_host do_on linux ./install.sh --develop --python=python3 --with-qt + - on_host do_on linux ./install.sh --develop --with-qt - on_host do_on osx virtualenv --python=python3 jmvenv - on_host find "$TRAVIS_BUILD_DIR/deps/cache/" -type f -exec cp -v {} "$HOME/downloads/" \; before_script: diff --git a/README.md b/README.md index 8341edf..d0eb9d9 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ or check the signature in git if you install that way using `git log --show-sign source jmvenv/bin/activate cd scripts -(You can add `-p python2` if you want to use Python2. You can also add `--develop` as an extra flag to `install.sh` to make the Joinmarket code editable in-place.) +(You can add `--develop` as an extra flag to `install.sh` to make the Joinmarket code editable in-place.) You can optionally install a Qt GUI application, you will be prompted to choose this during installation. -Do note, Python 2 is incompatible with the Qt GUI. +Do note, Python 2 is no longer supported as it has reached its end of life. You should now be able to run the scripts like `python wallet-tool.py` etc., just as you did in the previous Joinmarket version. @@ -69,8 +69,6 @@ If you want to use the PayJoin feature to pay/receive money to/from another Join ### Joinmarket-Qt Provides single join and multi-join/tumbler functionality (i.e. "Taker") only, in a GUI. -NOTE: This is currently **only available for Python3**, not Python2 (due to bugs in the PySide2 Python2 implementation). -It's possible but unlikely that the Python2 version will be fixed, but in any case Python2 will be deprecated at some point. If binaries are built, they will be gpg signed and announced on the Releases page. diff --git a/install.sh b/install.sh index e19e389..320d332 100755 --- a/install.sh +++ b/install.sh @@ -20,14 +20,17 @@ deps_install () 'automake' \ 'pkg-config' \ 'libtool' \ - 'libgmp-dev' ) + 'libgmp-dev' \ + 'python3-dev' \ + 'python3-pip' ) + + if ! is_python3; then + echo "Python 2 is no longer supported. Please use a compatible Python 3 version." + return 1 + fi if [[ ${install_os} == 'debian' ]]; then - if is_python3; then - deb_deps_install "${common_deps[@]} python3-dev python3-pip" - else - deb_deps_install "${common_deps[@]} python-dev python-pip" - fi + deb_deps_install "${common_deps[@]}" return "$?" else echo "OS can not be determined. Trying to build." @@ -304,8 +307,8 @@ Usage: "${0}" [options] Options: --develop code remains editable in place (currently always enabled) ---python, -p python version (default: python3) ---with-qt build the Qt GUI (incompatible with python2) +--python, -p python version (only python3 versions are supported) +--with-qt build the Qt GUI --without-qt don't build the Qt GUI " return 1 @@ -314,11 +317,7 @@ Options: shift done - if [[ ${with_qt} == 1 ]] && [[ ${python} == python2* ]]; then - echo "ERROR: Joinmarket-Qt is currently only available for Python 3 - Use the flag '--python=python3' to enable a python3 install." - return 1 - elif [[ ${with_qt} == '' ]] && [[ ${python} == python3* ]]; then + if [[ ${with_qt} == '' ]]; then read -p " INFO: Joinmarket-Qt for GUI Taker and Tumbler modes is available. Install Qt dependencies (~160mb) ? [y|n] : " diff --git a/test/Dockerfiles/bionic-py2.Dockerfile b/test/Dockerfiles/bionic-py2.Dockerfile deleted file mode 100755 index d90872e..0000000 --- a/test/Dockerfiles/bionic-py2.Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM ubuntu:bionic -SHELL ["/bin/bash", "-c"] - -# dependencies -RUN apt-get update -RUN apt-get install -y \ - python-dev python-pip python-virtualenv libsodium23 - -# curl is a better tool -RUN apt-get install -y curl - -RUN useradd --home-dir /home/chaum --create-home --shell /bin/bash --skel /etc/skel/ chaum -ARG core_version -ARG core_dist -ARG repo_name -RUN mkdir -p /home/chaum/${repo_name} -COPY ${repo_name} /home/chaum/${repo_name} -RUN ls -la /home/chaum -RUN chown -R chaum:chaum /home/chaum/${repo_name} -USER chaum - -# copy node software from the host and install -WORKDIR /home/chaum -RUN ls -la . -RUN ls -la ${repo_name} -RUN ls -la ${repo_name}/deps/cache -RUN tar xaf ./${repo_name}/deps/cache/${core_dist} -C /home/chaum -ENV PATH "/home/chaum/bitcoin-${core_version}/bin:${PATH}" -RUN bitcoind --version | head -1 - -# install script -WORKDIR ${repo_name} -RUN virtualenv --python=python2 jmvenv -RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/centos7-py2.Dockerfile b/test/Dockerfiles/centos7-py3.Dockerfile similarity index 89% rename from test/Dockerfiles/centos7-py2.Dockerfile rename to test/Dockerfiles/centos7-py3.Dockerfile index d3ad0fe..94b5776 100755 --- a/test/Dockerfiles/centos7-py2.Dockerfile +++ b/test/Dockerfiles/centos7-py3.Dockerfile @@ -6,7 +6,7 @@ RUN yum -y groups install 'Development tools' RUN yum -y install epel-release && \ yum -y update RUN yum -y install \ - python-devel python2-pip python-virtualenv libsodium + python3-devel python3-pip python-virtualenv libsodium RUN useradd --home-dir /home/chaum --create-home --shell /bin/bash --skel /etc/skel/ chaum ARG core_version @@ -29,5 +29,5 @@ RUN bitcoind --version | head -1 # install script WORKDIR ${repo_name} -RUN virtualenv --python=python2 jmvenv +RUN virtualenv --python=python3 jmvenv RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/fedora27-py2.Dockerfile b/test/Dockerfiles/fedora27-py2.Dockerfile deleted file mode 100755 index d7a6f17..0000000 --- a/test/Dockerfiles/fedora27-py2.Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM fedora:27 -SHELL ["/bin/bash", "-c"] - -# dependencies -RUN dnf -y groups install 'Development tools' -RUN dnf -y install \ - python-devel python-pip python2-virtualenv libsodium - -# needed for build time -# https://stackoverflow.com/questions/34624428/g-error-usr-lib-rpm-redhat-redhat-hardened-cc1-no-such-file-or-directory -RUN dnf -y install redhat-rpm-config - -RUN useradd --home-dir /home/chaum --create-home --shell /bin/bash --skel /etc/skel/ chaum -ARG core_version -ARG core_dist -ARG repo_name -RUN mkdir -p /home/chaum/${repo_name} -COPY ${repo_name} /home/chaum/${repo_name} -RUN ls -la /home/chaum -RUN chown -R chaum:chaum /home/chaum/${repo_name} -USER chaum - -# copy node software from the host and install -WORKDIR /home/chaum -RUN ls -la . -RUN ls -la ${repo_name} -RUN ls -la ${repo_name}/deps/cache -RUN tar xaf ./${repo_name}/deps/cache/${core_dist} -C /home/chaum -ENV PATH "/home/chaum/bitcoin-${core_version}/bin:${PATH}" -RUN bitcoind --version | head -1 - -# install script -WORKDIR ${repo_name} -RUN virtualenv --python=python2 jmvenv -RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/stretch-py2.Dockerfile b/test/Dockerfiles/stretch-py2.Dockerfile deleted file mode 100755 index 11d2ef9..0000000 --- a/test/Dockerfiles/stretch-py2.Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM debian:stretch -SHELL ["/bin/bash", "-c"] - -# dependencies -RUN apt-get update -RUN apt-get install -y build-essential -RUN apt-get install -y \ - automake pkg-config libtool libgmp-dev -RUN apt-get install -y \ - python-dev python-pip python-virtualenv python-qt4 python-sip - -# curl is a better tool -RUN apt-get install -y curl - -RUN useradd --home-dir /home/chaum --create-home --shell /bin/bash --skel /etc/skel/ chaum -ARG core_version -ARG core_dist -ARG repo_name -RUN mkdir -p /home/chaum/${repo_name} -COPY ${repo_name} /home/chaum/${repo_name} -RUN ls -la /home/chaum -RUN chown -R chaum:chaum /home/chaum/${repo_name} -USER chaum - -# copy node software from the host and install -WORKDIR /home/chaum -RUN ls -la . -RUN ls -la ${repo_name} -RUN ls -la ${repo_name}/deps/cache -RUN tar xaf ./${repo_name}/deps/cache/${core_dist} -C /home/chaum -ENV PATH "/home/chaum/bitcoin-${core_version}/bin:${PATH}" -RUN bitcoind --version | head -1 - -# install script -WORKDIR ${repo_name} -RUN ./install.sh --python=python2 -RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/stretch-py3.Dockerfile b/test/Dockerfiles/stretch-py3.Dockerfile index 9ec21af..9b7b3b8 100755 --- a/test/Dockerfiles/stretch-py3.Dockerfile +++ b/test/Dockerfiles/stretch-py3.Dockerfile @@ -33,5 +33,5 @@ RUN bitcoind --version | head -1 # install script WORKDIR ${repo_name} -RUN ./install.sh --python=python3 --with-qt +RUN ./install.sh --with-qt RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/xenial-py2.Dockerfile b/test/Dockerfiles/xenial-py2.Dockerfile deleted file mode 100755 index 22e39a9..0000000 --- a/test/Dockerfiles/xenial-py2.Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM ubuntu:xenial -SHELL ["/bin/bash", "-c"] - -# dependencies -RUN apt-get update -RUN apt-get install -y build-essential -RUN apt-get install -y \ - automake pkg-config libtool libgmp-dev -RUN apt-get install -y \ - python-dev python-pip python-virtualenv python-qt4 python-sip - -# curl is a better tool -RUN apt-get install -y curl - -RUN useradd --home-dir /home/chaum --create-home --shell /bin/bash --skel /etc/skel/ chaum -ARG core_version -ARG core_dist -ARG repo_name -RUN mkdir -p /home/chaum/${repo_name} -COPY ${repo_name} /home/chaum/${repo_name} -RUN ls -la /home/chaum -RUN chown -R chaum:chaum /home/chaum/${repo_name} -USER chaum - -# copy node software from the host and install -WORKDIR /home/chaum -RUN ls -la . -RUN ls -la ${repo_name} -RUN ls -la ${repo_name}/deps/cache -RUN tar xaf ./${repo_name}/deps/cache/${core_dist} -C /home/chaum -ENV PATH "/home/chaum/bitcoin-${core_version}/bin:${PATH}" -RUN bitcoind --version | head -1 - -# install script -WORKDIR ${repo_name} -RUN ./install.sh --python=python2 -RUN source jmvenv/bin/activate && ./test/run_tests.sh diff --git a/test/Dockerfiles/xenial-py3.Dockerfile b/test/Dockerfiles/xenial-py3.Dockerfile index 8e568b8..226505d 100755 --- a/test/Dockerfiles/xenial-py3.Dockerfile +++ b/test/Dockerfiles/xenial-py3.Dockerfile @@ -33,5 +33,5 @@ RUN bitcoind --version | head -1 # install script WORKDIR ${repo_name} -RUN ./install.sh --python=python3 --with-qt +RUN ./install.sh --with-qt RUN source jmvenv/bin/activate && ./test/run_tests.sh