Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b2f48a

Browse files
committed
BLD: only use openblas_support.make_init() in CI, fix paths
1 parent 446da4e commit 0b2f48a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

azure-steps-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ steps:
4949
displayName: 'Build NumPy'
5050

5151
- powershell: |
52-
# copy from c:/opt/openblas/openblas_dll to numpy/.libs to ensure it can
52+
# copy from c:/opt/openblas/openblas_dll to numpy/../numpy.libs to ensure it can
5353
# get loaded when numpy is imported (no RPATH on Windows)
5454
$target = $(python -c "import sysconfig; print(sysconfig.get_path('platlib'))")
55-
mkdir $target/numpy/.libs
56-
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy/.libs
55+
mkdir $target/numpy.libs
56+
copy C:/opt/openblas/openblas_dll/*.dll $target/numpy.libs
5757
displayName: 'Copy OpenBLAS DLL to site-packages'
5858

5959
- script: |

tools/openblas_support.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def get_members():
238238
def make_init(dirname):
239239
'''
240240
Create a _distributor_init.py file for OpenBlas
241+
242+
Obsoleted by the use of delvewheel in wheel building, which
243+
adds an equivalent snippet to numpy/__init__.py, but still useful in CI
241244
'''
242245
with open(os.path.join(dirname, '_distributor_init.py'), 'w') as fid:
243246
fid.write(textwrap.dedent("""
@@ -246,19 +249,19 @@ def make_init(dirname):
246249
Once a DLL is preloaded, its namespace is made available to any
247250
subsequent DLL. This file originated in the numpy-wheels repo,
248251
and is created as part of the scripts that build the wheel.
252+
249253
'''
250254
import os
251255
import glob
252256
if os.name == 'nt':
253-
# convention for storing / loading the DLL from
254-
# numpy/.libs/, if present
257+
# load any DLL from numpy/../numpy.libs/, if present
255258
try:
256259
from ctypes import WinDLL
257-
basedir = os.path.dirname(__file__)
258260
except:
259261
pass
260262
else:
261-
libs_dir = os.path.abspath(os.path.join(basedir, '.libs'))
263+
basedir = os.path.dirname(__file__)
264+
libs_dir = os.path.abspath(os.path.join(basedir, os.pardir, 'numpy.libs'))
262265
DLL_filenames = []
263266
if os.path.isdir(libs_dir):
264267
for filename in glob.glob(os.path.join(libs_dir,

tools/wheels/cibw_before_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ elif [[ $RUNNER_OS == "Windows" ]]; then
3636
# this location you need to alter that script.
3737
mkdir -p /c/opt/openblas/openblas_dll
3838

39-
PYTHONPATH=tools python -c "import openblas_support; openblas_support.make_init('numpy')"
4039
mkdir -p /c/opt/32/lib/pkgconfig
4140
mkdir -p /c/opt/64/lib/pkgconfig
4241
target=$(python -c "import tools.openblas_support as obs; plat=obs.get_plat(); ilp64=obs.get_ilp64(); target=f'openblas_{plat}.zip'; obs.download_openblas(target, plat, ilp64);print(target)")

0 commit comments

Comments
 (0)