Skip to content

Commit d321b0d

Browse files
committed
remove mkl-service as a requirement, replacing with mkl
mkl-service is now an optional requirement, needed when the scipy interface is installed
1 parent 32ead19 commit d321b0d

9 files changed

Lines changed: 34 additions & 23 deletions

File tree

.github/workflows/build-with-clang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Install mkl_fft dependencies
5757
run: |
58-
pip install meson-python ninja cython cmake
58+
pip install meson-python ninja cython cmake mkl
5959
pip install ${{ matrix.numpy_version }}
6060
6161
- name: List oneAPI folder content

.github/workflows/build-with-standard-clang.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: Install mkl_fft dependencies
4949
run: |
50-
pip install meson-python ninja cmake cython mkl-service
50+
pip install meson-python ninja cmake cython mkl-
5151
pip install mkl-devel
5252
pip install ${{ matrix.numpy_version }}
5353
@@ -58,7 +58,7 @@ jobs:
5858
5959
- name: Run mkl_fft tests
6060
run: |
61-
pip install pytest
61+
pip install pytest scipy mkl-service
6262
# mkl_fft cannot be installed in editable mode, we need
6363
# to change directory before importing it and running tests
6464
cd ..

.github/workflows/build_pip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939

4040
- name: Install MKL
4141
run: |
42-
conda install mkl-devel mkl-service
42+
conda install mkl-devel mkl
4343
4444
- name: Build conda package
4545
run: |
4646
pip install --no-cache-dir meson-python ninja cmake cython
4747
pip install --no-cache-dir numpy ${{ matrix.use_pre }}
4848
pip install -e ".[test]" --no-build-isolation --verbose
49-
pip install scipy pytest
49+
pip install scipy pytest mkl-service
5050
pip list
5151
python -m pytest -v mkl_fft/tests

.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
@@ -29,7 +29,7 @@ requirements:
2929
run:
3030
- python
3131
- python-gil # [py>=314]
32-
- mkl-service
32+
- {{ pin_compatible('mkl') }}
3333
- numpy
3434

3535
test:
@@ -38,6 +38,7 @@ test:
3838
requires:
3939
- pytest
4040
- scipy >=1.10
41+
- mkl-service
4142
imports:
4243
- mkl_fft
4344
- mkl_fft.interfaces

conda-recipe/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ requirements:
4343
run:
4444
- python
4545
- python-gil # [py>=314]
46-
- mkl-service
46+
- {{ pin_compatible('mkl') }}
4747
{% if use_numpy_base %}
4848
- numpy-base
4949
{% else %}
@@ -55,8 +55,8 @@ test:
5555
- pytest -v --pyargs mkl_fft
5656
requires:
5757
- pytest
58-
# This is a temporary python restriction
59-
- scipy >=1.10 # [py<314]
58+
- scipy >=1.10
59+
- mkl-service
6060
imports:
6161
- mkl_fft
6262
- mkl_fft.interfaces

mkl_fft/interfaces/__init__.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,22 @@
2323
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2424
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525

26+
import importlib.util
27+
import warnings
28+
2629
from . import numpy_fft
2730

28-
# find scipy, not scipy.fft, to avoid circular dependency
29-
try:
30-
import scipy
31-
except ImportError:
32-
pass
33-
else:
34-
from . import scipy_fft
31+
__all__ = ["numpy_fft"]
32+
33+
_has_scipy = importlib.util.find_spec("scipy") is not None
34+
_has_mkl_service = importlib.util.find_spec("mkl") is not None
35+
36+
if _has_scipy:
37+
if not _has_mkl_service:
38+
pass
39+
else:
40+
from . import scipy_fft
41+
42+
__all__.append("scipy_fft")
43+
44+
del importlib, warnings, _has_scipy, _has_mkl_service

pyproject.toml

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

6767
[project.optional-dependencies]
68-
scipy_interface = ["scipy>=1.10"]
69-
test = ["pytest", "scipy>=1.10"]
68+
scipy_interface = ["scipy>=1.10", "mkl-service"]
69+
test = ["pytest", "scipy>=1.10", "mkl-service"]
7070

7171
[project.urls]
7272
Download = "http://github.com/IntelPython/mkl_fft"

0 commit comments

Comments
 (0)