mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-29 17:39:49 +03:00
Merge branch 'ci/build-m1-wheel' of github.com:armenzg/psycopg2 into ci/build-m1-wheel
This commit is contained in:
commit
50d74a38c7
15
.github/workflows/m1.yml
vendored
15
.github/workflows/m1.yml
vendored
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
# This is temporary; We will need to move to packages.yml
|
||||
name: Build packages (M1)
|
||||
on:
|
||||
- push
|
||||
|
||||
|
||||
jobs:
|
||||
# This only uploads the arm64 wheels for Apple M1 Silicon usage
|
||||
build-macos-arm64:
|
||||
|
@ -23,7 +23,7 @@ jobs:
|
|||
# Read about options here https://cibuildwheel.readthedocs.io/en/stable/options
|
||||
env:
|
||||
CIBW_ARCHS: arm64
|
||||
# XXX: temp: faster
|
||||
# XXX: temp: only one version to build
|
||||
CIBW_BUILD: cp39-macosx_arm64
|
||||
# It silences a warning since we can't test on Apple Silicon runners
|
||||
CIBW_TEST_SKIP: "*-macosx_arm64"
|
||||
|
@ -32,6 +32,7 @@ jobs:
|
|||
|
||||
- run: |
|
||||
ls -l
|
||||
ls -l wheelhouse
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
|
@ -40,11 +41,7 @@ jobs:
|
|||
path: ./wheelhouse/*.whl
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-10.15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.8']
|
||||
runs-on: macos-11.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repos
|
||||
|
@ -53,7 +50,7 @@ jobs:
|
|||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: 3.8
|
||||
|
||||
- name: Build packages
|
||||
run: ./scripts/build/build_macos.sh
|
||||
|
@ -62,7 +59,7 @@ jobs:
|
|||
PSYCOPG2_TESTDB: postgres
|
||||
PSYCOPG2_TEST_FAST: 1
|
||||
ARCHFLAGS: "-arch arm64"
|
||||
_PYTHON_HOST_PLATFORM: "macosx-11.0-arm64"
|
||||
_PYTHON_HOST_PLATFORM: macosx-11.0-arm64
|
||||
|
||||
- run: |
|
||||
ls -l
|
||||
|
|
32
.github/workflows/packages.yml
vendored
32
.github/workflows/packages.yml
vendored
|
@ -3,7 +3,6 @@ name: Build packages
|
|||
on:
|
||||
- workflow_dispatch
|
||||
|
||||
|
||||
jobs:
|
||||
build-sdist:
|
||||
strategy:
|
||||
|
@ -51,7 +50,6 @@ jobs:
|
|||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
|
||||
build-manylinux:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -107,13 +105,12 @@ jobs:
|
|||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-10.15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.6', '3.7', '3.8', '3.9']
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- name: Checkout repos
|
||||
|
@ -137,30 +134,3 @@ jobs:
|
|||
name: packages_macos
|
||||
path: |
|
||||
dist/*/*${{ matrix.platform }}.whl
|
||||
|
||||
# This only uploads the arm64 wheels for Apple M1 Silicon usage
|
||||
build-macos-arm64:
|
||||
runs-on: macos-11.0
|
||||
name: "build-macos (3.8-3.10, arm64)"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Start postgresql service
|
||||
# This skips updating brew when installing a package
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
run: |
|
||||
brew services start postgresql
|
||||
|
||||
# This builds all possible Python versions (currently, 3.8 to 3.10)
|
||||
- uses: pypa/cibuildwheel@v2.1.1
|
||||
# Read about options here https://cibuildwheel.readthedocs.io/en/stable/options
|
||||
env:
|
||||
CIBW_ARCHS: arm64
|
||||
# This allows substitution within setup.py
|
||||
PACKAGE_NAME: psycopg2-binary
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: packages_macos_arm64
|
||||
path: ./wheelhouse/*.whl
|
||||
|
|
|
@ -55,10 +55,8 @@ fi
|
|||
cp ${wheeldir}/*.whl ${distdir}
|
||||
|
||||
# kill the libpq to make sure tests don't depend on it
|
||||
mv "$LIBPQ" "${LIBPQ}-bye"
|
||||
[[ -z "${LIBPQ:-}" ]] && mv "$LIBPQ" "${LIBPQ}-bye"
|
||||
|
||||
# XXX: Move this code into a test script
|
||||
if [[ $(uname -m) != 'arm64' ]]; then
|
||||
# Install and test the built wheel
|
||||
pip install ${PACKAGE_NAME:-psycopg2} --no-index -f "$distdir"
|
||||
|
||||
|
@ -74,7 +72,6 @@ if [[ $(uname -m) != 'arm64' ]]; then
|
|||
# fi
|
||||
|
||||
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|
||||
fi
|
||||
|
||||
# just because I'm a boy scout
|
||||
mv "${LIBPQ}-bye" "$LIBPQ"
|
||||
[[ -z "${LIBPQ:-}" ]] && mv "${LIBPQ}-bye" "$LIBPQ"
|
||||
|
|
Loading…
Reference in New Issue
Block a user