Skip to content

Commit 1bc00fa

Browse files
Merge pull request #33 from IntelPython/prepare-for-release-2.4.1
Prepare for release 2.4.1
2 parents 2e0aa0c + a1b4fc9 commit 1bc00fa

File tree

6 files changed

+327
-17
lines changed

6 files changed

+327
-17
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build mkl-service with clang
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master]
6+
7+
permissions: read-all
8+
9+
jobs:
10+
build-with-clang:
11+
name: Build project with IntelLLVM clang compiler
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
ONEAPI_ROOT: /opt/intel/oneapi
16+
17+
steps:
18+
- name: Cancel Previous Runs
19+
uses: styfle/cancel-workflow-action@0.11.0
20+
with:
21+
access_token: ${{ github.token }}
22+
23+
- name: Add Intel repository
24+
run: |
25+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
26+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
27+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
28+
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
29+
sudo apt-get update
30+
31+
- name: Install Intel OneAPI
32+
run: |
33+
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
34+
sudo apt-get install intel-oneapi-tbb
35+
sudo apt-get install intel-oneapi-mkl-devel
36+
37+
- name: Setup Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.12'
41+
architecture: x64
42+
43+
- name: Checkout repo
44+
uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Install mkl-service dependencies
49+
shell: bash -l {0}
50+
run: |
51+
pip install numpy cython setuptools pytest pytest-cov
52+
53+
- name: List oneAPI folder content
54+
shell: bash -l {0}
55+
run: ls /opt/intel/oneapi/compiler
56+
57+
- name: Build mkl_random
58+
shell: bash -l {0}
59+
run: |
60+
source /opt/intel/oneapi/setvars.sh
61+
echo $CMPLR_ROOT
62+
export CC=$CMPLR_ROOT/bin/compiler/clang
63+
export CXX=$CMPLR_ROOT/bin/compiler/clang++
64+
export CFLAGS="${CFLAGS} -fno-fast-math"
65+
echo "CC = ${CC} CXX=${CXX}"
66+
ls -l ${CC} ${CXX}
67+
python setup.py develop
68+
69+
- name: Run mkl_random tests
70+
shell: bash -l {0}
71+
run: |
72+
source /opt/intel/oneapi/setvars.sh
73+
pytest -s -v --pyargs mkl

