Fix CI: Quote Python versions, update actions, and install Open Babel - #2
Conversation
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes CI workflow configuration issues that prevented tests from running successfully on GitHub Actions. The primary issue was YAML parsing unquoted Python version numbers (e.g., 3.10) as floats (3.1), causing version lookup failures. The solution includes quoting Python versions, updating to the latest actions/setup-python version, ensuring numpy is installed, and adding a comprehensive .gitignore file.
Changes:
- Quote all Python version numbers in workflow matrices to prevent YAML float parsing
- Update actions/setup-python from deprecated v4 to v5
- Add numpy to dependencies in pytest.yml (already present in python-pytest.yml)
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .gitignore | Adds comprehensive Python, IDE, testing, and OS-specific ignore patterns |
| .github/workflows/python-pytest.yml | Quotes Python versions and updates setup-python to v5 |
| .github/workflows/pytest.yml | Quotes Python versions, updates setup-python to v5, and adds numpy dependency |
Comments suppressed due to low confidence (1)
.github/workflows/pytest.yml:32
- This workflow file appears to duplicate the functionality of python-pytest.yml. Both workflows run pytest on multiple Python versions with similar configurations. Having two separate workflow files with overlapping purposes can lead to maintenance overhead and confusion. Consider consolidating these into a single workflow file or clearly differentiating their purposes with distinct names and configurations.
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest numpy
- name: Run pytest
run: pytest -q
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
obabel is not found: add a requirement to have openbabel or obabel available |
fbischoff
left a comment
There was a problem hiding this comment.
obabel is not found in CI: add a requirements.txt to ensure availability
Co-authored-by: fbischoff <7567292+fbischoff@users.noreply.github.com>
Added Open Babel installation to both CI workflows and created requirements.txt. The workflows now install
Created requirements.txt with pytest and numpy dependencies. Both workflows now install Open Babel system package ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
CI workflows failed with "The version '3.1' with architecture 'x64' was not found" while tests passed locally.
Changes
3.10as float3.1, losing trailing zero. Changed to strings:["3.9", "3.10", "3.11"]actions/setup-python@v4→@v5: v4 runner deprecated and incompatible with current GitHub Actionsopenbabelsystem package installation to both workflows to provide theobabelcommand-line tool required for z-matrix conversionsrequirements.txt: Add requirements file withpytestandnumpydependencies for better dependency managementpytest.ymlfor consistency withpython-pytest.yml(both now test 3.9, 3.10, 3.11).gitignore: Exclude Python cache and build artifactsstrategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ["3.9", "3.10", "3.11"]Both workflow files (
pytest.yml,python-pytest.yml) now have consistent, correct configuration with all required dependencies.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.