diff --git a/.github/workflows/python-package-tests.yml b/.github/workflows/python-package-tests.yml index a992e37..de28072 100644 --- a/.github/workflows/python-package-tests.yml +++ b/.github/workflows/python-package-tests.yml @@ -16,26 +16,41 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install dependencies for Python build + - name: Install dependencies for Python build with SSL support run: | dnf install -y dnf-plugins-core - dnf install -y gcc openssl openssl-devel bzip2-devel libffi-devel zlib-devel make wget curl-minimal - dnf install -y git + dnf install -y gcc openssl openssl-devel bzip2-devel libffi-devel \ + zlib-devel make wget curl-minimal git - - name: Download and Install Python 3.10 from Source + - name: Install pyenv run: | - PYTHON_VERSION=3.10.12 - wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz - tar -xzf Python-$PYTHON_VERSION.tgz - cd Python-$PYTHON_VERSION - ./configure --enable-optimizations - make -j $(nproc) - make altinstall # This installs it as `python3.10` without overwriting the default `python3` - ln -s /usr/local/bin/python3.10 /usr/local/bin/python # Link it as `python` + curl https://pyenv.run | bash + echo "export PYENV_ROOT=\"${HOME}/.pyenv\"" >> $GITHUB_ENV + echo "export PATH=\"${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH\"" >> $GITHUB_ENV - - name: Verify Python and SSL module + - name: Set up pyenv environment + shell: bash + env: + PATH: "${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH" run: | + # Initialize pyenv + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + + - name: Install Python 3.10 with pyenv + shell: bash + env: + PATH: "${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH" + run: | + pyenv install 3.10.12 + pyenv global 3.10.12 python --version + + - name: Verify Python SSL support + shell: bash + env: + PATH: "${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH" + run: | python -c "import ssl; print('SSL support is available:', ssl.OPENSSL_VERSION)" - name: Install Torque @@ -43,13 +58,18 @@ jobs: dnf install -y epel-release dnf install -y torque torque-client torque-devel torque-drmaa torque-mom torque-server torque-scheduler - - name: Upgrade pip and install dependencies + - name: Install dependencies + shell: bash + env: + PATH: "${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH" run: | - python3.10 -m ensurepip - python3.10 -m pip install --upgrade pip - python3.10 -m pip install --upgrade setuptools wheel - python3.10 -m pip install ".[all]" + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools wheel + python -m pip install ".[all]" - name: Unit tests + shell: bash + env: + PATH: "${HOME}/.pyenv/bin:${HOME}/.pyenv/shims:$PATH" run: | - python3.10 -m unittest discover --verbose --catch --start-directory tests/unit + python -m unittest discover --verbose --catch --start-directory tests/unit