Skip to content

Commit 772be30

Browse files
committed
test release to testpypi 3.2.6.10
1 parent abf5516 commit 772be30

2 files changed

Lines changed: 39 additions & 32 deletions

File tree

.github/workflows/bld_wheels_and_upload.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v5
2424
- name: Build wheels
25-
uses: pypa/cibuildwheel@v3.1.4
25+
uses: pypa/cibuildwheel@v3.4.1
2626
env:
2727
CIBW_BUILD: "*-win_amd64"
2828
CIBW_SKIP: "cp38-*"
2929

3030
- name: Inject ibm_db_dll.pth into wheels
3131
run: python scripts/inject_pth_into_wheel.py wheelhouse
3232

33-
- uses: actions/upload-artifact@v4
33+
- uses: actions/upload-artifact@v6
3434
with:
3535
name: ibmdb-wheels64-${{ matrix.os }}
3636
path: wheelhouse/*.whl
@@ -45,15 +45,15 @@ jobs:
4545
steps:
4646
- uses: actions/checkout@v5
4747
- name: Build wheels
48-
uses: pypa/cibuildwheel@v3.1.4
48+
uses: pypa/cibuildwheel@v3.4.1
4949
env:
5050
CIBW_BUILD: "*-win32"
5151
CIBW_SKIP: "cp38-*"
5252

5353
- name: Inject ibm_db_dll.pth into wheels
5454
run: python scripts/inject_pth_into_wheel.py wheelhouse
5555

56-
- uses: actions/upload-artifact@v4
56+
- uses: actions/upload-artifact@v6
5757
with:
5858
name: ibmdb-wheels32-${{ matrix.os }}
5959
path: wheelhouse/*.whl
@@ -68,7 +68,7 @@ jobs:
6868
steps:
6969
- uses: actions/checkout@v5
7070
- name: Build wheels
71-
uses: pypa/cibuildwheel@v3.1.4
71+
uses: pypa/cibuildwheel@v3.4.1
7272
env:
7373
CIBW_ARCHS_LINUX: "x86_64 i686"
7474
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
@@ -88,7 +88,7 @@ jobs:
8888
--wheel-dir {dest_dir}
8989
{wheel}
9090

91-
- uses: actions/upload-artifact@v4
91+
- uses: actions/upload-artifact@v6
9292
with:
9393
name: ibmdb-wheels-${{ matrix.os }}
9494
path: wheelhouse/*.whl
@@ -103,12 +103,12 @@ jobs:
103103
steps:
104104
- uses: actions/checkout@v5
105105
- name: Build wheels
106-
uses: pypa/cibuildwheel@v3.1.4
106+
uses: pypa/cibuildwheel@v3.4.1
107107
env:
108108
CIBW_SKIP: "cp38-*"
109109
MACOSX_DEPLOYMENT_TARGET: 14.0
110110

111-
- uses: actions/upload-artifact@v4
111+
- uses: actions/upload-artifact@v6
112112
with:
113113
name: ibmdb-wheelsarm64
114114
path: wheelhouse/*.whl
@@ -123,13 +123,13 @@ jobs:
123123
steps:
124124
- uses: actions/checkout@v5
125125
- name: Build wheels
126-
uses: pypa/cibuildwheel@v3.1.4
126+
uses: pypa/cibuildwheel@v3.4.1
127127
env:
128128
CIBW_ARCHS: "x86_64"
129129
CIBW_SKIP: "cp38-*"
130130
MACOSX_DEPLOYMENT_TARGET: 10.15
131131

132-
- uses: actions/upload-artifact@v4
132+
- uses: actions/upload-artifact@v6
133133
with:
134134
name: ibmdb-wheelsx86-${{ matrix.os }}
135135
path: wheelhouse/*.whl
@@ -155,7 +155,7 @@ jobs:
155155
rm -rf "$DIRNAME"
156156
157157
- name: Upload sdist
158-
uses: actions/upload-artifact@v4
158+
uses: actions/upload-artifact@v6
159159
with:
160160
name: ibmdb-sdist
161161
path: dist/*.tar.gz
@@ -173,33 +173,33 @@ jobs:
173173
#upload to PyPI on every tag starting with 'v'
174174
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
175175
steps:
176-
- uses: actions/download-artifact@v5
176+
- uses: actions/download-artifact@v7
177177
with:
178178
path: dist
179179
pattern: ibmdb-*
180180
merge-multiple: true
181181

182182
- name: Publish distribution to PyPI
183183
if: startsWith(github.ref, 'refs/tags')
184-
uses: pypa/gh-action-pypi-publish@release/v1.12
184+
uses: pypa/gh-action-pypi-publish@release/v1.13
185185

186186
upload_testpypi:
187187
needs: [build_wheels_windows_64, build_wheels_windows_32, build_wheels_linux, build_wheels_macos_arm64, build_wheels_macos_x86, build_sdist]
188188
runs-on: ubuntu-latest
189189
permissions:
190190
id-token: write
191191

192-
#upload to TestPyPI on push to test_dll_issue branch
193-
if: github.event_name == 'push' && github.ref == 'refs/heads/test_dll_issue'
192+
#upload to TestPyPI on push to fix_dll_error_issue branch
193+
if: github.event_name == 'push' && github.ref == 'refs/heads/fix_dll_error_issue'
194194
steps:
195-
- uses: actions/download-artifact@v5
195+
- uses: actions/download-artifact@v7
196196
with:
197197
path: dist
198198
pattern: ibmdb-*
199199
merge-multiple: true
200200

201201
- name: Publish distribution to TestPyPI
202-
uses: pypa/gh-action-pypi-publish@release/v1.12
202+
uses: pypa/gh-action-pypi-publish@release/v1.13
203203
with:
204204
repository-url: https://test.pypi.org/legacy/
205205
verbose: true

README.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,38 @@ pip install ibm_db --no-binary :all: --no-cache-dir
119119

120120
- When ibm_db get installed from wheel package, you can find clidriver under site_packages directory of Python. You need to copy license file under `site_packages/clidriver/license` to be effective, if any.
121121

122-
**Note:** For windows after installing ibm_db, recieves the below error when we try to import ibm_db :
122+
**Windows DLL resolution (Python 3.8+):**
123+
124+
Since Python 3.8, the `PATH` environment variable is no longer used for DLL resolution on Windows (see https://bugs.python.org/issue36085). The `ibm_db` package now handles this **automatically** by installing an `ibm_db_dll.pth` file into `site-packages`. This file runs at Python startup and registers the clidriver `bin` directory via `os.add_dll_directory()`, so `import ibm_db` works out of the box.
125+
126+
If `IBM_DB_HOME` is set, the `.pth` file uses `%IBM_DB_HOME%\bin`; otherwise it uses the bundled `site-packages\clidriver\bin`.
127+
128+
**If you still see `ImportError: DLL load failed` after a fresh install**, verify that the `.pth` file exists:
123129

124-
```>python
125-
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
126-
Type "help", "copyright", "credits" or "license" for more information.
127-
>>> import ibm_db
128-
Traceback (most recent call last):
129-
File "<stdin>", line 1, in <module>
130-
ImportError: DLL load failed while importing ibm_db: The specified module could not be found.
131-
>>>
130+
```
131+
python -c "import os, sysconfig; print(os.path.isfile(os.path.join(sysconfig.get_path('purelib'), 'ibm_db_dll.pth')))"
132132
```
133133

134-
We need to make sure to set dll path of dependent library of clidriver before importing the module as:
134+
If it prints `False`, reinstall ibm_db:
135135

136136
```
137+
pip uninstall ibm_db
138+
pip install ibm_db
139+
```
140+
141+
**Manual fallback:** If the automatic fix does not work in your environment, you can set the DLL path directly in your code before importing the module:
142+
143+
```python
137144
import os
138145
os.add_dll_directory('path to clidriver installation until bin')
139146
import ibm_db
140-
141-
e.g:
142-
os.add_dll_directory('C:\\Program Files\\IBM\\CLIDRIVER\\bin')
143-
import ibm_db
144147
```
145148

146-
Refer https://bugs.python.org/issue36085 for more details.
149+
To find your clidriver `bin` path, run:
150+
151+
```
152+
python -c "import os, site, sysconfig; paths=[os.path.join(site.getusersitepackages(),'clidriver','bin'), os.path.join(sysconfig.get_path('purelib'),'clidriver','bin')]; print(next((p for p in paths if os.path.isdir(p)), 'clidriver not found - reinstall ibm_db'))"
153+
```
147154

148155
- <a name="docker"></a>For installing ibm_db on docker Linux container, you can refer as below:
149156

0 commit comments

Comments
 (0)