From 7335d012ef7c083aa00d39727b17f80c294b2d00 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 24 Jul 2018 03:06:53 -0400 Subject: [PATCH] replace miniupnpc with upnpclient docker build with wine --- .travis.yml | 13 ++++++++++++- lbrynet/conf.py | 3 +-- lbrynet/daemon/Components.py | 4 ++-- scripts/wine_build.sh | 21 +++++++++++++++++++++ setup.py | 6 +++--- 5 files changed, 39 insertions(+), 8 deletions(-) create mode 100755 scripts/wine_build.sh diff --git a/.travis.yml b/.travis.yml index 4e224008d..dd18894ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: true +sudo: required dist: xenial language: python python: @@ -41,6 +41,17 @@ jobs: - coverage combine tests/ - bash <(curl -s https://codecov.io/bash) + - stage: build + name: "Windows" + services: + - docker + before_install: + - docker pull cdrx/pyinstaller-windows:python3-32bit + install: + - docker run -v "$(pwd):/src/lbry" cdrx/pyinstaller-windows:python3-32bit lbry/scripts/wine_build.sh + script: + - find dist/ + cache: directories: - $HOME/.cache/pip diff --git a/lbrynet/conf.py b/lbrynet/conf.py index ab0e98bec..7a41d47b4 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -621,8 +621,7 @@ class Config: return self._session_id -# type: Config -settings = None +settings = None # type: Config def get_default_env(): diff --git a/lbrynet/daemon/Components.py b/lbrynet/daemon/Components.py index 8e5f615c3..10fa646cf 100644 --- a/lbrynet/daemon/Components.py +++ b/lbrynet/daemon/Components.py @@ -173,7 +173,7 @@ class HeadersComponent(Component): component_name = HEADERS_COMPONENT def __init__(self, component_manager): - Component.__init__(self, component_manager) + super().__init__(component_manager) self.config = SimpleConfig(get_wallet_config()) self._downloading_headers = None self._headers_progress_percent = None @@ -332,7 +332,7 @@ class WalletComponent(Component): log.info("Starting torba wallet") storage = self.component_manager.get_component(DATABASE_COMPONENT) lbryschema.BLOCKCHAIN_NAME = conf.settings['blockchain_name'] - self.wallet = LbryWalletManager.from_old_config(conf.settings) + self.wallet = LbryWalletManager.from_lbrynet_config(conf.settings) self.wallet.old_db = storage yield self.wallet.start() diff --git a/scripts/wine_build.sh b/scripts/wine_build.sh new file mode 100755 index 000000000..cf26b8bbe --- /dev/null +++ b/scripts/wine_build.sh @@ -0,0 +1,21 @@ +set -x + +rm -rf /tmp/.wine-* + +apt-get -qq update +apt-get -qq install -y git + +git clone https://github.com/lbryio/lbryschema.git --depth 1 +git clone https://github.com/lbryio/torba.git --depth 1 +git clone https://github.com/twisted/twisted.git --depth 1 --branch twisted-18.7.0 +sed -i -e '172,184{s/^/#/}' twisted/src/twisted/python/_setup.py + +pip install setuptools_scm +cd twisted && pip install -e .[tls] && cd .. +cd lbryschema && pip install -e . && cd .. +cd torba && pip install -e . && cd .. + +cd lbry +pip install -e . +pyinstaller lbrynet/daemon/DaemonControl.py +wine dist/DaemonControl/DaemonControl.exe --version diff --git a/setup.py b/setup.py index 7c7b1909f..871b66307 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ requires = [ 'base58', 'envparse', 'jsonrpc', - 'cryptography==2.2.2', - 'lbryschema==0.0.16', + 'cryptography', + 'lbryschema', 'torba', 'miniupnpc', 'txupnp==0.0.1a11', @@ -64,7 +64,7 @@ setup( long_description=long_description, keywords="lbry protocol media", license='MIT', - python_requires='>=3.7', + python_requires='>=3.6', packages=find_packages(exclude=('tests',)), install_requires=requires, entry_points={'console_scripts': console_scripts},