diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 7dd4347d53..08da614ce0 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: mamba-org/setup-micromamba@v1 with: - micromamba-version: "latest" # any version from https://github.com/mamba-org/micromamba-releases + micromamba-version: "1.5.10-0" # until https://github.com/mamba-org/setup-micromamba/issues/225 is resolved environment-file: environment.yml init-shell: bash cache-environment: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 674bc52c7b..e3d2adf461 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -135,7 +135,7 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: environment-name: pytensor-test - micromamba-version: "latest" + micromamba-version: "1.5.10-0" # until https://github.com/mamba-org/setup-micromamba/issues/225 is resolved init-shell: bash post-cleanup: "all" create-args: python=${{ matrix.python-version }} @@ -157,7 +157,7 @@ jobs: micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi - if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" pytorch pytorch-cuda=12.1 -c pytorch -c nvidia; fi + if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" pytorch pytorch-cuda=12.1 "mkl<=2024.0" -c pytorch -c nvidia; fi pip install pytest-sphinx pip install -e ./ @@ -209,13 +209,13 @@ jobs: uses: mamba-org/setup-micromamba@v1 with: environment-name: pytensor-test - micromamba-version: "latest" + micromamba-version: "1.5.10-0" # until https://github.com/mamba-org/setup-micromamba/issues/225 is resolved init-shell: bash post-cleanup: "all" - name: Install dependencies shell: micromamba-shell {0} run: | - micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark pytorch pytorch-cuda=12.1 -c pytorch -c nvidia + micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark pip install -e ./ micromamba list && pip freeze python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))' diff --git a/pytensor/configdefaults.py b/pytensor/configdefaults.py index 0353c58fcd..a81fd63905 100644 --- a/pytensor/configdefaults.py +++ b/pytensor/configdefaults.py @@ -3,13 +3,13 @@ import os import platform import re +import shutil import socket import sys import textwrap from pathlib import Path import numpy as np -from setuptools._distutils.spawn import find_executable import pytensor from pytensor.configparser import ( @@ -349,7 +349,7 @@ def add_compile_configvars(): # Try to find the full compiler path from the name if param != "": - newp = find_executable(param) + newp = shutil.which(param) if newp is not None: param = newp del newp