From 36a187e8938591422e56ef65c698a72b07f1ccd7 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Tue, 25 Mar 2025 10:21:01 -0700 Subject: [PATCH 01/29] Update workflows to use .conda for conda package builds --- .github/workflows/conda-package-cf.yml | 8 ++++---- .github/workflows/conda-package.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 364ac5f..7ba973f 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -56,7 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2 + path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.conda build_windows: runs-on: windows-2019 @@ -94,7 +94,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2 + path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.conda test_linux: needs: build_linux @@ -123,7 +123,7 @@ jobs: run: | mkdir -p $GITHUB_WORKSPACE/channel/linux-64 conda index $GITHUB_WORKSPACE/channel || exit 1 - mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1 + mv ${PACKAGE_NAME}-*.conda $GITHUB_WORKSPACE/channel/linux-64 || exit 1 conda index $GITHUB_WORKSPACE/channel || exit 1 # Test channel conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json @@ -193,7 +193,7 @@ jobs: - name: Create conda channel run: | mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64 - move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.GITHUB_WORKSPACE }}\channel\win-64 + move ${{ env.PACKAGE_NAME }}-*.conda ${{ env.GITHUB_WORKSPACE }}\channel\win-64 conda index ${{ env.GITHUB_WORKSPACE }}/channel # Test channel conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 11f119b..e42b58c 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -56,7 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2 + path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.conda build_windows: runs-on: windows-2019 @@ -94,7 +94,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2 + path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.conda test_linux: needs: build_linux @@ -123,7 +123,7 @@ jobs: run: | mkdir -p $GITHUB_WORKSPACE/channel/linux-64 conda index $GITHUB_WORKSPACE/channel || exit 1 - mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1 + mv ${PACKAGE_NAME}-*.conda $GITHUB_WORKSPACE/channel/linux-64 || exit 1 conda index $GITHUB_WORKSPACE/channel || exit 1 # Test channel conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json @@ -193,7 +193,7 @@ jobs: - name: Create conda channel run: | mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64 - move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.GITHUB_WORKSPACE }}\channel\win-64 + move ${{ env.PACKAGE_NAME }}-*.conda ${{ env.GITHUB_WORKSPACE }}\channel\win-64 conda index ${{ env.GITHUB_WORKSPACE }}/channel # Test channel conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json From 9711f7990e6cbe2c0da47c9ca6a39bedad54487d Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Tue, 25 Mar 2025 10:48:08 -0700 Subject: [PATCH 02/29] Use `--numpy 2.0` --- .github/workflows/conda-package-cf.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 7ba973f..6bfe733 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -44,7 +44,7 @@ jobs: - name: Build conda package run: | CHANNELS="-c conda-forge --override-channels" - VERSIONS="--python ${{ matrix.python }} --numpy 2" + VERSIONS="--python ${{ matrix.python }} --numpy 2.0" TEST="--no-test" conda build \ @@ -89,7 +89,7 @@ jobs: - name: Install conda-build run: conda install conda-build - name: Build conda package - run: conda build --no-test --python ${{ matrix.python }} --numpy 2 -c conda-forge --override-channels conda-recipe-cf + run: conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c conda-forge --override-channels conda-recipe-cf - name: Upload artifact uses: actions/upload-artifact@v4 with: From b6a5bb4a2c5fb4ffd203d3fb5ea4e9f3cac14d90 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:30:28 -0700 Subject: [PATCH 03/29] Add pyproject.toml and migrate from setup.py --- pyproject.toml | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 81 +++++++------------------------------------------- 2 files changed, 92 insertions(+), 70 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7c255bf --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,81 @@ +#!/usr/bin/env python +# Copyright (c) 2017-2025, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +[build-system] +requires = ["setuptools>=64.0.0", "Cython", "numpy"] +build-backend = "setuptools.build_meta" + +[project] +name = "mkl_random" +dynamic = ["version"] +description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" +readme = { file = "README.md", content-type = "text/markdown" } +requires-python = ">=3.9,<3.13" +license = { text = "BSD" } +authors = [ + { name = "Intel Corporation", email = "scripting@intel.com" } +] +keywords=["MKL", "VSL", "true randomness", "pseudorandomness", + "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", + "R-250", "MCG-31",] + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "License :: OSI Approved", + "Programming Language :: C", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development", + "Topic :: Scientific/Engineering", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", +] +dependencies = ["numpy >=1.26.4", "mkl"] + +[project.optional-dependencies] +test = ["pytest"] + +[project.urls] +Homepage = "http://github.com/IntelPython/mkl_random" +Download = "http://github.com/IntelPython/mkl_random" + +[tool.setuptools] +packages = ["mkl_random"] +include-package-data = true + +[tool.setuptools.package-data] +"mkl_random" = ["tests/*.py"] + +[tool.setuptools.dynamic] +version = {attr = "mkl_random._version.__version__"} diff --git a/setup.py b/setup.py index 130954a..2bb70fd 100644 --- a/setup.py +++ b/setup.py @@ -26,42 +26,12 @@ import os import sys -import io -import re from os.path import join import Cython.Build from setuptools import setup, Extension import numpy as np - -with io.open('mkl_random/_version.py', 'rt', encoding='utf8') as f: - version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1) - -with open("README.md", "r", encoding="utf-8") as file: - long_description = file.read() - -VERSION = version - -CLASSIFIERS = CLASSIFIERS = """\ -Development Status :: 5 - Production/Stable -Intended Audience :: Science/Research -Intended Audience :: Developers -License :: OSI Approved -Programming Language :: C -Programming Language :: Python -Programming Language :: Python :: 3 -Programming Language :: Python :: 3.9 -Programming Language :: Python :: 3.10 -Programming Language :: Python :: 3.11 -Programming Language :: Python :: 3.12 -Programming Language :: Python :: Implementation :: CPython -Topic :: Software Development -Topic :: Scientific/Engineering -Operating System :: Microsoft :: Windows -Operating System :: POSIX -Operating System :: Unix -Operating System :: MacOS -""" +sys.path.insert(0, os.path.dirname(__file__)) # Ensures local imports work def extensions(): @@ -101,23 +71,23 @@ def extensions(): exts = [ Extension( "mkl_random.mklrand", - [ - os.path.join("mkl_random", "mklrand.pyx"), - os.path.join("mkl_random", "src", "mkl_distributions.cpp"), - os.path.join("mkl_random", "src", "randomkit.cpp"), + sources = [ + join("mkl_random", "mklrand.pyx"), + join("mkl_random", "src", "mkl_distributions.cpp"), + join("mkl_random", "src", "randomkit.cpp"), ], depends = [ - os.path.join("mkl_random", "src", "mkl_distributions.hpp"), - os.path.join("mkl_random", "src", "randomkit.h"), - os.path.join("mkl_random", "src", "numpy_multiiter_workaround.h") + join("mkl_random", "src", "mkl_distributions.hpp"), + join("mkl_random", "src", "randomkit.h"), + join("mkl_random", "src", "numpy_multiiter_workaround.h") ], - include_dirs = [os.path.join("mkl_random", "src"), np.get_include()] + mkl_include_dirs, + include_dirs = [join("mkl_random", "src"), np.get_include()] + mkl_include_dirs, libraries = libs, library_dirs = lib_dirs, extra_compile_args = eca + [ # "-ggdb", "-O0", "-Wall", "-Wextra", ], - define_macros=defs + [("NDEBUG",None),], # [("DEBUG", None),] + define_macros=defs + [("NDEBUG", None)], # [("DEBUG", None),] language="c++" ) ] @@ -126,36 +96,7 @@ def extensions(): setup( - name = "mkl_random", - maintainer = "Intel Corp.", - maintainer_email = "scripting@intel.com", - description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality", - version = version, - include_package_data=True, - ext_modules=extensions(), cmdclass={'build_ext': Cython.Build.build_ext}, + ext_modules=extensions(), zip_safe=False, - long_description = long_description, - long_description_content_type="text/markdown", - url = "http://github.com/IntelPython/mkl_random", - author = "Intel Corporation", - download_url = "http://github.com/IntelPython/mkl_random", - license = "BSD", - classifiers = [_f for _f in CLASSIFIERS.split('\n') if _f], - platforms = ["Windows", "Linux", "Mac OS-X"], - test_suite = "pytest", - python_requires = '>=3.7', - setup_requires=["Cython",], - install_requires = ["numpy >=1.16"], - packages=[ - "mkl_random", - ], - package_data={ - "mkl_random" : [ - "tests/*.*", - ] - }, - keywords=["MKL", "VSL", "true randomness", "pseudorandomness", - "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", - "R-250", "MCG-31",], ) From 40645add987ca5455c553921cf516609a9768963 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:30:38 -0700 Subject: [PATCH 04/29] Add build instructions to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 52b4ef5..1b88815 100644 --- a/README.md +++ b/README.md @@ -65,3 +65,10 @@ The list of supported by `mkl_random.RandomState` constructor `brng` keywords is * 'PHILOX4X32X10' * 'NONDETERM' * 'ARS5' + +--- + +To build ``mkl_random`` from sources on Linux: + - install a recent version of MKL, if necessary; + - execute ``source /path_to_oneapi/mkl/latest/env/vars.sh`` ; + - execute ``python -m pip install .`` From ff67a36f198829c6682c37790dccbedccfbf4f75 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:31:11 -0700 Subject: [PATCH 05/29] Clean up pyproject.toml --- pyproject.toml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7c255bf..d5c3f8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,23 +25,13 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [build-system] -requires = ["setuptools>=64.0.0", "Cython", "numpy"] build-backend = "setuptools.build_meta" +requires = ["setuptools>=64.0.0", "Cython", "numpy"] [project] -name = "mkl_random" -dynamic = ["version"] -description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" -readme = { file = "README.md", content-type = "text/markdown" } -requires-python = ">=3.9,<3.13" -license = { text = "BSD" } authors = [ - { name = "Intel Corporation", email = "scripting@intel.com" } + {name = "Intel Corporation", email = "scripting@intel.com"} ] -keywords=["MKL", "VSL", "true randomness", "pseudorandomness", - "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", - "R-250", "MCG-31",] - classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", @@ -59,20 +49,30 @@ classifiers = [ "Topic :: Scientific/Engineering", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", - "Operating System :: Unix", + "Operating System :: Unix" ] dependencies = ["numpy >=1.26.4", "mkl"] +description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" +dynamic = ["version"] +keywords=["MKL", "VSL", "true randomness", "pseudorandomness", + "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", + "R-250", "MCG-31"] +license = {text = "BSD"} +name = "mkl_random" +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">=3.9,<3.13" + [project.optional-dependencies] test = ["pytest"] [project.urls] -Homepage = "http://github.com/IntelPython/mkl_random" Download = "http://github.com/IntelPython/mkl_random" +Homepage = "http://github.com/IntelPython/mkl_random" [tool.setuptools] -packages = ["mkl_random"] include-package-data = true +packages = ["mkl_random"] [tool.setuptools.package-data] "mkl_random" = ["tests/*.py"] From ce8ca25e27c27dff38e405f031548e17856ad991 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:35:59 -0700 Subject: [PATCH 06/29] Pin setuptools to greater than 77 Prevents deprecation warning when building --- conda-recipe-cf/meta.yaml | 2 +- conda-recipe/meta.yaml | 2 +- pyproject.toml | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/conda-recipe-cf/meta.yaml b/conda-recipe-cf/meta.yaml index fbe587d..c4042ba 100644 --- a/conda-recipe-cf/meta.yaml +++ b/conda-recipe-cf/meta.yaml @@ -19,7 +19,7 @@ requirements: - {{ compiler('cxx') }} host: - python - - setuptools + - setuptools >=77 - mkl-devel - cython - numpy diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 3282337..f72ea88 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -19,7 +19,7 @@ requirements: - {{ compiler('cxx') }} host: - python - - setuptools + - setuptools >=77 - mkl-devel - cython - numpy-base diff --git a/pyproject.toml b/pyproject.toml index d5c3f8e..704ca49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools>=64.0.0", "Cython", "numpy"] +requires = ["setuptools>=77", "Cython", "numpy"] [project] authors = [ @@ -36,7 +36,6 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "Intended Audience :: Developers", - "License :: OSI Approved", "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 3", @@ -57,7 +56,7 @@ dynamic = ["version"] keywords=["MKL", "VSL", "true randomness", "pseudorandomness", "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", "R-250", "MCG-31"] -license = {text = "BSD"} +license = "BSD-3-Clause" name = "mkl_random" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.9,<3.13" From c1832ab3fb1b0fa21154e58db943f0a4253c4e27 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:36:12 -0700 Subject: [PATCH 07/29] Fix Conda package workflows on PRs --- .github/workflows/build-docs.yml | 1 + .github/workflows/conda-package-cf.yml | 5 ++++- .github/workflows/conda-package.yml | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index af35efd..8747f03 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,4 +1,5 @@ name: Build mkl_random documentation + on: pull_request: push: diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 6bfe733..acf1460 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -1,6 +1,9 @@ name: Conda package using conda-forge -on: push +on: + pull_request: + push: + branches: [master] permissions: read-all diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index e42b58c..85e2b92 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -1,6 +1,9 @@ name: Conda package -on: push +on: + pull_request: + push: + branches: [master] permissions: read-all From 6c52bd3e56387665951951c66cab4406a2d72f89 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:41:21 -0700 Subject: [PATCH 08/29] Remove numpy as dependency for tests Already a run dependency --- conda-recipe-cf/meta.yaml | 1 - conda-recipe/meta.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/conda-recipe-cf/meta.yaml b/conda-recipe-cf/meta.yaml index c4042ba..094dac1 100644 --- a/conda-recipe-cf/meta.yaml +++ b/conda-recipe-cf/meta.yaml @@ -35,7 +35,6 @@ test: requires: - pytest - mkl-service - - numpy imports: - mkl_random - mkl_random.mklrand diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index f72ea88..475c831 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -35,7 +35,6 @@ test: requires: - pytest - mkl-service - - numpy imports: - mkl_random - mkl_random.mklrand From b155c87e011f1f42aca9696f6e13a8a7f630f89f Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:57:15 -0700 Subject: [PATCH 09/29] Remove mkl-service as test requirement --- conda-recipe-cf/meta.yaml | 1 - conda-recipe/meta.yaml | 1 - pyproject.toml | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/conda-recipe-cf/meta.yaml b/conda-recipe-cf/meta.yaml index 094dac1..b5423c8 100644 --- a/conda-recipe-cf/meta.yaml +++ b/conda-recipe-cf/meta.yaml @@ -34,7 +34,6 @@ test: - pytest --pyargs mkl_random requires: - pytest - - mkl-service imports: - mkl_random - mkl_random.mklrand diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 475c831..825dac0 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -34,7 +34,6 @@ test: - pytest --pyargs mkl_random requires: - pytest - - mkl-service imports: - mkl_random - mkl_random.mklrand diff --git a/pyproject.toml b/pyproject.toml index 704ca49..2bb6992 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,8 +54,8 @@ dependencies = ["numpy >=1.26.4", "mkl"] description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" dynamic = ["version"] keywords=["MKL", "VSL", "true randomness", "pseudorandomness", - "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", - "R-250", "MCG-31"] + "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", + "R-250", "MCG-31"] license = "BSD-3-Clause" name = "mkl_random" readme = {file = "README.md", content-type = "text/markdown"} From f3b3d4073b7f21b5a2731f53fa1025af75a57bf6 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 00:57:22 -0700 Subject: [PATCH 10/29] Change pip to install in build scripts --- conda-recipe-cf/bld.bat | 2 +- conda-recipe-cf/build.sh | 2 +- conda-recipe/bld.bat | 2 +- conda-recipe/build.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conda-recipe-cf/bld.bat b/conda-recipe-cf/bld.bat index 1b04207..5d64fa2 100644 --- a/conda-recipe-cf/bld.bat +++ b/conda-recipe-cf/bld.bat @@ -1,5 +1,5 @@ @rem Remember to source the compiler set MKLROOT=%CONDA_PREFIX% -%PYTHON% setup.py install +%PYTHON% -m pip install --no-build-isolation --no-deps . if errorlevel 1 exit 1 diff --git a/conda-recipe-cf/build.sh b/conda-recipe-cf/build.sh index 34241cc..55964cb 100644 --- a/conda-recipe-cf/build.sh +++ b/conda-recipe-cf/build.sh @@ -2,4 +2,4 @@ export CFLAGS="-I$PREFIX/include $CFLAGS" export MKLROOT=$CONDA_PREFIX -$PYTHON setup.py install +$PYTHON -m pip install --no-build-isolation --no-deps . diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index 1b04207..5d64fa2 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -1,5 +1,5 @@ @rem Remember to source the compiler set MKLROOT=%CONDA_PREFIX% -%PYTHON% setup.py install +%PYTHON% -m pip install --no-build-isolation --no-deps . if errorlevel 1 exit 1 diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index 34241cc..55964cb 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -2,4 +2,4 @@ export CFLAGS="-I$PREFIX/include $CFLAGS" export MKLROOT=$CONDA_PREFIX -$PYTHON setup.py install +$PYTHON -m pip install --no-build-isolation --no-deps . From 5ee291cc95880754aae81c3b3a47dc5326814e06 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 11:24:00 -0700 Subject: [PATCH 11/29] Remove license family --- conda-recipe-cf/meta.yaml | 1 - conda-recipe/meta.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/conda-recipe-cf/meta.yaml b/conda-recipe-cf/meta.yaml index b5423c8..00bc9b1 100644 --- a/conda-recipe-cf/meta.yaml +++ b/conda-recipe-cf/meta.yaml @@ -41,6 +41,5 @@ test: about: home: http://github.com/IntelPython/mkl_random license: BSD-3-Clause - license_family: BSD license_file: LICENSE.txt summary: NumPy-based implementation of random number generation sampling using Intel (R) Math Kernel Library, mirroring numpy.random, but exposing all choices of sampling algorithms available in MKL. diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 825dac0..00b41f1 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -41,6 +41,5 @@ test: about: home: http://github.com/IntelPython/mkl_random license: BSD-3-Clause - license_family: BSD license_file: LICENSE.txt summary: NumPy-based implementation of random number generation sampling using Intel (R) Math Kernel Library, mirroring numpy.random, but exposing all choices of sampling algorithms available in MKL. From 3a59787e451f4b1eac85ed649dab63a971527452 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 11:40:33 -0700 Subject: [PATCH 12/29] Install with pip in clang build Use no-deps to use oneAPI in environment --- .github/workflows/build-with-clang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index 3bde36b..1b4c37e 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -68,7 +68,7 @@ jobs: export CC=$CMPLR_ROOT/bin/icx export CXX=$CMPLR_ROOT/bin/icpx export CFLAGS="${CFLAGS} -fno-fast-math -O2" - python setup.py develop + pip install -e .[test] --no-build-isolation --no-deps --verbose - name: Run mkl_random tests run: | From 1b3437d26567b879c4e7fc101af42674c618bc18 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 11:46:53 -0700 Subject: [PATCH 13/29] Install wheel package in clang builds --- .github/workflows/build-with-clang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index 1b4c37e..ed37447 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -55,7 +55,7 @@ jobs: - name: Install mkl_random dependencies run: | - pip install cython setuptools pytest pytest-cov + pip install cython setuptools pytest pytest-cov wheel pip install ${{ matrix.numpy_build_version }} - name: List oneAPI folder content From 0c054038db77ea5826253609f0a61f40e6463db4 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 13:28:12 -0700 Subject: [PATCH 14/29] Pin setuptools in CI to >=77 --- .github/workflows/build-docs.yml | 2 +- .github/workflows/build-with-clang.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 8747f03..a6abf04 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -41,7 +41,7 @@ jobs: if: ${{ !github.event.pull_request || github.event.action != 'closed' }} shell: bash -l {0} run: | - pip install numpy cython setuptools scikit-build cmake sphinx sphinx_rtd_theme furo pydot graphviz sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx_design + pip install numpy cython setuptools">=77" scikit-build cmake sphinx sphinx_rtd_theme furo pydot graphviz sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx_design - name: Checkout repo uses: actions/checkout@v4.1.1 with: diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index ed37447..29e1afb 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -55,7 +55,7 @@ jobs: - name: Install mkl_random dependencies run: | - pip install cython setuptools pytest pytest-cov wheel + pip install cython setuptools">=70.1" pytest pytest-cov wheel pip install ${{ matrix.numpy_build_version }} - name: List oneAPI folder content From 359fe9def14918a79acbd9ece03acc58899d6ab7 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Sun, 13 Apr 2025 14:06:06 -0700 Subject: [PATCH 15/29] Adjust pyproject.toml and setup.py license headers Also fix formatting in pyproject.toml --- pyproject.toml | 10 ++++------ setup.py | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2bb6992..9896bc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,4 @@ -#!/usr/bin/env python -# Copyright (c) 2017-2025, Intel Corporation +# Copyright (c) 2017, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -53,15 +52,14 @@ classifiers = [ dependencies = ["numpy >=1.26.4", "mkl"] description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" dynamic = ["version"] -keywords=["MKL", "VSL", "true randomness", "pseudorandomness", - "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", - "R-250", "MCG-31"] +keywords = ["MKL", "VSL", "true randomness", "pseudorandomness", + "Philox", "MT-19937", "SFMT-19937", "MT-2203", "ARS-5", + "R-250", "MCG-31"] license = "BSD-3-Clause" name = "mkl_random" readme = {file = "README.md", content-type = "text/markdown"} requires-python = ">=3.9,<3.13" - [project.optional-dependencies] test = ["pytest"] diff --git a/setup.py b/setup.py index 2bb70fd..ebc8460 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2017, Intel Corporation # # Redistribution and use in source and binary forms, with or without From 04e3207d20f92f1fa807c51df2a4f41a475cd971 Mon Sep 17 00:00:00 2001 From: ndgrigorian <46709016+ndgrigorian@users.noreply.github.com> Date: Mon, 14 Apr 2025 09:55:46 -0700 Subject: [PATCH 16/29] Update README.md Co-authored-by: Vahid Tavanashad <120411540+vtavana@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b88815..82acffc 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ The list of supported by `mkl_random.RandomState` constructor `brng` keywords is --- -To build ``mkl_random`` from sources on Linux: +To build `mkl_random` from sources on Linux: - install a recent version of MKL, if necessary; - - execute ``source /path_to_oneapi/mkl/latest/env/vars.sh`` ; - - execute ``python -m pip install .`` + - execute `source /path_to_oneapi/mkl/latest/env/vars.sh`; + - execute `python -m pip install .` From f8b2e7c216e23b921b7fce09c5c82f7074f50d10 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 14:01:16 -0700 Subject: [PATCH 17/29] Raise ValueError if `MKLROOT` variable is not set avoids call to deprecated `get_info` from numpy.distutils --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ebc8460..0f1312a 100644 --- a/setup.py +++ b/setup.py @@ -42,10 +42,7 @@ def extensions(): 'libraries': ['mkl_rt'] } else: - try: - mkl_info = get_info('mkl') - except: - mkl_info = dict() + raise ValueError("MKLROOT environment variable not set.") mkl_include_dirs = mkl_info.get('include_dirs', []) mkl_library_dirs = mkl_info.get('library_dirs', []) From 41a07e77eca906f979da6281422072ecb1c2e622 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 14:10:48 -0700 Subject: [PATCH 18/29] Remove insertion of setup.py in path --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index 0f1312a..b9d4002 100644 --- a/setup.py +++ b/setup.py @@ -30,8 +30,6 @@ from setuptools import setup, Extension import numpy as np -sys.path.insert(0, os.path.dirname(__file__)) # Ensures local imports work - def extensions(): mkl_root = os.environ.get('MKLROOT', None) From 7b5a63e2ee2a292fdaab94f8d1211c9ebc1f223f Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 14:25:52 -0700 Subject: [PATCH 19/29] Apply review comments to clang workflow --- .github/workflows/build-with-clang.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index 29e1afb..b324be0 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -55,7 +55,7 @@ jobs: - name: Install mkl_random dependencies run: | - pip install cython setuptools">=70.1" pytest pytest-cov wheel + pip install cython setuptools">=70.1" wheel pip install ${{ matrix.numpy_build_version }} - name: List oneAPI folder content @@ -68,11 +68,11 @@ jobs: export CC=$CMPLR_ROOT/bin/icx export CXX=$CMPLR_ROOT/bin/icpx export CFLAGS="${CFLAGS} -fno-fast-math -O2" - pip install -e .[test] --no-build-isolation --no-deps --verbose + pip install -e . --no-build-isolation --no-deps --verbose - name: Run mkl_random tests run: | source ${{ env.ONEAPI_ROOT }}/setvars.sh # Test with NumPy<2 for now - pip install numpy"<2" + pip install numpy"<2" pytest pytest -s -v --pyargs mkl_random From 5aabb91802ed89d08200960570d6d63f22a26bef Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 16:25:11 -0700 Subject: [PATCH 20/29] remove defaults channel --- .github/workflows/conda-package-cf.yml | 2 ++ .github/workflows/conda-package.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index acf1460..33c8ce5 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -75,6 +75,7 @@ jobs: fetch-depth: 0 - uses: conda-incubator/setup-miniconda@v3 with: + conda-remove-defaults: true auto-activate-base: true activate-environment: "" @@ -188,6 +189,7 @@ jobs: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - uses: conda-incubator/setup-miniconda@v3 with: + conda-remove-defaults: true auto-activate-base: true activate-environment: "" - name: Install conda-build diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 85e2b92..11e1730 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -75,6 +75,7 @@ jobs: fetch-depth: 0 - uses: conda-incubator/setup-miniconda@v3 with: + conda-remove-defaults: true auto-activate-base: true activate-environment: "" @@ -188,6 +189,7 @@ jobs: name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} - uses: conda-incubator/setup-miniconda@v3 with: + conda-remove-defaults: true auto-activate-base: true activate-environment: "" - name: Install conda-build From 59b354d338d10b4e02098e35db80c0ac06ee58f4 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 18:27:29 -0700 Subject: [PATCH 21/29] Add openmp as explicit dependency in test_windows step --- .github/workflows/conda-package.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 11e1730..be48bf7 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -225,6 +225,9 @@ jobs: restore-keys: | ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}- ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- + + # add intel-openmp as an explicit dependency + # to avoid it being missed when package version is specified exactly - name: Install mkl_random shell: cmd run: | @@ -234,7 +237,8 @@ jobs: FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO ( SET PACKAGE_VERSION=%%F ) - conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} + SET "WORKAROUND_DEPENDENCIES=intel-openmp" + conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% %WORKAROUND_DEPENDENCIES% pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} # Test installed packages conda list - name: Run tests From a4ba7f26e43e36b3069d9c25c7164c28f8c8e5aa Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 18:40:39 -0700 Subject: [PATCH 22/29] Run conda-package workflow on 3.11 and 3.12 as well --- .github/workflows/conda-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index be48bf7..4df2eaf 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.9", "3.10"] + python: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 with: From 64bdbe575bc4c6affaf3a3ac58d2cd4a2ca5f4e7 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 22:03:23 -0700 Subject: [PATCH 23/29] Run all workflows on all supported Python versions --- .github/workflows/conda-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 4df2eaf..355c629 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -66,7 +66,7 @@ jobs: strategy: matrix: - python: ['3.9', '3.10'] + python: ["3.9", "3.10", "3.11", "3.12"] env: conda-bld: C:\Miniconda\conda-bld\win-64\ steps: @@ -106,7 +106,7 @@ jobs: strategy: matrix: - python: ['3.9', '3.10'] + python: ["3.9", "3.10", "3.11", "3.12"] numpy: ['1.26*'] experimental: [false] runner: [ubuntu-latest] @@ -174,7 +174,7 @@ jobs: strategy: matrix: - python: ['3.9', '3.10'] + python: ["3.9", "3.10", "3.11", "3.12"] numpy: ['1.26*'] experimental: [false] runner: [windows-2019] From 5e56f05b6e1abad5622b9230c53792c47686659e Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Mon, 14 Apr 2025 22:03:32 -0700 Subject: [PATCH 24/29] Run docs workflow on Python 3.12 --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index a6abf04..aa1dcca 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -35,7 +35,7 @@ jobs: if: ${{ !github.event.pull_request || github.event.action != 'closed' }} uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.12" architecture: x64 - name: Install sphinx dependencies if: ${{ !github.event.pull_request || github.event.action != 'closed' }} From 2c698302e0d6afc38ce053883696a293569a1134 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 16 Apr 2025 13:34:16 -0700 Subject: [PATCH 25/29] Make mkl_random dependencies consistent in clang build --- .github/workflows/build-with-clang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index b324be0..09d264b 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -55,7 +55,7 @@ jobs: - name: Install mkl_random dependencies run: | - pip install cython setuptools">=70.1" wheel + pip install cython setuptools">=77" pip install ${{ matrix.numpy_build_version }} - name: List oneAPI folder content From 1294dc75eebea9e37e86df7444dda884e157ba40 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 16 Apr 2025 13:37:42 -0700 Subject: [PATCH 26/29] Update build instructions in docs --- docs/source/maintenance/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/maintenance/index.rst b/docs/source/maintenance/index.rst index 2611957..d1b7b68 100644 --- a/docs/source/maintenance/index.rst +++ b/docs/source/maintenance/index.rst @@ -31,7 +31,7 @@ can be found. :caption: Building mkl_random $ export MKLROOT= - python setup.py develop + python -m pip install . To run test suite, install :mod:`pytest`, and run From cfb8e0aaa048282f9f7408b6392e356ebcf9c2a1 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 16 Apr 2025 13:38:31 -0700 Subject: [PATCH 27/29] Attempt using editable wheel build in docs build --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index aa1dcca..4831132 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -53,7 +53,7 @@ jobs: run: | # Ensure that SYCL libraries are on LD_LIBRARY_PATH source /opt/intel/oneapi/setvars.sh - python setup.py develop + pip install --no-deps --no-build-isolation -e . --verbose python -c "import mkl_random; print(mkl_random.__version__)" || exit 1 sphinx-build -M html docs/source docs/build mkdir -p ~/rendered_docs From 482aa53088bb188bfa7d4016555f2a9d2f3d5cbd Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Thu, 17 Apr 2025 16:08:38 -0700 Subject: [PATCH 28/29] Update Clang worfklow numpy_build_version->numpy_version Test with same version of NumPy as build Co-authored-by: Vahid Tavanashad <120411540+vtavana@users.noreply.github.com> --- .github/workflows/build-with-clang.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index 09d264b..af79694 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -13,8 +13,7 @@ jobs: strategy: matrix: python: ["3.9", "3.10", "3.11", "3.12"] - numpy_build_version: ["numpy'<2'", "numpy'>=2'"] - + numpy_version: ["numpy'<2'", "numpy'>=2'"] env: ONEAPI_ROOT: /opt/intel/oneapi @@ -56,7 +55,7 @@ jobs: - name: Install mkl_random dependencies run: | pip install cython setuptools">=77" - pip install ${{ matrix.numpy_build_version }} + pip install ${{ matrix.numpy_version }} - name: List oneAPI folder content run: ls ${{ env.ONEAPI_ROOT }}/compiler @@ -73,6 +72,5 @@ jobs: - name: Run mkl_random tests run: | source ${{ env.ONEAPI_ROOT }}/setvars.sh - # Test with NumPy<2 for now - pip install numpy"<2" pytest + pip install pytest pytest -s -v --pyargs mkl_random From d52ee2d253c683745b6fa368c9de88b28866f248 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Tue, 22 Apr 2025 11:32:21 -0700 Subject: [PATCH 29/29] Add builds which use Python 3.13 --- .github/workflows/build-with-clang.yml | 2 +- .github/workflows/conda-package-cf.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-with-clang.yml b/.github/workflows/build-with-clang.yml index af79694..5715d24 100644 --- a/.github/workflows/build-with-clang.yml +++ b/.github/workflows/build-with-clang.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] numpy_version: ["numpy'<2'", "numpy'>=2'"] env: ONEAPI_ROOT: /opt/intel/oneapi diff --git a/.github/workflows/conda-package-cf.yml b/.github/workflows/conda-package-cf.yml index 33c8ce5..07558c4 100644 --- a/.github/workflows/conda-package-cf.yml +++ b/.github/workflows/conda-package-cf.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 with: @@ -66,7 +66,7 @@ jobs: strategy: matrix: - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] env: conda-bld: C:\Miniconda\conda-bld\win-64\ steps: @@ -106,7 +106,7 @@ jobs: strategy: matrix: - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] numpy: ["1.26*", "2*"] experimental: [false] runner: [ubuntu-latest] @@ -174,7 +174,7 @@ jobs: strategy: matrix: - python: ["3.9", "3.10", "3.11", "3.12"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] numpy: ["1.26*", "2*"] experimental: [false] runner: [windows-2019]