From 2ddc756a61a21dc68da07fee33e01def0f2b989c Mon Sep 17 00:00:00 2001 From: albertosottile Date: Mon, 18 Jun 2018 17:02:03 +0200 Subject: [PATCH] AppVeyor: migrate from conda to native Python --- .appveyor.yml | 41 +++++++++++++++++++++-------------------- buildPy2exe.py | 10 +++++----- syncplayClient.py | 6 +++--- syncplayServer.py | 6 +++--- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index b977262..88831d7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,43 +1,44 @@ environment: MINICONDA: "C:\\Miniconda" + PYTHON: "C:\\Python34" + PYTHON_VERSION: 3.4 + PYTHON_ARCH: 32 platform: x86 configuration: Release init: - - set PATH=C:\Miniconda;C:\Miniconda\Scripts;C:\Program Files (x86)\NSIS;%PATH% - - conda create -n syncplay -y - - activate syncplay - - conda install python=3.5 -y - - conda install pywin32 -y - - conda install -c conda-forge pyside2 -y - - pip install twisted pyinstaller zope.interface - - type nul > C:\Miniconda\envs\syncplay\lib\site-packages\zope\__init__.py - - type nul > C:\Miniconda\envs\syncplay\lib\site-packages\pyinstaller\loader\rthooks\pyi_rth_twisted.py + - set PATH=%PYTHON%;%PYTHON%\Scripts;C:\Program Files (x86)\NSIS;%PATH% + - python --version + - python -m site + - python -m pip install -U pip setuptools wheel + - pip install -U pypiwin32==219 + - pip install pyside + - pip install twisted + - pip install py2exe + - pip install zope.interface + - type nul > C:\Python34\lib\site-packages\zope\__init__.py - pip freeze - - conda list install: - cd %APPVEYOR_BUILD_FOLDER% - for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a - - pyinstaller pyinstaller-client.spec - - pyinstaller pyinstaller-server.spec - - python buildInstaller.py - - copy Syncplay-%ver%-Setup.exe Syncplay-%ver%-Setup-Py35.exe - - type nul > dist\syncplay.ini - - copy resources\win_lua_note.txt dist\"VLC LUA Script installation.txt" + - python buildPy2exe.py + - copy Syncplay-%ver%-Setup.exe Syncplay-%ver%-Setup-Py34.exe + - type nul > syncplay_v%ver%\syncplay.ini + - copy resources\win_lua_note.txt syncplay_v%ver%\"VLC LUA Script installation.txt" # Not a project with an msbuild file, build done at install. build: off artifacts: - - path: 'dist' + - path: 'syncplay_v$(ver)' type: zip - name: Syncplay_$(ver)_Portable_py35 + name: Syncplay_$(ver)_Portable_py34 - - path: Syncplay-$(ver)-Setup-Py35.exe - name: Syncplay-$(ver)-Setup-Py35 + - path: Syncplay-$(ver)-Setup-Py34.exe + name: Syncplay-$(ver)-Setup-Py34 # Push artefact to S3 bucket and list all before_deploy: diff --git a/buildPy2exe.py b/buildPy2exe.py index 721a442..dc5b42f 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -18,7 +18,7 @@ from distutils.core import setup try: from py2exe.build_exe import py2exe except ImportError: - from py2exe.distutils_build_exe import py2exe + from py2exe.distutils_buildexe import py2exe from string import Template import syncplay @@ -629,7 +629,7 @@ class NSISScript(object): totalSize = totalSize, ) with codecs.open(SETUP_SCRIPT_PATH, "w", "utf-8-sig") as outfile: - outfile.write(contents.decode('utf-8')) + outfile.write(contents) def compile(self): if not os.path.isfile(NSIS_COMPILE): @@ -720,8 +720,8 @@ info = dict( # console=['syncplayServer.py', {"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"}], options={'py2exe': { 'dist_dir': OUT_DIR, - 'packages': 'PySide2.QtUiTools', - 'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide2, liburl, ast, unicodedata, _ssl', + 'packages': 'PySide.QtUiTools', + 'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide, liburl, ast, unicodedata, _ssl', 'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter', 'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll', 'optimize': 2, @@ -733,5 +733,5 @@ info = dict( cmdclass = {"py2exe": build_installer}, ) -sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource', '-i PySide2.QtCore', '-p PySide2.QtGui', '-i PySide2.QtWidgets']) +sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource', '-i PySide.QtCore', '-i PySide.QtGui']) setup(**info) diff --git a/syncplayClient.py b/syncplayClient.py index 6ad0b89..5effaf8 100755 --- a/syncplayClient.py +++ b/syncplayClient.py @@ -5,11 +5,11 @@ import site, sys # libpath try: - if (sys.version_info.major != 3) or (sys.version_info.minor < 5): - raise Exception("You must run Syncplay with Python 3.5 or newer!") + if (sys.version_info.major != 3) or (sys.version_info.minor < 4): + raise Exception("You must run Syncplay with Python 3.4 or newer!") except AttributeError: import warnings - warnings.warn("You must run Syncplay with Python 3.5 or newer!") + warnings.warn("You must run Syncplay with Python 3.4 or newer!") from syncplay.clientManager import SyncplayClientManager from syncplay.utils import blackholeStdoutForFrozenWindow diff --git a/syncplayServer.py b/syncplayServer.py index 7cc3ac6..b2a2fa8 100755 --- a/syncplayServer.py +++ b/syncplayServer.py @@ -6,11 +6,11 @@ import site, sys # libpath try: - if (sys.version_info.major != 3) or (sys.version_info.minor < 5): - raise Exception("You must run Syncplay with Python 3.5 or newer!") + if (sys.version_info.major != 3) or (sys.version_info.minor < 4): + raise Exception("You must run Syncplay with Python 3.4 or newer!") except AttributeError: import warnings - warnings.warn("You must run Syncplay with Python 3.5 or newer!") + warnings.warn("You must run Syncplay with Python 3.4 or newer!") from twisted.internet import reactor