From dec5970bd6f24d7e15d6502bc7e5490f959b6a1c Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 16 Apr 2017 11:12:15 -0400 Subject: [PATCH] Update appveyor to use cx_freeze until pyInstaller is reviewed. --- .appveyor.yml | 64 ++++++++++++++++------------------ requirements_build_windows.txt | 1 + setup.py | 22 +++++++++++- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 52a03f390..e63978a5f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,4 @@ environment: - access_token: - secure: a328a5a4185ae823ae77430883ced14733f426a7 global: # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the @@ -16,21 +14,21 @@ environment: PYTHON_VERSION: "2.7.10" PYTHON_ARCH: "32" - - PYTHON: "C:\\Python27.10-x64" - PYTHON_VERSION: "2.7.10" - PYTHON_ARCH: "64" + #- PYTHON: "C:\\Python27.10-x64" + # PYTHON_VERSION: "2.7.10" + # PYTHON_ARCH: "64" # Pre-installed Python versions, which Appveyor may upgrade to # a later point release. # See: http://www.appveyor.com/docs/installed-software#python - - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.x" # currently 2.7.9 - PYTHON_ARCH: "32" + #- PYTHON: "C:\\Python27" + # PYTHON_VERSION: "2.7.x" # currently 2.7.9 + # PYTHON_ARCH: "32" - - PYTHON: "C:\\Python27-x64" - PYTHON_VERSION: "2.7.x" # currently 2.7.9 - PYTHON_ARCH: "64" + #- PYTHON: "C:\\Python27-x64" + # PYTHON_VERSION: "2.7.x" # currently 2.7.9 + # PYTHON_ARCH: "64" #- PYTHON: "C:\\Python33" # PYTHON_VERSION: "3.3.x" # currently 3.3.5 @@ -72,13 +70,13 @@ environment: # Major and minor releases (i.e x.0.0 and x.y.0) prior to 3.3.0 use # a different naming scheme. - - PYTHON: "C:\\Python270" - PYTHON_VERSION: "2.7.0" - PYTHON_ARCH: "32" + #- PYTHON: "C:\\Python270" + # PYTHON_VERSION: "2.7.0" + # PYTHON_ARCH: "32" - - PYTHON: "C:\\Python270-x64" - PYTHON_VERSION: "2.7.0" - PYTHON_ARCH: "64" + #- PYTHON: "C:\\Python270-x64" + # PYTHON_VERSION: "2.7.0" + # PYTHON_ARCH: "64" install: # If there is a newer build queued for the same PR, cancel this one. @@ -94,11 +92,11 @@ install: # Install wxPython - 'ECHO Downloading wxPython.' - "appveyor DownloadFile https://goo.gl/yvO8PB -FileName C:\\wxpython.exe" - - "appveyor DownloadFile https://goo.gl/Uj0jV3 -FileName C:\\wxpython64.exe" + #- "appveyor DownloadFile https://goo.gl/Uj0jV3 -FileName C:\\wxpython64.exe" - 'ECHO Install wxPython' - "C:\\wxpython.exe /SP- /VERYSILENT /NORESTART" - - "C:\\wxpython64.exe /SP- /VERYSILENT /NORESTART" + #- "C:\\wxpython64.exe /SP- /VERYSILENT /NORESTART" - ECHO "Filesystem root:" - ps: "ls \"C:/\"" @@ -140,32 +138,32 @@ build_script: # Build the compiled extension # - "python setup.py build" - ECHO "Build pyfa:" - - copy C:\projects\pyfa\dist_assets\win\pyfa.spec C:\projects\pyfa\pyfa.spec - - "pyinstaller.exe --clean --noconfirm --windowed --upx-dir=C:\\projects\\pyfa\\scripts\\upx.exe C:\\projects\\pyfa\\pyfa.spec" + #- copy C:\projects\pyfa\dist_assets\win\pyfa.spec C:\projects\pyfa\pyfa.spec + - "python C:\\projects\\pyfa\\setup.py build" - - ECHO "Build pyfa (Debug):" - - copy C:\projects\pyfa\dist_assets\win\pyfa_debug.spec C:\projects\pyfa\pyfa_debug.spec - - "pyinstaller.exe --clean --noconfirm --windowed --upx-dir=C:\\projects\\pyfa\\scripts\\upx.exe C:\\projects\\pyfa\\pyfa_debug.spec" + #- ECHO "Build pyfa (Debug):" + #- copy C:\projects\pyfa\dist_assets\win\pyfa_debug.spec C:\projects\pyfa\pyfa_debug.spec + #- "pyinstaller.exe --clean --noconfirm --windowed --upx-dir=C:\\projects\\pyfa\\scripts\\upx.exe C:\\projects\\pyfa\\pyfa_debug.spec" build: on after_build: - ps: "ls \"./\"" #- ps: "ls \"C:\\projects\\pyfa\\build\\pyfa\\\"" - - ps: "ls \"C:\\projects\\pyfa\\dist\\\"" - - ps: "ls \"C:\\projects\\pyfa\\dist\\pyfa\\\"" + - ps: "ls \"C:\\projects\\pyfa\\build\\\"" + - ps: "ls \"C:\\projects\\pyfa\\build\\exe.win32-2.7\\\"" # Zip # APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER #- 7z a build.zip -r C:\projects\pyfa\build\pyfa\*.* - - 7z a pyfa.zip -r C:\projects\pyfa\dist\pyfa\*.* - - 7z a pyfa_debug.zip -r C:\projects\pyfa\dist\pyfa_debug\*.* + - 7z a pyfa.zip -r C:\projects\pyfa\build\exe.win32-2.7\*.* + #- 7z a pyfa_debug.zip -r C:\projects\pyfa\dist\pyfa_debug\*.* on_success: # Do nothing right now test_script: - - tox - - "py.test --cov=./" + #- tox + #- "py.test --cov=./" # Run the project tests # - "%CMD_IN_ENV% python C:/projects/eve-gnosis/setup.py nosetests" @@ -179,9 +177,9 @@ after_test: artifacts: # Archive the generated packages in the ci.appveyor.com build report. - path: pyfa.zip - name: Pyfa - - path: pyfa_debug.zip - name: Pyfa_debug + name: 'pyfa.zip' + #- path: pyfa_debug.zip + # name: Pyfa_debug #on_success: # - TODO: upload the content of dist/*.whl to a public wheelhouse diff --git a/requirements_build_windows.txt b/requirements_build_windows.txt index 173ce92d0..0d5cfb0ac 100644 --- a/requirements_build_windows.txt +++ b/requirements_build_windows.txt @@ -1,4 +1,5 @@ PyInstaller >= 3.2.1 +cx_freeze == 4.3.4 cycler >= 0.10.0 functools32 >= 3.2.3 future >= 0.16.0 diff --git a/setup.py b/setup.py index d35f69e87..0d281bd89 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,24 @@ if __name__ == "__main__": # noinspection PyPackageRequirements,PyUnresolvedReferences from cx_Freeze import setup, Executable import config + import tempfile + import os + import zipfile + import shutil + tmpdir = tempfile.mkdtemp() + + imagesFile = os.path.join(tmpdir, "imgs.zip") + + def zipdir(path, zip): + for root, dirs, files in os.walk(path): + for file in files: + zip.write(os.path.join(root, file)) + + os.chdir('imgs') + with zipfile.ZipFile(imagesFile, 'w') as images: + for dir in icon_dirs: + zipdir(dir, images) + os.chdir('..') app_name = 'pyfa' app_version = '{}'.format(config.version) @@ -33,7 +51,7 @@ if __name__ == "__main__": # Windows-specific options build_options_winexe = { 'packages': packages, - 'include_files': include_files, + 'include_files': include_files+[imagesFile], 'includes': includes, 'excludes': excludes, 'compressed': True, @@ -81,3 +99,5 @@ if __name__ == "__main__": }, executables=[Executable(**executable_options)] ) + + shutil.rmtree(tmpdir)