From d1f19fc4cdd97b9bbb1163754306e95fcf781ebd Mon Sep 17 00:00:00 2001 From: Georgios Kafanas Date: Tue, 16 Sep 2025 16:48:12 +0200 Subject: [PATCH] [REFACTOR] Centralize handling of Python version --- .github/workflows/deploy.yml | 5 ++++- .github/workflows/test-build.yml | 5 ++++- .python-version | 2 +- README.md | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fbe792b4e..ea24522dd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,10 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Read Python + id: pyversion + run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '${{ env.PYTHON_VERSION }}' cache: 'pip' - name: Install dependencies run: | diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index c5be26e30..2278e8c8c 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -12,10 +12,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Read Python version + id: pyversion + run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '${{ env.PYTHON_VERSION }}' cache: 'pip' - name: Install dependencies run: | diff --git a/.python-version b/.python-version index 6a801ce54..c70edfad8 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.13 +3.11.13 diff --git a/README.md b/README.md index 6a48ca45d..e594dec17 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,10 @@ $ pip install --requirement requirements.txt If your system Python is not compatible with the required packages, we suggest that you install Python in a Conda environment using the [Micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) package manager for Conda. - Begin by [installing the Micromamba package manager](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html). -- Install Python 3.11 in a new environment. +- Install the Python version listed in `.python-version` in a new environment. ``` $ micromamba env create --name ulhpc-docs-python -$ micromamba install python=3.11 --channel conda-forge --name ulhpc-docs-python +$ micromamba install python=$(cat .python-version) --channel conda-forge --name ulhpc-docs-python ``` - You now have 2 options. First options is to install the required python packages directly in the Conda environment. ```