diff --git a/.travis.yml b/.travis.yml
index 211b7b8..6c0fcea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,4 +24,4 @@ before_script:
- sh -e /etc/init.d/xvfb start
script:
- - travis_wait docker run -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $TAG $COMMAND
+ - travis_wait 30 docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix $TAG $COMMAND
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ef461b4..3118210 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,2 +1,2 @@
# Change Log
-Moved to [src/CHANGELOG.md](src/CHANGELOG.md).
+Moved to [src/etherollapp/CHANGELOG.md](https://github.com/AndreMiras/EtherollApp/blob/develop/src/etherollapp/CHANGELOG.md).
diff --git a/Makefile b/Makefile
index b2e3586..407bb04 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,12 @@ ACTIVATE_PATH="$(VENV_NAME)/bin/activate"
PIP=`. $(ACTIVATE_PATH); which pip`
TOX=`which tox`
GARDEN=`. $(ACTIVATE_PATH); which garden`
-PYTHON="$(VENV_NAME)/bin/python"
+PYTHON_VERSION="python3.7"
+PYTHON=$(VENV_NAME)/bin/python
+ISORT=$(VENV_NAME)/bin/isort
+FLAKE8=$(VENV_NAME)/bin/flake8
+TWINE=`which twine`
+SOURCES=src/ setup.py
SYSTEM_DEPENDENCIES=python3-dev virtualenv build-essential libssl-dev \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
libffi-dev libgmp3-dev xclip xsel
@@ -13,12 +18,9 @@ OS=$(shell lsb_release -si)
all: system_dependencies virtualenv
virtualenv:
- test -d venv || virtualenv -p python3 venv
+ test -d venv || virtualenv -p $(PYTHON_VERSION) venv
. venv/bin/activate
- $(PIP) install Cython==0.26.1
- # downgrade to setuptools 37, see:
- # https://github.com/ethereum/pyethereum/pull/831
- $(PIP) install setuptools==37.0.0
+ $(PIP) install Cython==0.28.6
$(PIP) install --timeout 120 -r requirements.txt
$(GARDEN) install qrcode
@@ -27,12 +29,42 @@ ifeq ($(OS), Ubuntu)
sudo apt install --yes --no-install-recommends $(SYSTEM_DEPENDENCIES)
endif
-clean:
- rm -rf venv/ .tox/ .pytest_cache/
+run:
+ $(PYTHON) src/main.py
test:
$(TOX)
+lint/isort-check: virtualenv
+ $(ISORT) --check-only --recursive --diff $(SOURCES)
+
+lint/isort-fix: virtualenv
+ $(ISORT) --recursive $(SOURCES)
+
+lint/flake8: virtualenv
+ $(FLAKE8) $(SOURCES)
+
+lint: lint/isort-check lint/flake8
+
+release/clean:
+ rm -rf dist/ build/
+
+release/build: release/clean clean
+ $(PYTHON) setup.py sdist bdist_wheel
+ $(TWINE) check dist/*
+
+release/upload:
+ $(TWINE) upload dist/*
+
+clean:
+ py3clean src/
+ rm -rf .pytest_cache/
+ find . -type d -name "__pycache__" -exec rm -r {} +
+ find . -type d -name "*.egg-info" -exec rm -r {} +
+
+clean/venv: clean
+ rm -rf $(VENV_NAME) .tox/
+
uitest: virtualenv
. $(ACTIVATE_PATH) && \
- $(PYTHON) -m unittest discover --top-level-directory=src/ --start-directory=src/tests/ui/
+ $(PYTHON) -m unittest discover --top-level-directory=src/ --start-directory=src/etherollapp/tests/ui/
diff --git a/README.md b/README.md
index 834486d..c02dee9 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,12 @@
# EtherollApp
[![Build Status](https://secure.travis-ci.org/AndreMiras/EtherollApp.png?branch=develop)](http://travis-ci.org/AndreMiras/EtherollApp)
+[![PyPI version](https://badge.fury.io/py/EtherollApp.svg)](https://badge.fury.io/py/EtherollApp)
-
+
@@ -15,25 +16,17 @@ Built with Python, [Kivy](https://github.com/kivy/kivy) and love.
## Run
-```
-. venv/bin/activate
-./src/main.py
+```sh
+make run
```
## Install
-```
+```sh
make
```
## Test
-```
+```sh
make test
make uitest
```
-
-## Docker
-There's a [Dockerfile](Dockerfile) to build Linux dependencies and run tests.
-```
-docker build --tag=etheroll .
-docker run etheroll /bin/sh -c '. venv/bin/activate && make test'
-```
diff --git a/buildozer.spec b/buildozer.spec
index d6c3312..6777e47 100644
--- a/buildozer.spec
+++ b/buildozer.spec
@@ -33,7 +33,7 @@ source.exclude_dirs = python-for-android
# (str) Application versioning (method 2)
version.regex = __version__ = ['"](.*)['"]
-version.filename = %(source.dir)s/version.py
+version.filename = %(source.dir)s/etherollapp/version.py
# (list) Application requirements
# comma seperated e.g. requirements = sqlite3,kivy
@@ -56,11 +56,11 @@ requirements =
gevent,
hexbytes==0.1.0,
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.tar.gz,
- https://github.com/AndreMiras/KivyMD/archive/69f3e88.tar.gz,
+ https://github.com/AndreMiras/KivyMD/archive/20181106.tar.gz,
https://github.com/AndreMiras/pyetheroll/archive/884805b.tar.gz,
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.tar.gz,
idna==2.7,
- kivy==90c86f8,
+ Kivy==1.11.1,
lru-dict==1.1.5,
openssl,
oscpy==0.3.0,
@@ -70,7 +70,7 @@ requirements =
Pygments==2.2.0,
python3==3.7.1,
qrcode==6.0,
- raven==6.9.0,
+ raven==6.10.0,
requests==2.20.0,
requests-cache==0.4.13,
rlp==1.0.3,
@@ -100,7 +100,7 @@ orientation = portrait
# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY
-services = service:service/main.py
+services = service:etherollapp/service/main.py
#
# OSX Specific
@@ -202,10 +202,6 @@ android.blacklist_src = blacklist.txt
# bootstrap)
#android.gradle_dependencies =
-# (str) python-for-android branch to use, defaults to master
-#p4a.branch = stable
-p4a.branch = master
-
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
@@ -246,6 +242,12 @@ android.arch = armeabi-v7a
# Python for android (p4a) specific
#
+# (str) python-for-android fork to use, defaults to upstream (kivy)
+p4a.fork = kivy
+
+# (str) python-for-android branch to use, defaults to master
+p4a.branch = v2019.08.09
+
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
diff --git a/dockerfiles/Dockerfile-android b/dockerfiles/Dockerfile-android
index 501d24f..28174b8 100644
--- a/dockerfiles/Dockerfile-android
+++ b/dockerfiles/Dockerfile-android
@@ -14,9 +14,9 @@ ENV USER="user"
ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}" \
PATH="${HOME_DIR}/.local/bin:${PATH}"
-ENV DOCKERFILES_VERSION="master" \
+ENV DOCKERFILES_VERSION="develop" \
DOCKERFILES_URL="https://raw.githubusercontent.com/AndreMiras/dockerfiles"
-ENV MAKEFILES_URL="${DOCKERFILES_URL}/${DOCKERFILES_VERSION}/buildozer_android_new"
+ENV MAKEFILES_URL="${DOCKERFILES_URL}/${DOCKERFILES_VERSION}/buildozer_android"
# configure locale
@@ -28,15 +28,28 @@ ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
# install system dependencies (required to setup all the tools)
-RUN apt install -qq --yes --no-install-recommends \
- make curl ca-certificates xz-utils unzip openjdk-8-jdk sudo python-pip \
- python-setuptools
# install build dependencies (required to successfully build the project)
-# TODO: should this go to a Makefile instead so it can be shared/reused?
RUN apt install -qq --yes --no-install-recommends \
- python3.6 libpython3.6-dev python3-setuptools \
- autoconf automake libtool libltdl-dev libffi-dev bsdtar zip
+ autoconf \
+ automake \
+ bsdtar \
+ ca-certificates \
+ curl \
+ libffi-dev \
+ libltdl-dev \
+ libpython3.6-dev \
+ libtool \
+ make \
+ openjdk-8-jdk \
+ python2.7 \
+ python3.6 \
+ python3-pip \
+ python3-setuptools \
+ sudo \
+ unzip \
+ xz-utils \
+ zip
# prepare non root env
RUN useradd --create-home --shell /bin/bash ${USER}
@@ -51,7 +64,7 @@ WORKDIR ${WORK_DIR}
RUN curl --location --progress-bar ${MAKEFILES_URL}/buildozer.mk --output buildozer.mk
RUN make -f buildozer.mk
# enforces buildozer master (586152c) until next release
-RUN pip install --upgrade https://github.com/kivy/buildozer/archive/586152c.zip
+RUN pip3 install --upgrade https://github.com/kivy/buildozer/archive/586152c.zip
COPY . ${WORK_DIR}
# limits the amount of logs for Travis
diff --git a/dockerfiles/Dockerfile-linux b/dockerfiles/Dockerfile-linux
index 7fdc32b..47962ba 100644
--- a/dockerfiles/Dockerfile-linux
+++ b/dockerfiles/Dockerfile-linux
@@ -25,7 +25,7 @@ ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"
# install system dependencies
-RUN apt install --yes --no-install-recommends \
+RUN apt install -qq --yes --no-install-recommends \
build-essential \
git \
libsdl2-dev \
@@ -36,8 +36,8 @@ RUN apt install --yes --no-install-recommends \
lsb-release \
make \
pkg-config \
- python3 \
- python3-dev \
+ python3.7 \
+ python3.7-dev \
sudo \
tox \
virtualenv
diff --git a/docs/Release.md b/docs/Release.md
index f4bd696..6d374ca 100644
--- a/docs/Release.md
+++ b/docs/Release.md
@@ -10,8 +10,8 @@ Start the release with git flow:
```sh
git flow release start vYYYY.MMDD
```
-Now update the [CHANGELOG.md](/src/CHANGELOG.md) `[Unreleased]` section to match the new release version.
-Also update the `__version__` and `__version_code__` values from the [version.py](/src/version.py) file.
+Now update the [CHANGELOG.md](/src/etherollapp/CHANGELOG.md) `[Unreleased]` section to match the new release version.
+Also update the `__version__` and `__version_code__` values from the [version.py](/src/etherollapp/version.py) file.
Optionally already update the direct download link from the [README.md](/README.md).
Then commit and finish release.
```sh
diff --git a/docs/Troubleshoot.md b/docs/Troubleshoot.md
index aefadd9..c6c5bf4 100644
--- a/docs/Troubleshoot.md
+++ b/docs/Troubleshoot.md
@@ -87,22 +87,6 @@ to:
```
-Buildozer fails at copying APK to current directory:
-```
-IOError: [Errno 2] No such file or directory: u'/home/andre/workspace/EtherollApp/.buildozer/android/platform/build/dists/etheroll/build/outputs/apk/etheroll-debug.apk'
-```
-See https://github.com/AndreMiras/EtherollApp/issues/26
-To (dirty) workaround it, edit `~/.local/lib/python2.7/site-packages/buildozer/targets/android.py`
-and change:
-```
-if is_gradle_build:
-```
-by:
-```
-if not is_gradle_build:
-```
-
-
Uninstaling the app using adb:
```
buildozer android adb -- uninstall com.github.andremiras.etheroll
diff --git a/requirements.txt b/requirements.txt
index f206a76..cbadef9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,16 +3,15 @@ eth-utils==1.2.1
flake8
future
https://github.com/AndreMiras/garden.layoutmargin/archive/20180517.tar.gz#egg=layoutmargin
-https://github.com/AndreMiras/KivyMD/archive/69f3e88.tar.gz#egg=kivymd
+https://github.com/AndreMiras/KivyMD/archive/20181106.tar.gz#egg=kivymd
https://github.com/AndreMiras/pyetheroll/archive/884805b.tar.gz#egg=pyetheroll
https://github.com/corpetty/py-etherscan-api/archive/cb91fb3.tar.gz#egg=py-etherscan-api
-# Post 1.10.1 release
-https://github.com/kivy/kivy/archive/90c86f8.zip#egg=Kivy
+Kivy==1.11.1
isort
kivyunittest==0.1.8
oscpy==0.3.0
plyer==1.3.1
qrcode==6.0
-raven==6.9.0
+raven==6.10.0
requests-cache
web3==4.8.1
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..160eedf
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,60 @@
+import os
+
+from setuptools import find_namespace_packages, setup
+
+from src.etherollapp import version
+
+
+def read(fname):
+ with open(os.path.join(os.path.dirname(__file__), fname)) as f:
+ return f.read()
+
+
+# exposing the params so it can be imported
+setup_params = {
+ 'name': 'EtherollApp',
+ 'version': version.__version__,
+ 'description': (
+ 'Provably fair dice game running on the Ethereum blockchain'),
+ 'long_description': read('README.md'),
+ 'long_description_content_type': 'text/markdown',
+ 'author': 'Andre Miras',
+ 'url': 'https://github.com/AndreMiras/EtherollApp',
+ 'packages': find_namespace_packages(
+ where='src',
+ exclude=(
+ 'distutils',
+ 'python-for-android',
+ 'python-for-android.*',
+ ),
+ ),
+ 'package_data': {'': ('*.kv', '*.md')},
+ 'package_dir': {'': 'src'},
+ 'entry_points': {
+ 'console_scripts': (
+ 'etherollapp=etherollapp.etheroll.controller:main',
+ ),
+ },
+ 'python_requires': '>=3',
+ 'install_requires': (
+ 'eth-account<0.4.0',
+ 'eth-utils',
+ 'kivy-garden.kivymd',
+ 'layoutmargin',
+ 'opencv-python>=4',
+ 'oscpy',
+ 'pyetheroll',
+ 'raven',
+ 'requests-cache',
+ 'web3',
+ ),
+}
+
+
+def run_setup():
+ setup(**setup_params)
+
+
+# makes sure the setup doesn't run at import time
+if __name__ == '__main__':
+ run_setup()
diff --git a/src/distutils/README.md b/src/distutils/README.md
deleted file mode 100644
index 523061c..0000000
--- a/src/distutils/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# README
-
-This is being embedded in the repository because python3crystax seems to blacklist it.
diff --git a/src/distutils/version.py b/src/distutils/version.py
deleted file mode 100644
index 4984fad..0000000
--- a/src/distutils/version.py
+++ /dev/null
@@ -1,348 +0,0 @@
-# flake8: noqa
-# CrystaX seems to be blacklisting `distutils` module somehow.
-# Since LooseVersion is needed by web3 module, we embed our own.
-
-#
-# distutils/version.py
-#
-# Implements multiple version numbering conventions for the
-# Python Module Distribution Utilities.
-#
-# $Id$
-#
-
-"""Provides classes to represent module version numbers (one class for
-each style of version numbering). There are currently two such classes
-implemented: StrictVersion and LooseVersion.
-
-Every version number class implements the following interface:
- * the 'parse' method takes a string and parses it to some internal
- representation; if the string is an invalid version number,
- 'parse' raises a ValueError exception
- * the class constructor takes an optional string argument which,
- if supplied, is passed to 'parse'
- * __str__ reconstructs the string that was passed to 'parse' (or
- an equivalent string -- ie. one that will generate an equivalent
- version number instance)
- * __repr__ generates Python code to recreate the version number instance
- * _cmp compares the current instance with either another instance
- of the same class or a string (which will be parsed to an instance
- of the same class, thus must follow the same rules)
-"""
-
-import re
-
-
-class Version:
- """Abstract base class for version numbering classes. Just provides
- constructor (__init__) and reproducer (__repr__), because those
- seem to be the same for all version numbering classes; and route
- rich comparisons to _cmp.
- """
-
- def __init__ (self, vstring=None):
- if vstring:
- self.parse(vstring)
-
- def __repr__ (self):
- return "%s ('%s')" % (self.__class__.__name__, str(self))
-
- def __eq__(self, other):
- c = self._cmp(other)
- if c is NotImplemented:
- return c
- return c == 0
-
- def __lt__(self, other):
- c = self._cmp(other)
- if c is NotImplemented:
- return c
- return c < 0
-
- def __le__(self, other):
- c = self._cmp(other)
- if c is NotImplemented:
- return c
- return c <= 0
-
- def __gt__(self, other):
- c = self._cmp(other)
- if c is NotImplemented:
- return c
- return c > 0
-
- def __ge__(self, other):
- c = self._cmp(other)
- if c is NotImplemented:
- return c
- return c >= 0
-
-
-# Interface for version-number classes -- must be implemented
-# by the following classes (the concrete ones -- Version should
-# be treated as an abstract class).
-# __init__ (string) - create and take same action as 'parse'
-# (string parameter is optional)
-# parse (string) - convert a string representation to whatever
-# internal representation is appropriate for
-# this style of version numbering
-# __str__ (self) - convert back to a string; should be very similar
-# (if not identical to) the string supplied to parse
-# __repr__ (self) - generate Python code to recreate
-# the instance
-# _cmp (self, other) - compare two version numbers ('other' may
-# be an unparsed version string, or another
-# instance of your version class)
-
-
-class StrictVersion (Version):
-
- """Version numbering for anal retentives and software idealists.
- Implements the standard interface for version number classes as
- described above. A version number consists of two or three
- dot-separated numeric components, with an optional "pre-release" tag
- on the end. The pre-release tag consists of the letter 'a' or 'b'
- followed by a number. If the numeric components of two version
- numbers are equal, then one with a pre-release tag will always
- be deemed earlier (lesser) than one without.
-
- The following are valid version numbers (shown in the order that
- would be obtained by sorting according to the supplied cmp function):
-
- 0.4 0.4.0 (these two are equivalent)
- 0.4.1
- 0.5a1
- 0.5b3
- 0.5
- 0.9.6
- 1.0
- 1.0.4a3
- 1.0.4b1
- 1.0.4
-
- The following are examples of invalid version numbers:
-
- 1
- 2.7.2.2
- 1.3.a4
- 1.3pl1
- 1.3c4
-
- The rationale for this version numbering system will be explained
- in the distutils documentation.
- """
-
- version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
- re.VERBOSE | re.ASCII)
-
-
- def parse (self, vstring):
- match = self.version_re.match(vstring)
- if not match:
- raise ValueError("invalid version number '%s'" % vstring)
-
- (major, minor, patch, prerelease, prerelease_num) = \
- match.group(1, 2, 4, 5, 6)
-
- if patch:
- self.version = tuple(map(int, [major, minor, patch]))
- else:
- self.version = tuple(map(int, [major, minor])) + (0,)
-
- if prerelease:
- self.prerelease = (prerelease[0], int(prerelease_num))
- else:
- self.prerelease = None
-
-
- def __str__ (self):
-
- if self.version[2] == 0:
- vstring = '.'.join(map(str, self.version[0:2]))
- else:
- vstring = '.'.join(map(str, self.version))
-
- if self.prerelease:
- vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
-
- return vstring
-
-
- def _cmp (self, other):
- if isinstance(other, str):
- other = StrictVersion(other)
-
- if self.version != other.version:
- # numeric versions don't match
- # prerelease stuff doesn't matter
- if self.version < other.version:
- return -1
- else:
- return 1
-
- # have to compare prerelease
- # case 1: neither has prerelease; they're equal
- # case 2: self has prerelease, other doesn't; other is greater
- # case 3: self doesn't have prerelease, other does: self is greater
- # case 4: both have prerelease: must compare them!
-
- if (not self.prerelease and not other.prerelease):
- return 0
- elif (self.prerelease and not other.prerelease):
- return -1
- elif (not self.prerelease and other.prerelease):
- return 1
- elif (self.prerelease and other.prerelease):
- if self.prerelease == other.prerelease:
- return 0
- elif self.prerelease < other.prerelease:
- return -1
- else:
- return 1
- else:
- assert False, "never get here"
-
-# end class StrictVersion
-
-
-# The rules according to Greg Stein:
-# 1) a version number has 1 or more numbers separated by a period or by
-# sequences of letters. If only periods, then these are compared
-# left-to-right to determine an ordering.
-# 2) sequences of letters are part of the tuple for comparison and are
-# compared lexicographically
-# 3) recognize the numeric components may have leading zeroes
-#
-# The LooseVersion class below implements these rules: a version number
-# string is split up into a tuple of integer and string components, and
-# comparison is a simple tuple comparison. This means that version
-# numbers behave in a predictable and obvious way, but a way that might
-# not necessarily be how people *want* version numbers to behave. There
-# wouldn't be a problem if people could stick to purely numeric version
-# numbers: just split on period and compare the numbers as tuples.
-# However, people insist on putting letters into their version numbers;
-# the most common purpose seems to be:
-# - indicating a "pre-release" version
-# ('alpha', 'beta', 'a', 'b', 'pre', 'p')
-# - indicating a post-release patch ('p', 'pl', 'patch')
-# but of course this can't cover all version number schemes, and there's
-# no way to know what a programmer means without asking him.
-#
-# The problem is what to do with letters (and other non-numeric
-# characters) in a version number. The current implementation does the
-# obvious and predictable thing: keep them as strings and compare
-# lexically within a tuple comparison. This has the desired effect if
-# an appended letter sequence implies something "post-release":
-# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
-#
-# However, if letters in a version number imply a pre-release version,
-# the "obvious" thing isn't correct. Eg. you would expect that
-# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
-# implemented here, this just isn't so.
-#
-# Two possible solutions come to mind. The first is to tie the
-# comparison algorithm to a particular set of semantic rules, as has
-# been done in the StrictVersion class above. This works great as long
-# as everyone can go along with bondage and discipline. Hopefully a
-# (large) subset of Python module programmers will agree that the
-# particular flavour of bondage and discipline provided by StrictVersion
-# provides enough benefit to be worth using, and will submit their
-# version numbering scheme to its domination. The free-thinking
-# anarchists in the lot will never give in, though, and something needs
-# to be done to accommodate them.
-#
-# Perhaps a "moderately strict" version class could be implemented that
-# lets almost anything slide (syntactically), and makes some heuristic
-# assumptions about non-digits in version number strings. This could
-# sink into special-case-hell, though; if I was as talented and
-# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
-# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
-# just as happy dealing with things like "2g6" and "1.13++". I don't
-# think I'm smart enough to do it right though.
-#
-# In any case, I've coded the test suite for this module (see
-# ../test/test_version.py) specifically to fail on things like comparing
-# "1.2a2" and "1.2". That's not because the *code* is doing anything
-# wrong, it's because the simple, obvious design doesn't match my
-# complicated, hairy expectations for real-world version numbers. It
-# would be a snap to fix the test suite to say, "Yep, LooseVersion does
-# the Right Thing" (ie. the code matches the conception). But I'd rather
-# have a conception that matches common notions about version numbers.
-
-class LooseVersion (Version):
-
- """Version numbering for anarchists and software realists.
- Implements the standard interface for version number classes as
- described above. A version number consists of a series of numbers,
- separated by either periods or strings of letters. When comparing
- version numbers, the numeric components will be compared
- numerically, and the alphabetic components lexically. The following
- are all valid version numbers, in no particular order:
-
- 1.5.1
- 1.5.2b2
- 161
- 3.10a
- 8.02
- 3.4j
- 1996.07.12
- 3.2.pl0
- 3.1.1.6
- 2g6
- 11g
- 0.960923
- 2.2beta29
- 1.13++
- 5.5.kw
- 2.0b1pl0
-
- In fact, there is no such thing as an invalid version number under
- this scheme; the rules for comparison are simple and predictable,
- but may not always give the results you want (for some definition
- of "want").
- """
-
- component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
-
- def __init__ (self, vstring=None):
- if vstring:
- self.parse(vstring)
-
-
- def parse (self, vstring):
- # I've given up on thinking I can reconstruct the version string
- # from the parsed tuple -- so I just store the string here for
- # use by __str__
- self.vstring = vstring
- components = [x for x in self.component_re.split(vstring)
- if x and x != '.']
- for i, obj in enumerate(components):
- try:
- components[i] = int(obj)
- except ValueError:
- pass
-
- self.version = components
-
-
- def __str__ (self):
- return self.vstring
-
-
- def __repr__ (self):
- return "LooseVersion ('%s')" % str(self)
-
-
- def _cmp (self, other):
- if isinstance(other, str):
- other = LooseVersion(other)
-
- if self.version == other.version:
- return 0
- if self.version < other.version:
- return -1
- if self.version > other.version:
- return 1
-
-
-# end class LooseVersion
diff --git a/src/CHANGELOG.md b/src/etherollapp/CHANGELOG.md
similarity index 95%
rename from src/CHANGELOG.md
rename to src/etherollapp/CHANGELOG.md
index 7175325..d0ceeb6 100644
--- a/src/CHANGELOG.md
+++ b/src/etherollapp/CHANGELOG.md
@@ -1,6 +1,14 @@
# Change Log
+## [v2019.0911]
+
+ - Update to KivyMD==20181106, refs #144
+ - Update to Kivy==1.11.1, refs #148
+ - Migrate to Python3.7, refs #147
+ - Publish to PyPI, refs #153
+
+
## [v2019.0624]
- Save keystore to private user dir, refs #141
diff --git a/src/ethereum_utils.py b/src/etherollapp/ethereum_utils.py
similarity index 98%
rename from src/ethereum_utils.py
rename to src/etherollapp/ethereum_utils.py
index 0b6bccb..e39823e 100644
--- a/src/ethereum_utils.py
+++ b/src/etherollapp/ethereum_utils.py
@@ -1,6 +1,6 @@
import os
-from pyethapp_accounts import Account
+from etherollapp.pyethapp_accounts import Account
class AccountUtils:
diff --git a/src/etheroll/about.kv b/src/etherollapp/etheroll/about.kv
similarity index 95%
rename from src/etheroll/about.kv
rename to src/etherollapp/etheroll/about.kv
index 139b496..827ae65 100644
--- a/src/etheroll/about.kv
+++ b/src/etherollapp/etheroll/about.kv
@@ -1,6 +1,6 @@
#:import webbrowser webbrowser
#:import MDBottomNavigation kivymd.tabs.MDBottomNavigation
-#:import ScrollableLabel etheroll.scrollablelabel.ScrollableLabel
+#:import ScrollableLabel etherollapp.etheroll.scrollablelabel.ScrollableLabel
:
diff --git a/src/etheroll/about.py b/src/etherollapp/etheroll/about.py
similarity index 90%
rename from src/etheroll/about.py
rename to src/etherollapp/etheroll/about.py
index 02e3b06..c5aa3be 100644
--- a/src/etheroll/about.py
+++ b/src/etherollapp/etheroll/about.py
@@ -4,9 +4,9 @@
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout
-from etheroll.ui_utils import SubScreen, load_kv_from_py
-from etheroll.utils import StringIOCBWrite, run_in_thread
-from version import __version__
+from etherollapp.etheroll.ui_utils import SubScreen, load_kv_from_py
+from etherollapp.etheroll.utils import StringIOCBWrite, run_in_thread
+from etherollapp.version import __version__
load_kv_from_py(__file__)
@@ -64,7 +64,7 @@ def run_tests(self):
"""
# lazy loading
import unittest
- from testsuite import suite
+ from etherollapp.testsuite import suite
test_suite = suite()
self.stream_property = ""
stream = StringIOCBWrite(callback_write=self.callback_write)
diff --git a/src/etheroll/addressbutton.py b/src/etherollapp/etheroll/addressbutton.py
similarity index 100%
rename from src/etheroll/addressbutton.py
rename to src/etherollapp/etheroll/addressbutton.py
diff --git a/src/etheroll/constants.py b/src/etherollapp/etheroll/constants.py
similarity index 100%
rename from src/etheroll/constants.py
rename to src/etherollapp/etheroll/constants.py
diff --git a/src/etheroll/controller.kv b/src/etherollapp/etheroll/controller.kv
similarity index 89%
rename from src/etheroll/controller.kv
rename to src/etherollapp/etheroll/controller.kv
index 5e6cca7..cff9738 100644
--- a/src/etheroll/controller.kv
+++ b/src/etherollapp/etheroll/controller.kv
@@ -1,7 +1,7 @@
#:import NavigationLayout kivymd.navigationdrawer.NavigationLayout
-#:import CustomToolbar etheroll.customtoolbar.CustomToolbar
-#:import LazyScreenManager etheroll.lazyscreenmanager.LazyScreenManager
-#:import RollScreen etheroll.roll.RollScreen
+#:import CustomToolbar etherollapp.etheroll.customtoolbar.CustomToolbar
+#:import LazyScreenManager etherollapp.etheroll.lazyscreenmanager.LazyScreenManager
+#:import RollScreen etherollapp.etheroll.roll.RollScreen
# need this hack to push widgets up
diff --git a/src/etheroll/controller.py b/src/etherollapp/etheroll/controller.py
similarity index 94%
rename from src/etheroll/controller.py
rename to src/etherollapp/etheroll/controller.py
index 205bdc2..96a0e22 100755
--- a/src/etheroll/controller.py
+++ b/src/etherollapp/etheroll/controller.py
@@ -10,15 +10,15 @@
from raven import Client
from requests.exceptions import ConnectionError
-from etheroll.constants import API_KEY_PATH
-from etheroll.settings import Settings
-from etheroll.settings_screen import SettingsScreen
-from etheroll.switchaccount import SwitchAccountScreen
-from etheroll.ui_utils import Dialog, load_kv_from_py
-from etheroll.utils import run_in_thread
-from osc.osc_app_server import OscAppServer
-from sentry_utils import configure_sentry
-from service.utils import start_roll_polling_service
+from etherollapp.etheroll.constants import API_KEY_PATH
+from etherollapp.etheroll.settings import Settings
+from etherollapp.etheroll.settings_screen import SettingsScreen
+from etherollapp.etheroll.switchaccount import SwitchAccountScreen
+from etherollapp.etheroll.ui_utils import Dialog, load_kv_from_py
+from etherollapp.etheroll.utils import run_in_thread
+from etherollapp.osc.osc_app_server import OscAppServer
+from etherollapp.sentry_utils import configure_sentry
+from etherollapp.service.utils import start_roll_polling_service
load_kv_from_py(__file__)
@@ -59,7 +59,7 @@ def on_keyboard(self, window, key, *args):
if Dialog.dialogs:
Dialog.dismiss_all_dialogs()
return True
- from etheroll.ui_utils import SubScreen
+ from etherollapp.etheroll.ui_utils import SubScreen
current_screen = self.screen_manager.current_screen
# if is sub-screen loads previous and stops the propagation
# otherwise propagates the key to exit
@@ -85,7 +85,7 @@ def account_utils(self):
"""
Gets or creates the AccountUtils object so it loads lazily.
"""
- from ethereum_utils import AccountUtils
+ from etherollapp.ethereum_utils import AccountUtils
keystore_dir = Settings.get_keystore_path()
return AccountUtils.get_or_create(keystore_dir)
@@ -170,8 +170,8 @@ def on_current_screen(screen_manager, screen):
def register_screens(self):
# lazy loading
- from etheroll.about import AboutScreen
- from etheroll.roll_results import RollResultsScreen
+ from etherollapp.etheroll.about import AboutScreen
+ from etherollapp.etheroll.roll_results import RollResultsScreen
screen_dicts = {
# "roll_screen": RollScreen,
"roll_results_screen": RollResultsScreen,
@@ -236,7 +236,7 @@ def prompt_password_dialog(self, account):
Prompt the password dialog.
"""
# lazy loading
- from etheroll.passwordform import PasswordForm
+ from etherollapp.etheroll.passwordform import PasswordForm
dialog = PasswordForm.dialog(account)
dialog.content.bind(on_unlock=self.on_unlock_clicked)
dialog.open()
diff --git a/src/etheroll/createnewaccount.kv b/src/etherollapp/etheroll/createnewaccount.kv
similarity index 100%
rename from src/etheroll/createnewaccount.kv
rename to src/etherollapp/etheroll/createnewaccount.kv
diff --git a/src/etheroll/createnewaccount.py b/src/etherollapp/etheroll/createnewaccount.py
similarity index 96%
rename from src/etheroll/createnewaccount.py
rename to src/etherollapp/etheroll/createnewaccount.py
index 0c85332..47af003 100644
--- a/src/etheroll/createnewaccount.py
+++ b/src/etherollapp/etheroll/createnewaccount.py
@@ -3,8 +3,8 @@
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout
-from etheroll.ui_utils import Dialog, load_kv_from_py
-from etheroll.utils import run_in_thread
+from etherollapp.etheroll.ui_utils import Dialog, load_kv_from_py
+from etherollapp.etheroll.utils import run_in_thread
load_kv_from_py(__file__)
diff --git a/src/etheroll/customtoolbar.kv b/src/etherollapp/etheroll/customtoolbar.kv
similarity index 100%
rename from src/etheroll/customtoolbar.kv
rename to src/etherollapp/etheroll/customtoolbar.kv
diff --git a/src/etheroll/customtoolbar.py b/src/etherollapp/etheroll/customtoolbar.py
similarity index 93%
rename from src/etheroll/customtoolbar.py
rename to src/etherollapp/etheroll/customtoolbar.py
index e95dba1..94bd5e6 100644
--- a/src/etheroll/customtoolbar.py
+++ b/src/etherollapp/etheroll/customtoolbar.py
@@ -2,7 +2,7 @@
from kivy.clock import Clock
from kivymd.toolbar import Toolbar
-from etheroll.ui_utils import load_kv_from_py
+from etherollapp.etheroll.ui_utils import load_kv_from_py
load_kv_from_py(__file__)
diff --git a/src/etheroll/importkeystore.kv b/src/etherollapp/etheroll/importkeystore.kv
similarity index 100%
rename from src/etheroll/importkeystore.kv
rename to src/etherollapp/etheroll/importkeystore.kv
diff --git a/src/etheroll/importkeystore.py b/src/etherollapp/etheroll/importkeystore.py
similarity index 82%
rename from src/etheroll/importkeystore.py
rename to src/etherollapp/etheroll/importkeystore.py
index ce4bf65..32eef20 100644
--- a/src/etheroll/importkeystore.py
+++ b/src/etherollapp/etheroll/importkeystore.py
@@ -2,8 +2,8 @@
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout
-from etheroll.settings import Settings
-from etheroll.ui_utils import load_kv_from_py
+from etherollapp.etheroll.settings import Settings
+from etherollapp.etheroll.ui_utils import load_kv_from_py
load_kv_from_py(__file__)
diff --git a/src/etheroll/lazyscreenmanager.py b/src/etherollapp/etheroll/lazyscreenmanager.py
similarity index 100%
rename from src/etheroll/lazyscreenmanager.py
rename to src/etherollapp/etheroll/lazyscreenmanager.py
diff --git a/src/etheroll/passwordform.kv b/src/etherollapp/etheroll/passwordform.kv
similarity index 100%
rename from src/etheroll/passwordform.kv
rename to src/etherollapp/etheroll/passwordform.kv
diff --git a/src/etheroll/passwordform.py b/src/etherollapp/etheroll/passwordform.py
similarity index 95%
rename from src/etheroll/passwordform.py
rename to src/etherollapp/etheroll/passwordform.py
index 829017f..a649659 100644
--- a/src/etheroll/passwordform.py
+++ b/src/etherollapp/etheroll/passwordform.py
@@ -1,7 +1,7 @@
from kivy.properties import StringProperty
from kivy.uix.boxlayout import BoxLayout
-from etheroll.ui_utils import Dialog, load_kv_from_py
+from etherollapp.etheroll.ui_utils import Dialog, load_kv_from_py
load_kv_from_py(__file__)
diff --git a/src/etheroll/roll.kv b/src/etherollapp/etheroll/roll.kv
similarity index 97%
rename from src/etheroll/roll.kv
rename to src/etherollapp/etheroll/roll.kv
index 7aee414..4d74dfd 100644
--- a/src/etheroll/roll.kv
+++ b/src/etherollapp/etheroll/roll.kv
@@ -1,7 +1,7 @@
#:import MDSeparator kivymd.card.MDSeparator
#:import MDTextField kivymd.textfields.MDTextField
#:import MDSlider kivymd.slider.MDSlider
-#:import AddressButton etheroll.addressbutton.AddressButton
+#:import AddressButton etherollapp.etheroll.addressbutton.AddressButton
#:import ROUND_DIGITS pyetheroll.constants.ROUND_DIGITS
diff --git a/src/etheroll/roll.py b/src/etherollapp/etheroll/roll.py
similarity index 98%
rename from src/etheroll/roll.py
rename to src/etherollapp/etheroll/roll.py
index b804953..8fd264f 100644
--- a/src/etheroll/roll.py
+++ b/src/etherollapp/etheroll/roll.py
@@ -8,8 +8,8 @@
from pyetheroll.constants import ROUND_DIGITS
from requests.exceptions import ConnectionError
-from etheroll.ui_utils import Dialog, load_kv_from_py
-from etheroll.utils import run_in_thread
+from etherollapp.etheroll.ui_utils import Dialog, load_kv_from_py
+from etherollapp.etheroll.utils import run_in_thread
load_kv_from_py(__file__)
DEFAULT_MIN_BET = 0.10
diff --git a/src/etheroll/roll_results.kv b/src/etherollapp/etheroll/roll_results.kv
similarity index 82%
rename from src/etheroll/roll_results.kv
rename to src/etherollapp/etheroll/roll_results.kv
index c6f035c..fb4afbd 100644
--- a/src/etheroll/roll_results.kv
+++ b/src/etherollapp/etheroll/roll_results.kv
@@ -1,4 +1,4 @@
-#:import ScrollViewSpinder etheroll.scroll_view_spinner
+#:import ScrollViewSpinder etherollapp.etheroll.scroll_view_spinner
:
diff --git a/src/etheroll/roll_results.py b/src/etherollapp/etheroll/roll_results.py
similarity index 97%
rename from src/etheroll/roll_results.py
rename to src/etherollapp/etheroll/roll_results.py
index 22a93ce..8663dce 100644
--- a/src/etheroll/roll_results.py
+++ b/src/etherollapp/etheroll/roll_results.py
@@ -5,8 +5,8 @@
from kivymd.list import ILeftBody, ThreeLineAvatarListItem
from pyetheroll.constants import ROUND_DIGITS
-from etheroll.ui_utils import Dialog, SubScreen, load_kv_from_py
-from etheroll.utils import run_in_thread
+from etherollapp.etheroll.ui_utils import Dialog, SubScreen, load_kv_from_py
+from etherollapp.etheroll.utils import run_in_thread
load_kv_from_py(__file__)
diff --git a/src/etheroll/scroll_view_spinner.kv b/src/etherollapp/etheroll/scroll_view_spinner.kv
similarity index 100%
rename from src/etheroll/scroll_view_spinner.kv
rename to src/etherollapp/etheroll/scroll_view_spinner.kv
diff --git a/src/etheroll/scroll_view_spinner.py b/src/etherollapp/etheroll/scroll_view_spinner.py
similarity index 91%
rename from src/etheroll/scroll_view_spinner.py
rename to src/etherollapp/etheroll/scroll_view_spinner.py
index 142e865..ac9573c 100644
--- a/src/etheroll/scroll_view_spinner.py
+++ b/src/etherollapp/etheroll/scroll_view_spinner.py
@@ -1,6 +1,6 @@
from kivymd.spinner import MDSpinner
-from etheroll.ui_utils import load_kv_from_py
+from etherollapp.etheroll.ui_utils import load_kv_from_py
load_kv_from_py(__file__)
diff --git a/src/etheroll/scrollablelabel.kv b/src/etherollapp/etheroll/scrollablelabel.kv
similarity index 100%
rename from src/etheroll/scrollablelabel.kv
rename to src/etherollapp/etheroll/scrollablelabel.kv
diff --git a/src/etheroll/scrollablelabel.py b/src/etherollapp/etheroll/scrollablelabel.py
similarity index 81%
rename from src/etheroll/scrollablelabel.py
rename to src/etherollapp/etheroll/scrollablelabel.py
index 58d5c4a..dc3a6d8 100644
--- a/src/etheroll/scrollablelabel.py
+++ b/src/etherollapp/etheroll/scrollablelabel.py
@@ -1,7 +1,7 @@
from kivy.properties import StringProperty
from kivy.uix.scrollview import ScrollView
-from etheroll.ui_utils import load_kv_from_py
+from etherollapp.etheroll.ui_utils import load_kv_from_py
load_kv_from_py(__file__)
diff --git a/src/etheroll/settings.py b/src/etherollapp/etheroll/settings.py
similarity index 97%
rename from src/etheroll/settings.py
rename to src/etherollapp/etheroll/settings.py
index c0ca7e8..74f2b2b 100644
--- a/src/etheroll/settings.py
+++ b/src/etherollapp/etheroll/settings.py
@@ -4,8 +4,8 @@
from kivy.utils import platform
from pyetheroll.constants import DEFAULT_GAS_PRICE_GWEI, ChainID
-from etheroll.constants import KEYSTORE_DIR_SUFFIX
-from etheroll.store import Store
+from etherollapp.etheroll.constants import KEYSTORE_DIR_SUFFIX
+from etherollapp.etheroll.store import Store
NETWORK_SETTINGS = 'network'
GAS_PRICE_SETTINGS = 'gas_price'
diff --git a/src/etheroll/settings_screen.kv b/src/etherollapp/etheroll/settings_screen.kv
similarity index 100%
rename from src/etheroll/settings_screen.kv
rename to src/etherollapp/etheroll/settings_screen.kv
diff --git a/src/etheroll/settings_screen.py b/src/etherollapp/etheroll/settings_screen.py
similarity index 93%
rename from src/etheroll/settings_screen.py
rename to src/etherollapp/etheroll/settings_screen.py
index df5944c..0126003 100644
--- a/src/etheroll/settings_screen.py
+++ b/src/etherollapp/etheroll/settings_screen.py
@@ -4,11 +4,11 @@
from kivy.properties import BooleanProperty, NumericProperty
from pyetheroll.constants import ChainID
-from etheroll.constants import KEYSTORE_DIR_SUFFIX
-from etheroll.settings import Settings
-from etheroll.ui_utils import SubScreen, load_kv_from_py
-from etheroll.utils import (check_request_write_permission,
- check_write_permission)
+from etherollapp.etheroll.constants import KEYSTORE_DIR_SUFFIX
+from etherollapp.etheroll.settings import Settings
+from etherollapp.etheroll.ui_utils import SubScreen, load_kv_from_py
+from etherollapp.etheroll.utils import (check_request_write_permission,
+ check_write_permission)
load_kv_from_py(__file__)
@@ -22,9 +22,6 @@ class SettingsScreen(SubScreen):
is_stored_testnet = BooleanProperty()
stored_gas_price = NumericProperty()
- def __init__(self, **kwargs):
- super().__init__(**kwargs)
-
def store_network(self):
"""
Saves selected network to the store.
diff --git a/src/etheroll/store.py b/src/etherollapp/etheroll/store.py
similarity index 100%
rename from src/etheroll/store.py
rename to src/etherollapp/etheroll/store.py
diff --git a/src/etheroll/switchaccount.kv b/src/etherollapp/etheroll/switchaccount.kv
similarity index 85%
rename from src/etheroll/switchaccount.kv
rename to src/etherollapp/etheroll/switchaccount.kv
index b649f95..7375d53 100644
--- a/src/etheroll/switchaccount.kv
+++ b/src/etherollapp/etheroll/switchaccount.kv
@@ -1,9 +1,9 @@
-#:import ScrollViewSpinder etheroll.scroll_view_spinner
+#:import ScrollViewSpinder etherollapp.etheroll.scroll_view_spinner
#:import MDList kivymd.list.MDList
#:import MDBottomNavigation kivymd.tabs.MDBottomNavigation
#:import MDBottomNavigationItem kivymd.tabs.MDBottomNavigationItem
-#:import CreateNewAccount etheroll.createnewaccount.CreateNewAccount
-#:import ImportKeystore etheroll.importkeystore.ImportKeystore
+#:import CreateNewAccount etherollapp.etheroll.createnewaccount.CreateNewAccount
+#:import ImportKeystore etherollapp.etheroll.importkeystore.ImportKeystore
:
diff --git a/src/etheroll/switchaccount.py b/src/etherollapp/etheroll/switchaccount.py
similarity index 96%
rename from src/etheroll/switchaccount.py
rename to src/etherollapp/etheroll/switchaccount.py
index 69e9603..3e783bd 100644
--- a/src/etheroll/switchaccount.py
+++ b/src/etherollapp/etheroll/switchaccount.py
@@ -4,8 +4,8 @@
from kivy.uix.boxlayout import BoxLayout
from kivymd.list import OneLineListItem
-from etheroll.ui_utils import Dialog, SubScreen, load_kv_from_py
-from etheroll.utils import run_in_thread
+from etherollapp.etheroll.ui_utils import Dialog, SubScreen, load_kv_from_py
+from etherollapp.etheroll.utils import run_in_thread
load_kv_from_py(__file__)
diff --git a/src/etheroll/ui_utils.py b/src/etherollapp/etheroll/ui_utils.py
similarity index 100%
rename from src/etheroll/ui_utils.py
rename to src/etherollapp/etheroll/ui_utils.py
diff --git a/src/etheroll/utils.py b/src/etherollapp/etheroll/utils.py
similarity index 100%
rename from src/etheroll/utils.py
rename to src/etherollapp/etheroll/utils.py
diff --git a/src/osc/README.md b/src/etherollapp/osc/README.md
similarity index 100%
rename from src/osc/README.md
rename to src/etherollapp/osc/README.md
diff --git a/src/distutils/__init__.py b/src/etherollapp/osc/__init__.py
similarity index 100%
rename from src/distutils/__init__.py
rename to src/etherollapp/osc/__init__.py
diff --git a/src/osc/osc_app_client.py b/src/etherollapp/osc/osc_app_client.py
similarity index 100%
rename from src/osc/osc_app_client.py
rename to src/etherollapp/osc/osc_app_client.py
diff --git a/src/osc/osc_app_server.py b/src/etherollapp/osc/osc_app_server.py
similarity index 100%
rename from src/osc/osc_app_server.py
rename to src/etherollapp/osc/osc_app_server.py
diff --git a/src/pyethapp_accounts.py b/src/etherollapp/pyethapp_accounts.py
similarity index 100%
rename from src/pyethapp_accounts.py
rename to src/etherollapp/pyethapp_accounts.py
diff --git a/src/sentry_utils.py b/src/etherollapp/sentry_utils.py
similarity index 97%
rename from src/sentry_utils.py
rename to src/etherollapp/sentry_utils.py
index 1e7ad5c..3ae8a6f 100644
--- a/src/sentry_utils.py
+++ b/src/etherollapp/sentry_utils.py
@@ -4,7 +4,7 @@
from raven.conf import setup_logging
from raven.handlers.logging import SentryHandler
-from version import __version__
+from etherollapp.version import __version__
def configure_sentry(in_debug=False):
diff --git a/src/osc/__init__.py b/src/etherollapp/service/__init__.py
similarity index 100%
rename from src/osc/__init__.py
rename to src/etherollapp/service/__init__.py
diff --git a/src/service/main.py b/src/etherollapp/service/main.py
similarity index 96%
rename from src/service/main.py
rename to src/etherollapp/service/main.py
index 287010f..cb5165b 100755
--- a/src/service/main.py
+++ b/src/etherollapp/service/main.py
@@ -9,7 +9,7 @@
```sh
PYTHONPATH=src/
PYTHON_SERVICE_ARGUMENT='{"osc_server_port": PORT}'
-./src/service/main.py
+./src/etherollapp/service/main.py
```
"""
import json
@@ -24,11 +24,11 @@
from pyetheroll.etheroll import Etheroll
from raven import Client
-from ethereum_utils import AccountUtils
-from etheroll.constants import API_KEY_PATH
-from etheroll.settings import Settings
-from osc.osc_app_client import OscAppClient
-from sentry_utils import configure_sentry
+from etherollapp.ethereum_utils import AccountUtils
+from etherollapp.etheroll.constants import API_KEY_PATH
+from etherollapp.etheroll.settings import Settings
+from etherollapp.osc.osc_app_client import OscAppClient
+from etherollapp.sentry_utils import configure_sentry
PULL_FREQUENCY_SECONDS = 10
# time before the service shuts down if no roll activity
diff --git a/src/service/utils.py b/src/etherollapp/service/utils.py
similarity index 100%
rename from src/service/utils.py
rename to src/etherollapp/service/utils.py
diff --git a/src/service/__init__.py b/src/etherollapp/tests/__init__.py
similarity index 100%
rename from src/service/__init__.py
rename to src/etherollapp/tests/__init__.py
diff --git a/src/tests/etheroll/test_settings.py b/src/etherollapp/tests/etheroll/test_settings.py
similarity index 100%
rename from src/tests/etheroll/test_settings.py
rename to src/etherollapp/tests/etheroll/test_settings.py
diff --git a/src/tests/service/test_main.py b/src/etherollapp/tests/service/test_main.py
similarity index 100%
rename from src/tests/service/test_main.py
rename to src/etherollapp/tests/service/test_main.py
diff --git a/src/tests/service/test_utils.py b/src/etherollapp/tests/service/test_utils.py
similarity index 100%
rename from src/tests/service/test_utils.py
rename to src/etherollapp/tests/service/test_utils.py
diff --git a/src/tests/test_ethereum_utils.py b/src/etherollapp/tests/test_ethereum_utils.py
similarity index 98%
rename from src/tests/test_ethereum_utils.py
rename to src/etherollapp/tests/test_ethereum_utils.py
index 8c20407..84c7999 100644
--- a/src/tests/test_ethereum_utils.py
+++ b/src/etherollapp/tests/test_ethereum_utils.py
@@ -4,8 +4,8 @@
from tempfile import TemporaryDirectory, mkdtemp
from unittest import mock
-from ethereum_utils import AccountUtils
-from pyethapp_accounts import Account
+from etherollapp.ethereum_utils import AccountUtils
+from etherollapp.pyethapp_accounts import Account
PASSWORD = "password"
diff --git a/src/tests/test_import.py b/src/etherollapp/tests/test_import.py
similarity index 100%
rename from src/tests/test_import.py
rename to src/etherollapp/tests/test_import.py
diff --git a/src/tests/test_pyethapp_accounts.py b/src/etherollapp/tests/test_pyethapp_accounts.py
similarity index 99%
rename from src/tests/test_pyethapp_accounts.py
rename to src/etherollapp/tests/test_pyethapp_accounts.py
index d1f409c..4275780 100644
--- a/src/tests/test_pyethapp_accounts.py
+++ b/src/etherollapp/tests/test_pyethapp_accounts.py
@@ -12,7 +12,7 @@
from eth_utils import remove_0x_prefix
from past.utils import old_div
-from pyethapp_accounts import Account
+from etherollapp.pyethapp_accounts import Account
class TestAccountUtils(unittest.TestCase):
diff --git a/src/tests/ui/README.md b/src/etherollapp/tests/ui/README.md
similarity index 100%
rename from src/tests/ui/README.md
rename to src/etherollapp/tests/ui/README.md
diff --git a/src/tests/__init__.py b/src/etherollapp/tests/ui/__init__.py
similarity index 100%
rename from src/tests/__init__.py
rename to src/etherollapp/tests/ui/__init__.py
diff --git a/src/tests/ui/test_etheroll_ui.py b/src/etherollapp/tests/ui/test_etheroll_ui.py
similarity index 99%
rename from src/tests/ui/test_etheroll_ui.py
rename to src/etherollapp/tests/ui/test_etheroll_ui.py
index 013413c..aca2ac0 100644
--- a/src/tests/ui/test_etheroll_ui.py
+++ b/src/etherollapp/tests/ui/test_etheroll_ui.py
@@ -11,9 +11,9 @@
from kivy.clock import Clock
from requests.exceptions import ConnectionError
-from etheroll.controller import EtherollApp
-from etheroll.ui_utils import Dialog
-from tests.utils import PyEtherollTestUtils
+from etherollapp.etheroll.controller import EtherollApp
+from etherollapp.etheroll.ui_utils import Dialog
+from etherollapp.tests.utils import PyEtherollTestUtils
class UITestCase(unittest.TestCase):
diff --git a/src/tests/utils.py b/src/etherollapp/tests/utils.py
similarity index 100%
rename from src/tests/utils.py
rename to src/etherollapp/tests/utils.py
diff --git a/src/testsuite.py b/src/etherollapp/testsuite.py
similarity index 80%
rename from src/testsuite.py
rename to src/etherollapp/testsuite.py
index ca753b2..6782c90 100644
--- a/src/testsuite.py
+++ b/src/etherollapp/testsuite.py
@@ -1,6 +1,6 @@
import unittest
-from tests import test_ethereum_utils, test_import
+from etherollapp.tests import test_ethereum_utils, test_import
def suite():
diff --git a/src/version.py b/src/etherollapp/version.py
similarity index 85%
rename from src/version.py
rename to src/etherollapp/version.py
index deeb247..82b2e69 100644
--- a/src/version.py
+++ b/src/etherollapp/version.py
@@ -1,7 +1,7 @@
-__version__ = '2019.0624'
+__version__ = '2019.0911'
# The `__version_code__` is used for the F-Droid auto update and should match
# the `versionCode` from the `build.gradle` file located in:
# `.buildozer/android/platform/build/dists/etheroll/`
# The auto update method used is the `HTTP`, see:
# https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckMode
-__version_code__ = 721202524
+__version_code__ = 721202811
diff --git a/src/main.py b/src/main.py
index f817e5a..88bac7b 100755
--- a/src/main.py
+++ b/src/main.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-from etheroll.controller import main
+from etherollapp.etheroll.controller import main
if __name__ == '__main__':
main()
diff --git a/src/tests/ui/__init__.py b/src/tests/ui/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/tox.ini b/tox.ini
index 5530e5f..080fe52 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = pep8,isort,py3
+envlist = pep8,isort,py37
# no setup.py to be ran
skipsdist = True
# trick to enable pre-installation of Cython
@@ -9,18 +9,19 @@ indexserver =
[testenv]
deps =
- :preinstall: Cython==0.26.1
- :preinstall: setuptools==37.0.0
+ :preinstall: Cython==0.28.6
pytest
-r{toxinidir}/requirements.txt
# this could be dropped after we migrate to Kivy==1.11.0, refs #148
setenv =
KIVY_UNITTEST = 1
-commands = pytest --ignore src/tests/ui/ src/tests/
+ PYTHONPATH = {toxinidir}/src/
+ SOURCES = src/ setup.py
+commands = pytest --ignore src/etherollapp/tests/ui/ src/etherollapp/tests/
[testenv:pep8]
deps = flake8
-commands = flake8 src/
+commands = flake8 {env:SOURCES}
[flake8]
exclude = src/python-for-android/
@@ -28,7 +29,6 @@ exclude = src/python-for-android/
[testenv:isort]
# isort needs to know the requirements to properly sort
deps =
- :preinstall: Cython==0.26.1
- :preinstall: setuptools==37.0.0
+ :preinstall: Cython==0.28.6
-r{toxinidir}/requirements.txt
-commands = isort --check-only --recursive --diff src/
+commands = isort --check-only --recursive --diff {env:SOURCES}