Try again

This commit is contained in:
Armen Zambrano G 2021-09-08 14:56:39 -04:00
parent fe1165544c
commit 8d55da4074
3 changed files with 40 additions and 23 deletions

View File

@ -2,6 +2,8 @@
name: Build packages
on:
- workflow_dispatch
# XXX: Temp change while working on PR; remove with prettier changes
- pull_request
jobs:
build-sdist:
@ -137,24 +139,44 @@ jobs:
# This only uploads the arm64 wheels for Apple M1 silicon usage
build-macos-arm64:
runs-on: macos-10.15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
name: "build-macos (3.8-3.10 - arm64)"
matrix:
os: [macos-10.15, macos-11.0]
name: "build-${{ matrix.os }} - arm64)"
steps:
- uses: actions/checkout@v2
- name: Install pre-requisites
run: |
# brew install gnu-sed postgresql@13
brew install postgresql@13
brew services start postgresql
# gsed -i "s/^setup(name=\"psycopg2\"/setup(name=\"psycopg2-binary\"/" setup.py
# git diff
# This builds all possible Python versions (currently, 3.8 to 3.10)
- uses: pypa/cibuildwheel@v2.1.1
with:
output-dir: dist
# Read about options here https://cibuildwheel.readthedocs.io/en/stable/options
env:
CIBW_ARCHS_MACOS: arm64
# Skip testing the arm64 builds
CIBW_TEST_SKIP: "*:arm64"
CIBW_ARCHS: arm64
PACKAGE_NAME: psycopg2-binary
- name: Some tests
run: |
git diff
ls -l dist
pip install psycopg2-binary --no-index -f dist/
python -c "import psycopg2; print(psycopg2.__version__)"
python -c "import psycopg2; print(psycopg2.__libpq_version__)"
python -c "import psycopg2; print(psycopg2.extensions.libpq_version())"
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: packages_macos_arm64
name: packages_${{ matrix.os }}_arm64
path: |
dist/*macosx_11_0_arm64.whl

View File

@ -8,8 +8,8 @@
set -euo pipefail
set -x
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
prjdir="$( cd "${dir}/../.." && pwd )"
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
prjdir="$(cd "${dir}/../.." && pwd)"
brew install gnu-sed postgresql@13
@ -35,15 +35,9 @@ mkdir -p "$distdir"
# Install required python packages
pip install -U pip wheel delocate
# Replace the package name
if [[ "${PACKAGE_NAME:-}" ]]; then
gsed -i "s/^setup(name=\"psycopg2\"/setup(name=\"${PACKAGE_NAME}\"/" \
"${prjdir}/setup.py"
fi
# Build the wheels
wheeldir="${prjdir}/wheels"
pip wheel -w ${wheeldir} .
pip wheel --use-feature=in-tree-build -w ${wheeldir} .
delocate-listdeps ${wheeldir}/*.whl
# Check where is the libpq. I'm gonna kill it for testing

View File

@ -45,6 +45,7 @@ except ImportError:
# for a consistent versioning pattern.
PSYCOPG_VERSION = '2.9.1'
PSYCOPG_NAME = os.environ.get("PACKAGE_NAME", "psycopg2")
# note: if you are changing the list of supported Python version please fix
@ -545,7 +546,7 @@ except Exception:
print("failed to read readme: ignoring...")
readme = __doc__
setup(name="psycopg2",
setup(name=PSYCOPG_NAME,
version=PSYCOPG_VERSION,
author="Federico Di Gregorio",
author_email="fog@initd.org",