]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Install Postgres in the image to build Windows packages
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 29 Jun 2021 22:55:38 +0000 (23:55 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 30 Jun 2021 00:48:41 +0000 (01:48 +0100)
.github/workflows/packages.yml
tools/build/wheel_windows_before_all.ps1 [new file with mode: 0755]

index 4cfe260355159eac058faaf103c9b971ceb176c8..8e1d841d724dbcb8353964ec388f66ab17296da4 100644 (file)
@@ -121,6 +121,8 @@ jobs:
         env:
           CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}}
           CIBW_ARCHS_WINDOWS: AMD64 x86
+          CIBW_BEFORE_ALL_WINDOWS: >-
+            powershell.exe tools\build\wheel_windows_before_all.ps1
           CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
           CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
             delvewheel repair -w {dest_dir} {wheel}
diff --git a/tools/build/wheel_windows_before_all.ps1 b/tools/build/wheel_windows_before_all.ps1
new file mode 100755 (executable)
index 0000000..eb9b887
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Configure the environment needed to build wheel packages on Windows.
+# This script is designed to be used by cibuildwheel as CIBW_BEFORE_ALL_WINDOWS
+
+# Set-PSDebug -Trace 1
+
+python -c "import os; print(os.environ['PATH'])"
+
+# choco install postgresql13 --params '/Password:password'
+
+# From: https://www.enterprisedb.com/download-postgresql-binaries
+Invoke-WebRequest `
+    -Uri "https://sbp.enterprisedb.com/getfile.jsp?fileid=1257716" `
+    -OutFile C:\postgresql-13.3-2-windows-x64-binaries.zip
+
+Expand-Archive `
+    -LiteralPath C:\postgresql-13.3-2-windows-x64-binaries.zip `
+    -DestinationPath C:\
+
+# python -c "import os; print(os.environ['PATH'])"
+
+# pg_config
+
+# dir C:/STRAWB~1/c/bin
+# dir C:/STRAWB~1/c/lib
+
+dir C:\pgsql\bin
+C:\pgsql\bin\pg_config