Dropped problematic init step

It was performed before repos cloned so no resource available (including
the script!)
This commit is contained in:
Daniele Varrazzo 2019-04-15 03:51:31 +01:00
parent fda738c90d
commit 591476621c
2 changed files with 17 additions and 27 deletions

View File

@ -49,31 +49,28 @@ cache:
- C:\Others -> scripts\appveyor.cache_rebuild - C:\Others -> scripts\appveyor.cache_rebuild
# Script called before repo cloning # Script called before repo cloning
init: # init:
# TODO: move functionalities out of init to drop this fetch problem
- curl -fsSL -o "C:\\appveyor.py" https://raw.githubusercontent.com/psycopg/psycopg2/%APPVEYOR_REPO_COMMIT%/scripts/appveyor.py
- "%PYEXE% C:\\appveyor.py init"
# Repository gets cloned, Cache is restored # Repository gets cloned, Cache is restored
install: install:
- "%PYEXE% C:\\appveyor.py install" - "%PYEXE% scripts\\appveyor.py install"
# PostgreSQL server starts now # PostgreSQL server starts now
build: off build: off
build_script: build_script:
- "%PYEXE% C:\\appveyor.py build_script" - "%PYEXE% scripts\\appveyor.py build_script"
after_build: after_build:
- "%PYEXE% C:\\appveyor.py after_build" - "%PYEXE% scripts\\appveyor.py after_build"
before_test: before_test:
- "%PYEXE% C:\\appveyor.py before_test" - "%PYEXE% scripts\\appveyor.py before_test"
test_script: test_script:
- "%PYEXE% C:\\appveyor.py test_script" - "%PYEXE% scripts\\appveyor.py test_script"
# vim: set ts=4 sts=4 sw=4: # vim: set ts=4 sts=4 sw=4:

View File

@ -64,23 +64,15 @@ def setup_env():
) )
# Fix problem with VS2010 Express 64bit missing vcvars64.bat # Fix problem with VS2010 Express 64bit missing vcvars64.bat
# Note: repository not cloned at this point, so need to fetch
# file another way
if vs_ver() == '10.0': if vs_ver() == '10.0':
if not os.path.exists( if not os.path.exists(
os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat") os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat")
): ):
logger.info("Fixing VS2010 Express and 64bit builds") logger.info("Fixing VS2010 Express and 64bit builds")
with urlopen( shutil.copy(
"https://raw.githubusercontent.com/psycopg/psycopg2/" os.path.join(clone_dir(), r"scripts\vcvars64-vs2010.bat"),
"master/scripts/vcvars64-vs2010.bat" os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat"),
) as f: )
data = f.read()
with open(
os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat"), 'w'
) as f:
f.write(data)
logger.info("Configuring compiler") logger.info("Configuring compiler")
bat_call( bat_call(
@ -100,7 +92,7 @@ def python_info():
) )
def step_init(): def step_install():
python_info() python_info()
# The program rc.exe on 64bit with some versions look in the wrong path # The program rc.exe on 64bit with some versions look in the wrong path
@ -122,12 +114,9 @@ def step_init():
print("max_prepared_transactions = 10", file=f) print("max_prepared_transactions = 10", file=f)
def step_install(): def step_build_script():
build_openssl() build_openssl()
build_libpq() build_libpq()
def step_build_script():
build_psycopg() build_psycopg()
@ -285,7 +274,7 @@ $config->{openssl} = "%s";
def build_psycopg(): def build_psycopg():
os.chdir(r"C:\Project") os.chdir(clone_dir())
# Find the pg_config just built # Find the pg_config just built
path = os.pathsep.join( path = os.pathsep.join(
@ -472,6 +461,10 @@ def vs_ver(pyver=None):
return vsver return vsver
def clone_dir():
return r"C:\Project"
def pg_dir(): def pg_dir():
return r"C:\Program Files\PostgreSQL\9.6" return r"C:\Program Files\PostgreSQL\9.6"