.github/workflows/conda-package.yml

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
name: Conda package
2+
3+
on: push
4+
5+
permissions: read-all
6+
7+
env:
8+
PACKAGE_NAME: mkl-service
9+
MODULE_NAME: mkl
10+
TEST_ENV_NAME: test_mkl_service
11+
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
12+
VER_SCRIPT2: "d = j['mkl-service'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
13+
14+
jobs:
15+
build_linux:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python: ["3.9", "3.10", "3.11", "3.12"]
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set pkgs_dirs
26+
run: |
27+
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
28+
- name: Cache conda packages
29+
uses: actions/cache@v4
30+
env:
31+
CACHE_NUMBER: 0 # Increase to reset cache
32+
with:
33+
path: ~/.conda/pkgs
34+
key:
35+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
38+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
39+
40+
- name: Add conda to system path
41+
run: echo $CONDA/bin >> $GITHUB_PATH
42+
- name: Install conda-build
43+
run: conda install conda-build
44+
- name: Build conda package
45+
run: |
46+
CHANNELS="-c conda-forge -c intel --override-channels"
47+
VERSIONS="--python ${{ matrix.python }}"
48+
TEST="--no-test"
49+
50+
conda build \
51+
$TEST \
52+
$VERSIONS \
53+
$CHANNELS \
54+
conda-recipe
55+
- name: Upload artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
59+
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
60+
61+
build_windows:
62+
runs-on: windows-latest
63+
64+
strategy:
65+
matrix:
66+
python: ['3.9', '3.10', '3.11', '3.12']
67+
env:
68+
conda-bld: C:\Miniconda\conda-bld\win-64\
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
fetch-depth: 0
73+
- uses: conda-incubator/setup-miniconda@v3
74+
with:
75+
auto-activate-base: true
76+
activate-environment: ""
77+
78+
- name: Cache conda packages
79+
uses: actions/cache@v4
80+
env:
81+
CACHE_NUMBER: 3 # Increase to reset cache
82+
with:
83+
path: /home/runner/conda_pkgs_dir
84+
key:
85+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
86+
restore-keys: |
87+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
88+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
89+
- name: Install conda-build
90+
run: conda install conda-build
91+
- name: Build conda package
92+
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
93+
- name: Upload artifact
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
97+
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
98+
99+
test_linux:
100+
needs: build_linux
101+
runs-on: ${{ matrix.runner }}
102+
103+
strategy:
104+
matrix:
105+
python: ['3.9', '3.10', '3.11', '3.12']
106+
experimental: [false]
107+
runner: [ubuntu-latest]
108+
continue-on-error: ${{ matrix.experimental }}
109+
env:
110+
CHANNELS: -c conda-forge -c intel --override-channels
111+
112+
steps:
113+
- name: Download artifact
114+
uses: actions/download-artifact@v4
115+
with:
116+
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
117+
- name: Add conda to system path
118+
run: echo $CONDA/bin >> $GITHUB_PATH
119+
- name: Install conda-build
120+
run: conda install conda-build
121+
- name: Create conda channel
122+
run: |
123+
mkdir -p $GITHUB_WORKSPACE/channel/linux-64
124+
conda index $GITHUB_WORKSPACE/channel || exit 1
125+
mv ${PACKAGE_NAME}-*.tar.bz2 $GITHUB_WORKSPACE/channel/linux-64 || exit 1
126+
conda index $GITHUB_WORKSPACE/channel || exit 1
127+
# Test channel
128+
conda search $PACKAGE_NAME -c $GITHUB_WORKSPACE/channel --override-channels --info --json > $GITHUB_WORKSPACE/ver.json
129+
cat ver.json
130+
- name: Collect dependencies
131+
run: |
132+
. $CONDA/etc/profile.d/conda.sh
133+
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
134+
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
135+
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
136+
cat lockfile
137+
- name: Set pkgs_dirs
138+
run: |
139+
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
140+
- name: Cache conda packages
141+
uses: actions/cache@v4
142+
env:
143+
CACHE_NUMBER: 0 # Increase to reset cache
144+
with:
145+
path: ~/.conda/pkgs
146+
key:
147+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
148+
restore-keys: |
149+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
150+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
151+
152+
- name: Install mkl-service
153+
run: |
154+
. $CONDA/etc/profile.d/conda.sh
155+
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
156+
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
157+
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
158+
# Test installed packages
159+
conda list
160+
- name: Run tests
161+
run: |
162+
. $CONDA/etc/profile.d/conda.sh
163+
conda activate ${{ env.TEST_ENV_NAME }}
164+
pytest -vv --pyargs ${{ env.MODULE_NAME }}
165+
166+
test_windows:
167+
needs: build_windows
168+
runs-on: ${{ matrix.runner }}
169+
170+
strategy:
171+
matrix:
172+
python: ['3.9', '3.10', '3.11', '3.12']
173+
experimental: [false]
174+
runner: [windows-latest]
175+
continue-on-error: ${{ matrix.experimental }}
176+
env:
177+
CHANNELS: -c conda-forge -c intel --override-channels
178+
179+
steps:
180+
- name: Download artifact
181+
uses: actions/download-artifact@v4
182+
with:
183+
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
184+
- uses: conda-incubator/setup-miniconda@v3
185+
with:
186+
auto-activate-base: true
187+
activate-environment: ""
188+
- name: Install conda-build
189+
# Needed to be able to run conda index
190+
run: conda install conda-build
191+
- name: Create conda channel
192+
run: |
193+
mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64
194+
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.GITHUB_WORKSPACE }}\channel\win-64
195+
conda index ${{ env.GITHUB_WORKSPACE }}/channel
196+
# Test channel
197+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json
198+
more ${{ env.GITHUB_WORKSPACE }}\ver.json
199+
- name: Collect dependencies
200+
shell: cmd
201+
run: |
202+
@ECHO ON
203+
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
204+
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
205+
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
206+
SET PACKAGE_VERSION=%%F
207+
)
208+
conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
209+
more lockfile
210+
- name: Cache conda packages
211+
uses: actions/cache@v4
212+
env:
213+
CACHE_NUMBER: 3 # Increase to reset cache
214+
with:
215+
path: /home/runner/conda_pkgs_dir
216+
key:
217+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('lockfile') }}
218+
restore-keys: |
219+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
220+
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
221+
- name: Install mkl-service
222+
shell: cmd
223+
run: |
224+
@ECHO ON
225+
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
226+
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
227+
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
228+
SET PACKAGE_VERSION=%%F
229+
)
230+
conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
231+
# Test installed packages
232+
conda list
233+
- name: Run tests
234+
run: |
235+
conda activate -n ${{ env.TEST_ENV_NAME }}
236+
pytest -v --pyargs ${{ env.MODULE_NAME }}

