Browse Source

Sunsetting support for Python 2

master
Tim Akinbo 6 years ago committed by James Hilliard
parent
commit
8c21b04846
  1. 16
      .travis.yml
  2. 6
      README.md
  3. 25
      install.sh
  4. 34
      test/Dockerfiles/bionic-py2.Dockerfile
  5. 4
      test/Dockerfiles/centos7-py3.Dockerfile
  6. 35
      test/Dockerfiles/fedora27-py2.Dockerfile
  7. 37
      test/Dockerfiles/stretch-py2.Dockerfile
  8. 2
      test/Dockerfiles/stretch-py3.Dockerfile
  9. 37
      test/Dockerfiles/xenial-py2.Dockerfile
  10. 2
      test/Dockerfiles/xenial-py3.Dockerfile

16
.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:

6
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.

25
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] : "

34
test/Dockerfiles/bionic-py2.Dockerfile

@ -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

4
test/Dockerfiles/centos7-py2.Dockerfile → 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

35
test/Dockerfiles/fedora27-py2.Dockerfile

@ -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

37
test/Dockerfiles/stretch-py2.Dockerfile

@ -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

2
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

37
test/Dockerfiles/xenial-py2.Dockerfile

@ -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

2
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

Loading…
Cancel
Save