From 591476621caf6786a84606817982bfb97a375238 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 15 Apr 2019 03:51:31 +0100 Subject: [PATCH] Dropped problematic init step It was performed before repos cloned so no resource available (including the script!) --- .appveyor.yml | 15 ++++++--------- scripts/appveyor.py | 29 +++++++++++------------------ 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0a8bcde6..96991a69 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -49,31 +49,28 @@ cache: - C:\Others -> scripts\appveyor.cache_rebuild # Script called before repo cloning -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" +# init: # Repository gets cloned, Cache is restored install: - - "%PYEXE% C:\\appveyor.py install" + - "%PYEXE% scripts\\appveyor.py install" # PostgreSQL server starts now build: off build_script: - - "%PYEXE% C:\\appveyor.py build_script" + - "%PYEXE% scripts\\appveyor.py build_script" after_build: - - "%PYEXE% C:\\appveyor.py after_build" + - "%PYEXE% scripts\\appveyor.py after_build" before_test: - - "%PYEXE% C:\\appveyor.py before_test" + - "%PYEXE% scripts\\appveyor.py before_test" test_script: - - "%PYEXE% C:\\appveyor.py test_script" + - "%PYEXE% scripts\\appveyor.py test_script" # vim: set ts=4 sts=4 sw=4: diff --git a/scripts/appveyor.py b/scripts/appveyor.py index dda6c583..2fdb3606 100755 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -64,23 +64,15 @@ def setup_env(): ) # 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 not os.path.exists( os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat") ): logger.info("Fixing VS2010 Express and 64bit builds") - with urlopen( - "https://raw.githubusercontent.com/psycopg/psycopg2/" - "master/scripts/vcvars64-vs2010.bat" - ) as f: - data = f.read() - - with open( - os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat"), 'w' - ) as f: - f.write(data) + shutil.copy( + os.path.join(clone_dir(), r"scripts\vcvars64-vs2010.bat"), + os.path.join(vc_dir(), r"bin\amd64\vcvars64.bat"), + ) logger.info("Configuring compiler") bat_call( @@ -100,7 +92,7 @@ def python_info(): ) -def step_init(): +def step_install(): python_info() # 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) -def step_install(): +def step_build_script(): build_openssl() build_libpq() - - -def step_build_script(): build_psycopg() @@ -285,7 +274,7 @@ $config->{openssl} = "%s"; def build_psycopg(): - os.chdir(r"C:\Project") + os.chdir(clone_dir()) # Find the pg_config just built path = os.pathsep.join( @@ -472,6 +461,10 @@ def vs_ver(pyver=None): return vsver +def clone_dir(): + return r"C:\Project" + + def pg_dir(): return r"C:\Program Files\PostgreSQL\9.6"