AppVeyor: migrate from conda to native Python

This commit is contained in:
albertosottile 2018-06-18 17:02:03 +02:00
parent 6b515e671c
commit 2ddc756a61
4 changed files with 32 additions and 31 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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

View File

@ -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