Skip to content

Update installation steps #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build-with-clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
use_pre: ["", "--pre"]
numpy_build_version: ["numpy'<2'", "numpy'>=2'"]
env:
ONEAPI_ROOT: /opt/intel/oneapi

Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
shell: bash -l {0}
run: |
pip install cython setuptools pytest pytest-cov
pip install numpy ${{ matrix.use_pre }}
pip install ${{ matrix.numpy_build_version }}

- name: List oneAPI folder content
shell: bash -l {0}
Expand All @@ -73,4 +73,6 @@ jobs:
shell: bash -l {0}
run: |
source /opt/intel/oneapi/setvars.sh
# Test with NumPy<2 for now
pip install numpy"<2"
pytest -s -v --pyargs mkl_random
18 changes: 10 additions & 8 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: conda install conda-build
- name: Build conda package
run: |
CHANNELS="-c conda-forge -c intel --override-channels"
CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels"
VERSIONS="--python ${{ matrix.python }}"
TEST="--no-test"

Expand Down Expand Up @@ -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 }} -c intel -c conda-forge --override-channels conda-recipe
run: conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -103,11 +103,12 @@ jobs:
strategy:
matrix:
python: ['3.9', '3.10']
numpy: ['1.26*']
experimental: [false]
runner: [ubuntu-latest]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c conda-forge -c intel --override-channels
CHANNELS: -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels

steps:
- name: Download artifact
Expand All @@ -132,7 +133,7 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} numpy=${{ matrix.numpy }} $CHANNELS --only-deps --dry-run > lockfile
cat lockfile
- name: Set pkgs_dirs
run: |
Expand All @@ -154,7 +155,7 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
conda create -n ${{ env.TEST_ENV_NAME }} $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} numpy=${{ matrix.numpy }} $CHANNELS
# Test installed packages
conda list
- name: Run tests
Expand All @@ -170,11 +171,12 @@ jobs:
strategy:
matrix:
python: ['3.9', '3.10']
numpy: ['1.26*']
experimental: [false]
runner: [windows-2019]
continue-on-error: ${{ matrix.experimental }}
env:
CHANNELS: -c conda-forge -c intel --override-channels
CHANNELS: -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels

steps:
- name: Download artifact
Expand Down Expand Up @@ -205,7 +207,7 @@ 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% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
conda create -n ${{ env.TEST_ENV_NAME }} ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} numpy=${{ matrix.numpy }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
more lockfile
- name: Cache conda packages
uses: actions/cache@v4
Expand All @@ -227,7 +229,7 @@ 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 }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
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 }}
# Test installed packages
conda list
- name: Run tests
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
Per NumPy's community suggestions, voiced in https://github.com/numpy/numpy/pull/8209, it is being released as a
stand-alone package.

Prebuilt `mkl_random` can be installed into conda environment from Intel's channel on Anaconda cloud:
Prebuilt `mkl_random` can be installed into conda environment from Intel's channel:

```
conda install -c intel mkl_random
conda install -c https://software.repos.intel.com/python/conda mkl_random
```

or from conda forge channel:

```
conda install -c conda-forge mkl_random
```

---
Expand Down
Loading
Loading