From 7cd7b97d5d0f6c1ccb92d7931f09ef2ee695de1a Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 27 Oct 2020 11:48:27 +0100 Subject: [PATCH 1/4] First batch of changes to build on appveyor with Python 3.9 --- .appveyor.yml | 4 +++- scripts/appveyor.py | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0106e048..db14dbe0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ version : 2.x.{build} - +image: Visual Studio 2019 clone_folder: C:\Project environment: @@ -13,6 +13,8 @@ environment: # https://www.appveyor.com/docs/windows-images-software/#python - {PY_VER: "27", PY_ARCH: "32"} - {PY_VER: "27", PY_ARCH: "64"} + - {PY_VER: "39", PY_ARCH: "32"} + - {PY_VER: "39", PY_ARCH: "64"} - {PY_VER: "38", PY_ARCH: "32"} - {PY_VER: "38", PY_ARCH: "64"} - {PY_VER: "37", PY_ARCH: "32"} diff --git a/scripts/appveyor.py b/scripts/appveyor.py index dfb42d78..06f07445 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 @@ -475,7 +476,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 +695,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 @@ -770,9 +771,11 @@ class Options: @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 +784,7 @@ class Options: '36': '14.0', '37': '14.0', '38': '14.0', + '39': '16.0', } return vsvers[self.py_ver] @@ -846,8 +850,6 @@ class Options: def parse_cmdline(): - from argparse import ArgumentParser - parser = ArgumentParser(description=__doc__) g = parser.add_mutually_exclusive_group() From ec39e1e4063ca4e193d2ec59fdba07f40ab88654 Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Wed, 28 Oct 2020 12:50:57 -0600 Subject: [PATCH 2/4] Add VC 2019 path location --- scripts/appveyor.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/appveyor.py b/scripts/appveyor.py index 06f07445..36ee26a9 100755 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -763,10 +763,16 @@ 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): From 163dadb6c6d36673cbe36d0d5526fced397e8e0e Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Wed, 28 Oct 2020 13:15:23 -0600 Subject: [PATCH 3/4] Add Strawberry Perl to the path --- scripts/appveyor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/appveyor.py b/scripts/appveyor.py index 36ee26a9..4b6cc85f 100755 --- a/scripts/appveyor.py +++ b/scripts/appveyor.py @@ -51,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'], ] From 31b37685b7715956f72c1a42410e2022e1cc1b2f Mon Sep 17 00:00:00 2001 From: Jason Erickson Date: Thu, 29 Oct 2020 12:23:16 -0600 Subject: [PATCH 4/4] Settings for Py39/VS2019 builds + OpenSSL update --- .appveyor.yml | 35 ++++++++++++++++++---------------- scripts/appveyor.cache_rebuild | 4 ++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index db14dbe0..b79302b8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ version : 2.x.{build} -image: Visual Studio 2019 + clone_folder: C:\Project environment: @@ -11,22 +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: "39", PY_ARCH: "32"} - - {PY_VER: "39", 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 @@ -37,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: