Fix failing CI: update Python 3.6.9 → 3.10, restore deleted workflow#1
Fix failing CI: update Python 3.6.9 → 3.10, restore deleted workflow#1Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/anziaayush/Lane-detection-in-Python-/sessions/fbc6ff1d-d173-40b3-8227-5039b3e8cadd Co-authored-by: anziaayush <187642893+anziaayush@users.noreply.github.com>
Agent-Logs-Url: https://github.com/anziaayush/Lane-detection-in-Python-/sessions/fbc6ff1d-d173-40b3-8227-5039b3e8cadd Co-authored-by: anziaayush <187642893+anziaayush@users.noreply.github.com>
There was a problem hiding this comment.
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.ymlto use Python 3.10 and explicitly includepipforpip:dependencies. - Clean up
Requirements.txtby removing a malformed header line. - Restore
.github/workflows/python-package-conda.ymland 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.
| - 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 |
There was a problem hiding this comment.
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.
| - 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 |
| 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 |
There was a problem hiding this comment.
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.
| 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 |
| @@ -0,0 +1,36 @@ | |||
| name: Python Package using Conda | |||
|
|
|||
| on: [push] | |||
There was a problem hiding this comment.
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.
| on: [push] | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: |
| strategy: | ||
| max-parallel: 5 |
There was a problem hiding this comment.
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.
| strategy: | |
| max-parallel: 5 |
| - name: Test with pytest | ||
| run: | | ||
| conda install pytest | ||
| pytest |
There was a problem hiding this comment.
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.
| pytest | |
| if find . \( -name 'test_*.py' -o -name '*_test.py' \) | grep -q .; then | |
| pytest | |
| else | |
| echo "No pytest test files found; skipping pytest." | |
| fi |
Python 3.6.9 is EOL and no longer available in Conda channels, causing
LibMambaUnsatisfiableErroron every CI run. The workflow file was also deleted from the repo, leaving CI broken entirely.Changes
environment.yml:python==3.6.9→python=3.10; add explicitpipconda dependency (required when pip-section packages are present, otherwise Conda may use wrong pip)Requirements.txt: Remove malformed3. requirements.txtheader line.github/workflows/python-package-conda.yml: Restore deleted workflow; addpermissions: contents: read(security hardening per CodeQL)Original prompt
This pull request was created from Copilot chat.