Skip to content

Fix failing CI: update Python 3.6.9 → 3.10, restore deleted workflow#1

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/update-python-version-to-310
Open

Fix failing CI: update Python 3.6.9 → 3.10, restore deleted workflow#1
Copilot wants to merge 3 commits into
mainfrom
copilot/update-python-version-to-310

Conversation

Copilot AI commented Apr 4, 2026

Copy link
Copy Markdown

Python 3.6.9 is EOL and no longer available in Conda channels, causing LibMambaUnsatisfiableError on every CI run. The workflow file was also deleted from the repo, leaving CI broken entirely.

Changes

  • environment.yml: python==3.6.9python=3.10; add explicit pip conda dependency (required when pip-section packages are present, otherwise Conda may use wrong pip)
  • Requirements.txt: Remove malformed 3. requirements.txt header line
  • .github/workflows/python-package-conda.yml: Restore deleted workflow; add permissions: contents: read (security hardening per CodeQL)
Original prompt

Problem

The GitHub Actions workflow is failing due to an outdated Python version specification. The project currently specifies Python 3.6.9 in environment.yml, which reached end-of-life in December 2021 and is no longer available in modern Conda channels.

Workflow Error

LibMambaUnsatisfiableError: python ==3.6.9 * is not installable because it conflicts with any installable versions previously reported.

Root Cause

  • Python 3.6.9 is no longer maintained and removed from Conda repositories
  • The environment.yml file pins an obsolete Python version
  • The workflow file is trying to build with this incompatible version

Solution

Update the project dependencies to use a modern, supported Python version (3.10+) that:

  1. Is actively maintained and widely compatible with current packages
  2. Supports all dependencies specified in the project (numpy, opencv-python, scikit-image, etc.)
  3. Works with modern Conda repositories
  4. Is compatible with TensorFlow/Keras if needed

Changes Required

  1. Update environment.yml to use Python 3.10
  2. Update Requirements.txt to be more complete and properly formatted
  3. Ensure the GitHub Actions workflow can execute successfully with the new Python version

Impact

  • Fixes the failing GitHub Actions workflow
  • Makes the project compatible with modern development environments
  • Maintains all project functionality while using current best practices

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: I'll help you find a solution for this failing job. Let me start by retrieving the job logs.

Assistant: Now let me check the workflow file to see the exact configuration:

Assistant: ## Solution for Failing Job

The job is failing due to a Python version conflict in your Conda environment setup. The error shows:

LibMambaUnsatisfiableError: python ==3.6.9 * is not installable because it conflicts with any installable versions previously reported.

Root Cause

Your workflow is trying to install Python 3.6.9, which is incompatible with the current Conda solver and likely no longer available in the default channels. Additionally, there's a conflict with Python 3.14 (python_abi).

Solution

Update your .github/workflows/python-package-conda.yml file to use a supported Python version. Replace the Python 3.6.9 specification with a modern, supported version:

Recommended change:

- name: Set up Python
  uses: conda-incubator/setup-miniconda@v2
  with:
    auto-update-conda: true
    python-version: "3.10"  # or 3.9, 3.11, 3.12
    channels: conda-forge,defaults
    channel-priority: true

Alternative (if using specific version pinning):

- name: Install dependencies
  run: |
    conda install python=3.10 -c conda-forge -y
    pip install -r requirements.txt

Why This Works

  • Python 3.6.9 reached end-of-life in December 2021 and is no longer actively maintained
  • Modern Conda channels have removed or limited support for this version
  • Using Python 3.9+ ensures compatibility with current package ecosystems

Choose a Python version that matches your project's requirements (check your requirements.txt or setup files for minimum version constraints).

User: fix any error in this repostory

Assistant: I'll analyze the repository and workflow to fix the errors.

Assistant: Now I'll create a pull request to fix the outdated Python version and update the environment configuration:

Assistant: I'm preparing to create a pull request to fix the failing workflow and Python version compatibility issues in your repository. Please accept the tool call to proceed with the fixes.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Update Python version in environment.yml to 3.10 Fix failing CI: update Python 3.6.9 → 3.10, restore deleted workflow Apr 4, 2026
Copilot AI requested a review from anziaayush April 4, 2026 16:33
@anziaayush anziaayush marked this pull request as ready for review April 4, 2026 18:38
Copilot AI review requested due to automatic review settings April 4, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to restore broken CI by modernizing the Conda environment away from EOL Python 3.6.9 and re-adding the previously deleted GitHub Actions workflow.

Changes:

  • Update environment.yml to use Python 3.10 and explicitly include pip for pip: dependencies.
  • Clean up Requirements.txt by removing a malformed header line.
  • Restore .github/workflows/python-package-conda.yml and add minimal job permissions hardening.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.

File Description
environment.yml Moves the Conda environment to Python 3.10 and adds pip to support pip: section installs.
Requirements.txt Removes an invalid header line so the file contains only actual requirements entries.
.github/workflows/python-package-conda.yml Restores CI workflow configuration and adds contents: read permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +22
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow invokes conda but never installs/initializes Miniconda/Mambaforge. On GitHub-hosted runners conda (and $CONDA) are not guaranteed to exist, so echo $CONDA/bin and subsequent conda env update can fail. Use conda-incubator/setup-miniconda (or equivalent) to provision conda and activate the environment, and avoid mixing actions/setup-python with conda-managed Python in the same job.

Suggested change
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Set up Miniconda with Python 3.10
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.10'
auto-activate-base: true
activate-environment: base

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +35
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conda install flake8 / conda install pytest are missing -y (or equivalent non-interactive flag). In CI these commands can block waiting for confirmation, causing the job to hang.

Suggested change
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install pytest
conda install -y flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda install -y pytest

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,36 @@
name: Python Package using Conda

on: [push]

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow only runs on push. If the intent is to restore CI for PR validation as well, add a pull_request trigger (and optionally workflow_dispatch) so changes are tested before merge.

Suggested change
on: [push]
on:
push:
pull_request:
workflow_dispatch:

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +11
strategy:
max-parallel: 5

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strategy: max-parallel has no effect here because the job doesn't define a matrix. Consider removing it or introducing a matrix (e.g., multiple Python versions/OS) if parallelism is intended.

Suggested change
strategy:
max-parallel: 5

Copilot uses AI. Check for mistakes.
- name: Test with pytest
run: |
conda install pytest
pytest

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow runs pytest, but the repository doesn’t appear to contain any test files (no test_*.py / *_test.py found). pytest will typically exit with code 5 when no tests are collected, which would keep CI failing. Either add at least one minimal smoke test, or adjust the workflow to skip/remove the pytest step until tests exist.

Suggested change
pytest
if find . \( -name 'test_*.py' -o -name '*_test.py' \) | grep -q .; then
pytest
else
echo "No pytest test files found; skipping pytest."
fi

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants