Skip to content

Use environment.yml (or something like that) in CI #449

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

Open
ricardoV94 opened this issue Sep 21, 2023 · 1 comment
Open

Use environment.yml (or something like that) in CI #449

ricardoV94 opened this issue Sep 21, 2023 · 1 comment
Labels
GitHub CI/CD help wanted Extra attention is needed

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Sep 21, 2023

Description

The CI dependencies are completely dissociated from the conda pytensor-dev environment specified by environment.yml.

This led to need a separate commit in #448 that should have gone into #446

- name: Install dependencies
shell: bash -l {0}
run: |
mamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock sympy
# numba-scipy downgrades the installed scipy to 1.7.3 in Python 3.9, but
# not numpy, even though scipy 1.7 requires numpy<1.23. When installing
# PyTensor next, pip installs a lower version of numpy via the PyPI.
if [[ $INSTALL_NUMBA == "1" ]] && [[ $PYTHON_VERSION == "3.9" ]]; then mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numpy<1.23" "numba>=0.57" numba-scipy; fi
if [[ $INSTALL_NUMBA == "1" ]] && [[ $PYTHON_VERSION != "3.9" ]]; then mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57" numba-scipy; fi
if [[ $INSTALL_JAX == "1" ]]; then mamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi
pip install -e ./
mamba list && pip freeze
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"'

@lmmx
Copy link
Contributor

lmmx commented Dec 7, 2023

The only tricky bit here is that you can't parameterise the Python version of an environment.yml, but we can do the installation of the parameterised Python version and the environments file in the same pass using this pattern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub CI/CD help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants