ci: Migrate workflows to use Makefile targets and pyproject.toml deps.#233
ci: Migrate workflows to use Makefile targets and pyproject.toml deps.#233
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5260b3a1f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pip install -r .github/workflows/requirements.txt | ||
| ruff --version | ||
| pytest --version | ||
| run: python3 -m pip install -e ".[dev]" |
There was a problem hiding this comment.
Avoid editable install in CI dependency step
Using python3 -m pip install -e ".[dev]" causes the job to fail during dependency installation in this repository because setuptools cannot build editable metadata with the current layout (it errors with “Multiple top-level packages discovered in a flat-layout: ['lib', 'reports']”). This means lint/test commands never run; the same regression is also present in .github/workflows/tests.yml with -e ".[dev,test]".
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR migrates the GitHub Actions CI workflows to use the repository’s Makefile targets and installs tooling via pyproject.toml optional dependencies, removing duplicated requirements files and making CI commands consistent with local development.
Changes:
- Update CI workflows to run
make lint,make test-mock, andmake test-examples. - Switch dependency installation in CI to
python3 -m pip install -e ".[dev]"/python3 -m pip install -e ".[dev,test]". - Remove
.github/workflows/requirements.txtandtests/requirements-test.txt.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/python-linter.yml |
Uses editable install with .[dev] and runs make lint; updates checkout/setup-python actions. |
.github/workflows/tests.yml |
Uses editable install with .[dev,test] and runs make test-mock / make test-examples; updates checkout/setup-python actions. |
.github/workflows/requirements.txt |
Removed; CI deps intended to come from pyproject.toml extras. |
tests/requirements-test.txt |
Removed; test deps intended to come from pyproject.toml extras. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: "🛠 Install dependencies" | ||
| run: | | ||
| pip install -r .github/workflows/requirements.txt | ||
| run: python3 -m pip install -e ".[dev,test]" |
There was a problem hiding this comment.
pip install -e ".[dev,test]" requires the repo to be an installable Python project. In the current tree there is no setup.py/setup.cfg, and pyproject.toml lacks a [build-system] section, so this step is likely to fail on a clean CI runner. Consider either (a) adding a minimal [build-system] (e.g., setuptools backend) so editable installs work, or (b) switching CI to install the extras without editable mode using an approach that doesn't require building the project (e.g., a constraints/requirements export).
| run: python3 -m pip install -e ".[dev,test]" | |
| run: python3 -m pip install -r requirements-dev.txt |
| pip install -r .github/workflows/requirements.txt | ||
| ruff --version | ||
| pytest --version | ||
| run: python3 -m pip install -e ".[dev]" |
There was a problem hiding this comment.
Same concern as in tests.yml: this workflow now uses pip install -e ".[dev]", but the repo currently has no setup.py/setup.cfg and pyproject.toml has no [build-system]. On a clean runner this is likely to error because pip can’t build/install the project in editable mode. Add a minimal build backend in pyproject.toml or adjust the install step to avoid editable installs.
| run: python3 -m pip install -e ".[dev]" | |
| run: python3 -m pip install ruff |
| pip install -r .github/workflows/requirements.txt | ||
| ruff --version | ||
| pytest --version | ||
| run: python3 -m pip install -e ".[dev]" |
There was a problem hiding this comment.
This PR removes pinned CI tool versions (ruff==…, pytest==…, pyyaml==…) and replaces them with unpinned ranges via extras. That can make CI results non-reproducible (sudden failures when a new ruff/pytest release lands). If stability is important, consider pinning these versions in pyproject.toml (or using a constraints/lock file that CI installs alongside the extras).
| run: python3 -m pip install -e ".[dev]" | |
| run: | | |
| python3 -m pip install -e ".[dev]" | |
| python3 -m pip install "ruff==0.5.0" "pytest==8.3.3" "pyyaml==6.0.2" |
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| cache: "pip" |
There was a problem hiding this comment.
With cache: "pip" and dependencies now defined in pyproject.toml, it may be safer to set cache-dependency-path: pyproject.toml to ensure cache keys update when optional-dependencies change (otherwise caching can become ineffective depending on the action’s dependency-file detection).
| cache: "pip" | |
| cache: "pip" | |
| cache-dependency-path: pyproject.toml |
nedseb
left a comment
There was a problem hiding this comment.
Addressed all review comments (afaf73e):
- Editable install fails (Codex P1) — Already fixed in previous commit with
[tool.setuptools] packages = []. - Missing
[build-system](Copilot) — Added[build-system]section with setuptools backend. - Unpinned versions (Copilot) — ruff pinned to 0.11.6, pytest to 7.4.0, pyyaml to 6.0.2 (matching previous CI versions).
- cache-dependency-path (Copilot) — Added
cache-dependency-path: pyproject.tomlto both workflows.
|
🎉 This PR is included in version 0.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Closes #230.
Migrates CI workflows to use the Makefile targets introduced in PR #229, creating a single source of truth for commands.
Changes
python-linter.yml:
pip install -r requirements.txt→python3 -m pip install -e ".[dev]"ruff check→make linttests.yml:
pip install -r requirements.txt→python3 -m pip install -e ".[dev,test]"python -m pytest tests/ -v -k mock→make test-mockpython -m pytest tests/test_examples.py -v→make test-examplesRemoved:
.github/workflows/requirements.txt— deps now inpyproject.toml [project.optional-dependencies]tests/requirements-test.txt— same reasonNot changed
check-commits.yml— commit format harmonization tracked in ci: Harmonize commit message format between commitlint and check-commits CI. #231Test plan
make cipasses locally (lint + 164 mock tests + 191 example validations)