Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v2019.0911'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Sep 11, 2019
2 parents dd41df9 + a0eea8a commit 9825066
Show file tree
Hide file tree
Showing 71 changed files with 232 additions and 495 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
50 changes: 41 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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/
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

<a href="https://f-droid.org/packages/com.github.andremiras.etheroll">
<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" height="75">
</a>
<a href="https://github.com/AndreMiras/EtherollApp/releases/download/v2019.0624/etheroll-2019.0624-debug.apk">
<a href="https://github.com/AndreMiras/EtherollApp/releases/download/v2019.0911/etheroll-2019.0911-debug.apk">
<img src="https://www.livenettv.to/img/landing-page-1/google-play.png" height="75">
</a>

Expand All @@ -15,25 +16,17 @@ Built with Python, [Kivy](https://github.com/kivy/kivy) and love.
<img src="https://i.imgur.com/ORa0iTG.png" alt="Screenshot mainscreen" width="300"> <img src="https://i.imgur.com/Imwuifi.png" alt="Screenshot roll history" width="300">

## 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'
```
20 changes: 11 additions & 9 deletions buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down
31 changes: 22 additions & 9 deletions dockerfiles/Dockerfile-android
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/Dockerfile-linux
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions docs/Troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,6 @@ to:
<property name="java.source" value="7" />
```

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
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
60 changes: 60 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()
3 changes: 0 additions & 3 deletions src/distutils/README.md

This file was deleted.

Loading

0 comments on commit 9825066

Please sign in to comment.