Skip to content

Commit 864f093

Browse files
authored
Fix: allow conda builds with Python 3.5 (#56)
Use f2py.exe for F2PY if it exists; this is the case for Numpy 1.16, which has been packaged for Python 3.6 and 3.7 in conda or conda-forge. If f2py.exe is not found, use f2py.bat; this is the case for Numpy 1.15, which has been pacakge for Python 3.5. Use pin_compatible for numpy version requirements; at time of this check-in, this builds against Numpy 1.9.3 on Linux, but tests against 1.16.
1 parent dca5e80 commit 864f093

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

conda-recipe-openblas/bld.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ RD /S /Q _skbuild
88
set BLAS_ROOT=%PREFIX%
99
set LAPACK_ROOT=%PREFIX%
1010
set NUMPY_INCLUDE=%PREFIX%\Include
11-
set F2PY=%PREFIX%\Scripts\f2py.exe
11+
:: Prefer f2py.exe, if it exists; this is provided by numpy 1.16 (and, we assume, later)
12+
if EXIST "%PREFIX%\Scripts\f2py.exe" (
13+
set F2PY=%PREFIX%\Scripts\f2py.exe
14+
) ELSE (
15+
:: Otherwise use f2py.bat, which is provided by numpy 1.15 and earlier
16+
set F2PY=%PREFIX%\Scripts\f2py.bat
17+
)
1218

1319
"%PYTHON%" setup.py install
1420

conda-recipe-openblas/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build:
1212
requirements:
1313
build:
1414
- python {{ PY_VER }}
15-
- numpy >=1.16
15+
- numpy
1616
- openblas >=0.3.0
1717
- {{ compiler('c') }} # [not osx]
1818
- gcc # [osx]
@@ -22,7 +22,7 @@ requirements:
2222
host:
2323
- python {{ PY_VER }}
2424
- flang # [win]
25-
- numpy >=1.16
25+
- numpy
2626
- openblas >=0.3.0
2727
- libgfortran-ng # [not-win]
2828
- libgcc-ng # [linux]
@@ -33,7 +33,7 @@ requirements:
3333

3434
run:
3535
- python {{ PY_VER }}
36-
- numpy >=1.16
36+
- {{ pin_compatible('numpy') }}
3737
- openblas >=0.3.0
3838
- libgfortran-ng # [not win]
3939
- libgcc-ng # [linux]

conda-recipe/bld.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ RD /S /Q _skbuild
88
set BLAS_ROOT=%PREFIX%
99
set LAPACK_ROOT=%PREFIX%
1010
set NUMPY_INCLUDE=%PREFIX%\Include
11-
set F2PY=%PREFIX%\Scripts\f2py.exe
11+
:: Prefer f2py.exe, if it exists; this is provided by numpy 1.16 (and, we assume, later)
12+
if EXIST "%PREFIX%\Scripts\f2py.exe" (
13+
set F2PY=%PREFIX%\Scripts\f2py.exe
14+
) ELSE (
15+
:: Otherwise use f2py.bat, which is provided by numpy 1.15 and earlier
16+
set F2PY=%PREFIX%\Scripts\f2py.bat
17+
)
1218

1319
"%PYTHON%" setup.py install
1420

conda-recipe/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requirements:
1616
# conda-forge might have the configuration in place for clang build and link?
1717
build:
1818
- python {{PY_VER}}
19-
- numpy >=1.16
19+
- numpy
2020
- {{ compiler('c') }} # [not osx]
2121
- gcc # [osx]
2222
- {{ compiler('fortran') }} # [linux]
@@ -25,7 +25,7 @@ requirements:
2525
host:
2626
- python {{ PY_VER }}
2727
- flang # [win]
28-
- numpy >=1.16
28+
- numpy
2929
- mkl
3030
- libgfortran-ng # [not win]
3131
- libgcc-ng # [linux]
@@ -37,7 +37,7 @@ requirements:
3737

3838
run:
3939
- python {{ PY_VER }}
40-
- numpy >=1.16
40+
- {{ pin_compatible('numpy') }}
4141
- mkl
4242
- libgfortran-ng # [not win]
4343
- libgcc-ng # [linux]

0 commit comments

Comments
 (0)