From 0545060302d1c42ff3e20ce7072516f0ff972251 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Fri, 23 Aug 2024 16:27:26 +0100 Subject: [PATCH] Hot fix: Pin Python version (#111) * Hot fix: Pin Python version * Try fixing CI * Hacky: Only force Python version if Python is spotted --- environment-dev.yaml | 2 +- jupyterlite_xeus/create_conda_env.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/environment-dev.yaml b/environment-dev.yaml index f4df578..736f969 100644 --- a/environment-dev.yaml +++ b/environment-dev.yaml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - black - - build + - python-build - empack >=3.3 - hatch-jupyter-builder - hatch-nodejs-version diff --git a/jupyterlite_xeus/create_conda_env.py b/jupyterlite_xeus/create_conda_env.py index 2999235..3367032 100644 --- a/jupyterlite_xeus/create_conda_env.py +++ b/jupyterlite_xeus/create_conda_env.py @@ -49,6 +49,9 @@ def create_conda_env_from_env_file(root_prefix, env_file_content, env_file_locat # get the specs specs, pip_dependencies = _extract_specs(env_file_location, env_file_content) + # Force Python 3.11 + if "python" in str(specs): + specs.append("python=3.11") create_conda_env_from_specs( env_name=env_name, @@ -119,7 +122,7 @@ def _create_conda_env_from_specs_impl(env_name, root_prefix, specs, channels): check=True, ) return - + if MAMBA_COMMAND: # Mamba needs the directory to exist already prefix_path.mkdir(parents=True, exist_ok=True)