conda-recipe/meta.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{% set version = "2.4.0" %}
2-
{% set buildnumber = 2 %}
1+
{% set version = "2.4.1" %}
2+
{% set buildnumber = 0 %}
33

44
package:
55
name: mkl-service
@@ -25,17 +25,14 @@ requirements:
2525
run:
2626
- python
2727
- mkl >=2019.3
28-
- six
2928

3029
test:
3130
requires:
3231
- pytest
3332
imports:
3433
- mkl
3534
commands:
36-
- pytest tests/test_mkl_service.py
37-
source_files:
38-
- tests
35+
- pytest -vv --pyargs mkl
3936

4037
about:
4138
home: http://github.com/IntelPython/mkl-service

mkl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ def __exit__(self, *args):
5454
from ._py_mkl_service import *
5555

5656

57-
__version__ = '2.4.0'
57+
__version__ = '2.4.1'

tests/test_mkl_service.py renamed to mkl/tests/test_mkl_service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
import pytest
28-
import six
2928
import mkl
3029

3130

@@ -39,7 +38,7 @@ def test_get_version():
3938

4039
def test_get_version_string():
4140
v = mkl.get_version_string()
42-
assert isinstance(v, six.string_types)
41+
assert isinstance(v, str)
4342
assert 'Math Kernel Library' in v
4443

4544

setup.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@
4646
License :: OSI Approved
4747
Programming Language :: C
4848
Programming Language :: Python
49-
Programming Language :: Python :: 2
50-
Programming Language :: Python :: 2.7
51-
Programming Language :: Python :: 3
52-
Programming Language :: Python :: 3.5
53-
Programming Language :: Python :: 3.6
54-
Programming Language :: Python :: 3.7
49+
Programming Language :: Python :: 3.9
50+
Programming Language :: Python :: 3.10
51+
Programming Language :: Python :: 3.11
52+
Programming Language :: Python :: 3.12
5553
Programming Language :: Python :: Implementation :: CPython
5654
Topic :: Software Development
5755
Topic :: Utilities
@@ -143,10 +141,17 @@ def setup_package():
143141
license='BSD',
144142
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
145143
platforms=["Windows", "Linux", "Mac OS-X"],
146-
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
144+
python_requires='>=3.9',
147145
setup_requires=['setuptools', 'cython'],
148146
install_requires=[],
149-
packages=setuptools.find_packages(),
147+
packages=[
148+
"mkl",
149+
],
150+
package_data={
151+
"mkl" : [
152+
"tests/*.*",
153+
]
154+
},
150155
ext_modules=get_extensions()
151156
)
152157
setup(**metadata)

0 commit comments

Comments
 (0)