diff --git a/.appveyor.yml b/.appveyor.yml index 0106e048..b79302b8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,20 +11,22 @@ environment: matrix: # For Python versions available on Appveyor, see # https://www.appveyor.com/docs/windows-images-software/#python - - {PY_VER: "27", PY_ARCH: "32"} - - {PY_VER: "27", PY_ARCH: "64"} - - {PY_VER: "38", PY_ARCH: "32"} - - {PY_VER: "38", PY_ARCH: "64"} - - {PY_VER: "37", PY_ARCH: "32"} - - {PY_VER: "37", PY_ARCH: "64"} - - {PY_VER: "36", PY_ARCH: "32"} - - {PY_VER: "36", PY_ARCH: "64"} - - {PY_VER: "35", PY_ARCH: "32"} - - {PY_VER: "35", PY_ARCH: "64"} - - {PY_VER: "34", PY_ARCH: "32"} - - {PY_VER: "34", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019, PY_VER: "39", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019, PY_VER: "39", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "38", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "38", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "37", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "37", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "36", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "36", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "35", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "35", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "34", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "34", PY_ARCH: "64"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "27", PY_ARCH: "32"} + - {APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015, PY_VER: "27", PY_ARCH: "64"} - OPENSSL_VERSION: "1_1_1g" + OPENSSL_VERSION: "1_1_1h" POSTGRES_VERSION: "11_4" PSYCOPG2_TESTDB: psycopg2_test @@ -35,6 +37,9 @@ environment: PGPASSWORD: Password12! PGSSLMODE: require + # Add CWD to perl library path for PostgreSQL build on VS2019 + PERL5LIB: . + # Select according to the service enabled POSTGRES_DIR: C:\Program Files\PostgreSQL\9.6\ diff --git a/scripts/appveyor.cache_rebuild b/scripts/appveyor.cache_rebuild index 6b6f781a..432d68ee 100644 --- a/scripts/appveyor.cache_rebuild +++ b/scripts/appveyor.cache_rebuild @@ -9,10 +9,10 @@ To invalidate the cache, update this file and check it into git. Currently used modules built in the cache: OpenSSL - Version: 1.1.1d + Version: 1.1.1h PostgreSQL - Version: 11.5 + Version: 11.4 NOTE: to zap the cache manually you can also use: diff --git a/scripts/appveyor.py b/scripts/appveyor.py index dfb42d78..4b6cc85f 100755 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -17,6 +17,7 @@ import subprocess as sp from glob import glob from pathlib import Path from zipfile import ZipFile +from argparse import ArgumentParser from tempfile import NamedTemporaryFile from urllib.request import urlopen @@ -50,6 +51,7 @@ def setup_build_env(): path = [ str(opt.py_dir), str(opt.py_dir / 'Scripts'), + r'C:\Strawberry\Perl\bin', r'C:\Program Files\Git\mingw64\bin', os.environ['PATH'], ] @@ -475,7 +477,7 @@ def print_sha1_hashes(): logger.info("artifacts SHA1 hashes:") os.chdir(opt.package_dir / 'dist') - run_command([which('sha1sum'), '-b', f'psycopg2-*/*']) + run_command([which('sha1sum'), '-b', 'psycopg2-*/*']) def setup_ssh(): @@ -694,7 +696,7 @@ class Options: def py_ver(self): """The Python version to build as 2 digits string.""" rv = os.environ['PY_VER'] - assert rv in ('27', '34', '35', '36', '37', '38'), rv + assert rv in ('27', '34', '35', '36', '37', '38', '39'), rv return rv @property @@ -762,17 +764,25 @@ class Options: """ The path of the Visual C compiler. """ - return Path( - r"C:\Program Files (x86)\Microsoft Visual Studio %s\VC" - % self.vs_ver - ) + if self.vs_ver == '16.0': + path = Path( + r"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build" + ) + else: + path = Path( + r"C:\Program Files (x86)\Microsoft Visual Studio %s\VC" + % self.vs_ver + ) + return path @property def vs_ver(self): # https://wiki.python.org/moin/WindowsCompilers + # https://www.appveyor.com/docs/windows-images-software/#python # Py 2.7 = VS Ver. 9.0 (VS 2008) # Py 3.3, 3.4 = VS Ver. 10.0 (VS 2010) # Py 3.5--3.8 = VS Ver. 14.0 (VS 2015) + # Py 3.9 = VS Ver. 16.0 (VS 2019) vsvers = { '27': '9.0', '33': '10.0', @@ -781,6 +791,7 @@ class Options: '36': '14.0', '37': '14.0', '38': '14.0', + '39': '16.0', } return vsvers[self.py_ver] @@ -846,8 +857,6 @@ class Options: def parse_cmdline(): - from argparse import ArgumentParser - parser = ArgumentParser(description=__doc__) g = parser.add_mutually_exclusive_group()