Skip to content

Commit 416e6f3

Browse files
authored
Merge pull request #305 from IntelPython/drop-mkl-service-dependency
Make `mkl-service` an optional dependency
2 parents 7a2778d + f844b84 commit 416e6f3

7 files changed

Lines changed: 27 additions & 17 deletions

File tree

.github/workflows/build_pip.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ jobs:
4444

4545
- name: Install MKL
4646
run: |
47-
conda install mkl-devel mkl-service
48-
python -c "import sys; print(sys.executable)"
49-
which python
50-
python -c "import mkl; print(mkl.__file__)"
47+
conda install mkl-devel
5148
5249
- name: Build conda package
5350
run: |

.github/workflows/conda-package-cf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
- name: Install mkl_fft
144144
run: |
145145
CHANNELS=(-c "$GITHUB_WORKSPACE"/channel ${{ env.CHANNELS }})
146-
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} ${{ matrix.numpy }} "$PACKAGE_NAME" pytest scipy "${CHANNELS[@]}"
146+
conda create -n ${{ env.TEST_ENV_NAME }} python=${{ matrix.python }} ${{ matrix.numpy }} "$PACKAGE_NAME" pytest scipy mkl-service "${CHANNELS[@]}"
147147
# Test installed packages
148148
conda list -n ${{ env.TEST_ENV_NAME }}
149149
@@ -318,7 +318,7 @@ jobs:
318318
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
319319
SET PACKAGE_VERSION=%%F
320320
)
321-
SET "TEST_DEPENDENCIES=pytest scipy"
321+
SET "TEST_DEPENDENCIES=pytest scipy mkl-service"
322322
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} ${{ matrix.numpy }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
323323
324324
- name: Report content of test environment

.github/workflows/conda-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
run: |
144144
CHANNELS=(-c "$GITHUB_WORKSPACE"/channel ${{ env.CHANNELS }})
145145
conda create -n ${{ env.TEST_ENV_NAME }} "$PACKAGE_NAME"=${{ env.PACKAGE_VERSION }} python=${{ matrix.python }} pytest "${CHANNELS[@]}"
146-
conda install -n ${{ env.TEST_ENV_NAME }} "scipy>=1.10" "${CHANNELS[@]}"
146+
conda install -n ${{ env.TEST_ENV_NAME }} "scipy>=1.10" "mkl-service" "${CHANNELS[@]}"
147147
# Test installed packages
148148
conda list -n ${{ env.TEST_ENV_NAME }}
149149
@@ -308,7 +308,7 @@ jobs:
308308
)
309309
SET "TEST_DEPENDENCIES=pytest"
310310
conda install -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %TEST_DEPENDENCIES% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
311-
conda install -n ${{ env.TEST_ENV_NAME }} scipy -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
311+
conda install -n ${{ env.TEST_ENV_NAME }} scipy mkl-service -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
312312
}
313313
- name: Report content of test environment
314314
shell: cmd /C CALL {0}

conda-recipe-cf/meta.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ requirements:
2626
run:
2727
- python
2828
- python-gil # [py>=314]
29-
- mkl-service
29+
- {{ pin_compatible('mkl') }}
3030
- numpy
3131

3232
test:
@@ -35,6 +35,7 @@ test:
3535
requires:
3636
- pytest
3737
- scipy >=1.10
38+
- mkl-service
3839
imports:
3940
- mkl_fft
4041
- mkl_fft.interfaces

conda-recipe/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ requirements:
4040
run:
4141
- python
4242
- python-gil # [py>=314]
43-
- mkl-service
43+
- {{ pin_compatible('mkl') }}
4444
{% if use_numpy_base %}
4545
- numpy-base
4646
{% else %}
@@ -52,8 +52,8 @@ test:
5252
- pytest -v --pyargs mkl_fft
5353
requires:
5454
- pytest
55-
# This is a temporary python restriction
56-
- scipy >=1.10 # [py<314]
55+
- scipy >=1.10
56+
- mkl-service
5757
imports:
5858
- mkl_fft
5959
- mkl_fft.interfaces

mkl_fft/interfaces/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,22 @@
2525

2626
from . import numpy_fft
2727

28-
# find scipy, not scipy.fft, to avoid circular dependency
28+
__all__ = ["numpy_fft"]
29+
2930
try:
3031
import scipy
32+
33+
del scipy
3134
except ImportError:
3235
pass
3336
else:
34-
from . import scipy_fft
37+
try:
38+
import mkl
39+
40+
del mkl
41+
except ImportError:
42+
pass
43+
else:
44+
from . import scipy_fft
45+
46+
__all__.append("scipy_fft")

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ classifiers = [
5050
"Operating System :: POSIX",
5151
"Operating System :: Unix"
5252
]
53-
dependencies = ["numpy>=1.26.4", "mkl-service"]
53+
dependencies = ["numpy>=1.26.4", "mkl"]
5454
description = "MKL-based FFT transforms for NumPy arrays"
5555
dynamic = ["version"]
5656
keywords = ["DFTI", "FFT", "Fourier", "MKL"]
@@ -60,8 +60,8 @@ readme = {file = "README.md", content-type = "text/markdown"}
6060
requires-python = ">=3.10,<3.15"
6161

6262
[project.optional-dependencies]
63-
scipy_interface = ["scipy>=1.10"]
64-
test = ["pytest", "scipy>=1.10"]
63+
scipy_interface = ["scipy>=1.10", "mkl-service"]
64+
test = ["pytest", "scipy>=1.10", "mkl-service"]
6565

6666
[project.urls]
6767
Download = "http://github.com/IntelPython/mkl_fft"

0 commit comments

Comments
 (0)