Skip to content

ci: Migrate workflows to use Makefile targets and pyproject.toml deps.#233

Merged
nedseb merged 4 commits intomainfrom
ci/use-makefile-targets
Mar 24, 2026
Merged

ci: Migrate workflows to use Makefile targets and pyproject.toml deps.#233
nedseb merged 4 commits intomainfrom
ci/use-makefile-targets

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 24, 2026

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:

  • Install: pip install -r requirements.txtpython3 -m pip install -e ".[dev]"
  • Lint: ruff checkmake lint
  • Updated actions/checkout v3→v4, actions/setup-python v4→v5

tests.yml:

  • Install: pip install -r requirements.txtpython3 -m pip install -e ".[dev,test]"
  • Mock tests: python -m pytest tests/ -v -k mockmake test-mock
  • Examples: python -m pytest tests/test_examples.py -vmake test-examples
  • Updated actions/checkout v3→v4, actions/setup-python v4→v5

Removed:

  • .github/workflows/requirements.txt — deps now in pyproject.toml [project.optional-dependencies]
  • tests/requirements-test.txt — same reason

Not changed

Test plan

  • make ci passes locally (lint + 164 mock tests + 191 example validations)
  • CI workflows pass on GitHub after push

Copilot AI review requested due to automatic review settings March 24, 2026 11:26
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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]"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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, and make 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.txt and tests/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]"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
run: python3 -m pip install -e ".[dev,test]"
run: python3 -m pip install -r requirements-dev.txt

Copilot uses AI. Check for mistakes.
pip install -r .github/workflows/requirements.txt
ruff --version
pytest --version
run: python3 -m pip install -e ".[dev]"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
run: python3 -m pip install -e ".[dev]"
run: python3 -m pip install ruff

Copilot uses AI. Check for mistakes.
pip install -r .github/workflows/requirements.txt
ruff --version
pytest --version
run: python3 -m pip install -e ".[dev]"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
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"

Copilot uses AI. Check for mistakes.
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
cache: "pip"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
cache: "pip"
cache: "pip"
cache-dependency-path: pyproject.toml

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

@nedseb nedseb left a comment

Choose a reason for hiding this comment

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

Addressed all review comments (afaf73e):

  1. Editable install fails (Codex P1) — Already fixed in previous commit with [tool.setuptools] packages = [].
  2. Missing [build-system] (Copilot) — Added [build-system] section with setuptools backend.
  3. Unpinned versions (Copilot) — ruff pinned to 0.11.6, pytest to 7.4.0, pyyaml to 6.0.2 (matching previous CI versions).
  4. cache-dependency-path (Copilot) — Added cache-dependency-path: pyproject.toml to both workflows.

@nedseb nedseb added the ci CI/CD, workflows, linting label Mar 24, 2026
@nedseb nedseb merged commit af2902c into main Mar 24, 2026
3 checks passed
@nedseb nedseb deleted the ci/use-makefile-targets branch March 24, 2026 12:23
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD, workflows, linting released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: Migrate CI workflows to use Makefile targets.

2 participants