Skip to content

Commit

Permalink
update workflow file to fix macarm64 install issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalkjha committed Dec 30, 2024
1 parent c67d1bb commit 1213520
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
45 changes: 24 additions & 21 deletions .github/workflows/bld_wheels_and_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ jobs:
strategy:
matrix:
os: [windows-latest]

steps:
- uses: actions/[email protected]
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*-win_amd64"
CIBW_SKIP: "cp36-* pp*"

- uses: actions/[email protected]
with:
name: ibmdb-wheels64-${{ matrix.os }}
Expand All @@ -35,13 +37,15 @@ jobs:
strategy:
matrix:
os: [windows-latest]

steps:
- uses: actions/[email protected]
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "*-win32"
CIBW_SKIP: "cp36-* pp*"

- uses: actions/[email protected]
with:
name: ibmdb-wheels32-${{ matrix.os }}
Expand All @@ -53,6 +57,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/[email protected]
- name: Build wheels
Expand All @@ -73,51 +78,48 @@ jobs:
--exclude libdl.so.2
--wheel-dir {dest_dir}
{wheel}

- uses: actions/[email protected]
with:
name: ibmdb-wheels-${{ matrix.os }}
path: wheelhouse/*.whl

build_macos_arm64_wheels:
build_wheels_macos_arm64:
name: Build wheels on macOS ARM64
runs-on: macos-14
strategy:
matrix:
architecture: [arm64]

steps:
- uses: actions/[email protected]
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-*"
- name: Upload wheels
uses: actions/[email protected]
CIBW_SKIP: "cp36-* cp37-* cp38-* pp*"
MACOSX_DEPLOYMENT_TARGET: 14.0

- uses: actions/[email protected]
with:
name: ibmdb-wheelsarm64-${{ matrix.os }}
name: ibmdb-wheelsarm64
path: wheelhouse/*.whl

build_wheels_macos_x86:
name: Build wheels for macOS x86_64
runs-on: macos-13

strategy:
matrix:
architecture: [x86_64]

steps:
- uses: actions/[email protected]
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cibuildwheel # Install cibuildwheel to build the wheels
- name: Set macOS deployment target
run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV

- name: Build wheels with cibuildwheel
run: |
CIBW_ARCHS_MACOS="${{ matrix.architecture }}"
python -m cibuildwheel --platform macos --output-dir ./wheelhouse
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-* pp*"
MACOSX_DEPLOYMENT_TARGET: 10.15

- name: Upload wheels as artifacts
uses: actions/[email protected]
- uses: actions/[email protected]
with:
name: ibmdb-wheelsx86-${{ matrix.os }}
path: wheelhouse/*.whl
Expand Down Expand Up @@ -148,6 +150,7 @@ jobs:
rm -rf $PACKAGE
env:
VERSION: ${{ steps.version.outputs.VERSION}}

- name: Upload sdist
uses: actions/[email protected]
with:
Expand All @@ -156,7 +159,7 @@ jobs:


upload_pypi:
needs: [build_sdist,build_wheels_linux, build_wheels_windows_64,build_wheels_windows_32, build_macos_arm64_wheels, build_wheels_macos_x86]
needs: [build_wheels_windows_64, build_wheels_windows_32, build_wheels_linux, build_wheels_macos_arm64, build_wheels_macos_x86, build_sdist]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ or
pip install git+https://[email protected]/ibmdb/python-ibm_db.git
```
* `pip install ibm_db` installs python wheel images on Linux, Windows and MacOS(x64) for python v>=3.7
* MacOS(arm64) support python wheel images from python version 3.9 onwards.
* If wheel image is not available or for AIX and zLiux, native C++ code of ibm_db requires in-system compilation. For such case,
you should have a C++ compiler installed in the system. Make sure the commands `gcc --version` and `make --version` works
fine on Linux and MacOS system.
Expand Down Expand Up @@ -326,7 +327,7 @@ print('ODBC Test end')
## <a name="m1chip"></a> 3. ibm_db installation on MacOS M1/M2 Chip System (arm64 architecture)
**Important:
> [email protected].4 onwards supports native installation on MacOS ARM64(M* Chip/Apple Silicon Chip) system using clidriver/dsdriver version 12.1.0.
> [email protected].5 onwards supports native installation on MacOS ARM64(M* Chip/Apple Silicon Chip) system using clidriver/dsdriver version 12.1.0.
> You need **db2connect v12.1 license** to connect to z/OS or iSeries server from M1 Chip system.
### Installation:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ https://github.com/ibmdb/python-ibmdb/wiki/APIs
<a name="prereq"></a>
## Pre-requisites
Install Python 3.7 <= 3.13. The minimum python version supported by driver is python 3.7 and the latest version supported is python 3.13.
MacOS arm64 is supported Python 3.9 onwards.

### To install ibm_db on z/OS system

Expand All @@ -30,7 +31,7 @@ Please follow detailed installation instructions as documented here: [ibm_db Ins

### For MacOS M1/M2/ Apple Silicon chip system

**MacOS with Silicon Chip** - Supported from v3.2.4 onwards using v12.x clidriver.
**MacOS with Silicon Chip** - Supported from v3.2.5 onwards using v12.x clidriver.
**MacOS with Intel Chip** - Supported using v11.x clidriver only. By default v11.5.9 clidriver will get downloaded.

### Linux/Unix:
Expand Down Expand Up @@ -63,7 +64,7 @@ To install ibm_db from source code after clone from git, or to know the detialed
<a name="installation"></a>
## Installation

* Python **Wheels** are built for Linux, MacOS and Windows operating systems for multiple python versions (from python version 3.7 to 3.11). For other platforms, package gets installed from source distribution.
* Python **Wheels** are built for Linux, MacOS and Windows operating systems for multiple python versions (from python version 3.7 to 3.13). For other platforms, package gets installed from source distribution. For MaxOS arm64, python wheels are available from version 3.9 onwards.

You can install the driver using pip as:

Expand Down Expand Up @@ -191,8 +192,7 @@ conda install -c conda-forge ibm_db
## <a name="quick example"></a> Quick Example
```python
$ python
Python 3.6.5 (default, May 10 2018, 00:54:55)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux
Python 3.13.0 (main, Oct 7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ibm_db
>>> #For connecting to local database named pydev for user db2inst1 and password secret, use below example
Expand Down Expand Up @@ -444,7 +444,7 @@ If you intend to install the clidriver manually, Following are the details of th
|AIX | ppc |aix32_odbc_cli.tar.gz | Yes | V11.5.9 |
| | others |aix64_odbc_cli.tar.gz | Yes | V11.5.9 |
|Darwin | x64 |macos64_odbc_cli.tar.gz | Yes | Till V11.5.9 |
| arm64 |macarm64_odbc_cli.tar.gz | Yes | From V12.1.0 |
| | arm64 |macarm64_odbc_cli.tar.gz | Yes | From V12.1.0 |
|Linux | x64 |linuxx64_odbc_cli.tar.gz | Yes | V11.5.9 |
| | s390x |s390x64_odbc_cli.tar.gz | Yes | V11.5.9 |
| | s390 |s390_odbc_cli.tar.gz | Yes | V11.1 |
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel.macos]
[tool.cibuildwheel.macos]
repair-wheel-command = "delocate-wheel --ignore-missing-dependencies --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
skip = "cp36-macosx_x86_64"
skip = "cp36-* pp*"

0 comments on commit 1213520

Please sign in to comment.