From e215db50baf9e4c6b5faa342bd124c07defad52a Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Fri, 15 Jan 2016 20:48:14 +0100 Subject: [PATCH] Test pyinstaller as build system --- appveyor.yml | 2 +- ci/appveyor/build.cmd | 5 +++-- ci/travis/before_deploy.sh | 4 ++-- ci/travis/build.sh | 6 +++--- hooks/hook-lib2to3.py | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 hooks/hook-lib2to3.py diff --git a/appveyor.yml b/appveyor.yml index 652647b2..83fc9cd6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -57,7 +57,7 @@ build_script: - echo %errorlevel% artifacts: - - path: build + - path: dist name: sakia-win$(PYTHON_ARCH) # upload to releases deploy: diff --git a/ci/appveyor/build.cmd b/ci/appveyor/build.cmd index a1b9b313..87b403b2 100644 --- a/ci/appveyor/build.cmd +++ b/ci/appveyor/build.cmd @@ -12,6 +12,7 @@ pyrcc5 -version lrelease -version pip install -r requirements.txt +pip install pyinstaller python gen_resources.py if %errorlevel% neq 0 exit /b 1s @@ -19,5 +20,5 @@ if %errorlevel% neq 0 exit /b 1s python gen_translations.py if %errorlevel% neq 0 exit /b 1 -@REM python setup.py build -@REM if %errorlevel% neq 0 exit /b 1 +pyinstaller src/sakia/main.py --additional-hooks-dir hooks +if %errorlevel% neq 0 exit /b 1 diff --git a/ci/travis/before_deploy.sh b/ci/travis/before_deploy.sh index f80fb656..1cb92cf7 100755 --- a/ci/travis/before_deploy.sh +++ b/ci/travis/before_deploy.sh @@ -2,8 +2,8 @@ if [ $TRAVIS_OS_NAME == "osx" ] then - zip -r sakia-${TRAVIS_OS_NAME}.zip build/*.dmg + zip -r sakia-${TRAVIS_OS_NAME}.zip dist/* elif [ $TRAVIS_OS_NAME == "linux" ] then - zip -r sakia-${TRAVIS_OS_NAME}.zip build/exe* + zip -r sakia-${TRAVIS_OS_NAME}.zip dist/ fi diff --git a/ci/travis/build.sh b/ci/travis/build.sh index b044d976..d6121bab 100755 --- a/ci/travis/build.sh +++ b/ci/travis/build.sh @@ -6,7 +6,7 @@ eval "$(pyenv virtualenv-init -)" cd $HOME/build/ucoin-io/sakia pyenv activate sakia-env pip install coveralls -pip install cx_Freeze +pip install pyinstaller pip install -r requirements.txt if [ $TRAVIS_OS_NAME == "linux" ] then @@ -19,9 +19,9 @@ python gen_translations.py if [ $TRAVIS_OS_NAME == "osx" ] then - python setup.py bdist_dmg + pyinstaller src/sakia/main.py --additional-hooks-dir hooks elif [ $TRAVIS_OS_NAME == "linux" ] then - python setup.py build + pyinstaller src/sakia/main.py --additional-hooks-dir hooks fi diff --git a/hooks/hook-lib2to3.py b/hooks/hook-lib2to3.py new file mode 100644 index 00000000..ae3b3514 --- /dev/null +++ b/hooks/hook-lib2to3.py @@ -0,0 +1,15 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2005-2016, PyInstaller Development Team. +# +# Distributed under the terms of the GNU General Public License with exception +# for distributing bootloader. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +# This is needed to bundle draft3.json and draft4.json files that come +# with jsonschema module + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files('lib2to3') -- GitLab