Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/python-linter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: "🔎 Python Linter"

on:
Expand All @@ -10,26 +7,22 @@ on:
branches: ["main"]

jobs:
build:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: "⏳ Checkout repository"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "🐍 Set up Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
cache: "pip"
cache-dependency-path: pyproject.toml
python-version: "3.10"

- name: "🛠 Install dependencies"
run: |
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

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

- name: "😾 Lint with ruff"
run: ruff check
run: make lint
6 changes: 0 additions & 6 deletions .github/workflows/requirements.txt

This file was deleted.

14 changes: 6 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,23 @@ on:
jobs:
mock-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: "⏳ Checkout repository"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "🐍 Set up Python"
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.
cache-dependency-path: pyproject.toml
python-version: "3.10"

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

- name: "🧪 Run mock tests"
run: python -m pytest tests/ -v -k mock
run: make test-mock

- name: "📋 Validate examples"
run: python -m pytest tests/test_examples.py -v
run: make test-examples
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools>=64"]
build-backend = "setuptools.build_meta"

[project]
name = "micropython-steami-lib"
version = "0.1.0"
Expand All @@ -6,8 +10,12 @@ license = {text = "GPL-3.0-or-later"}
requires-python = ">=3.7"

[project.optional-dependencies]
dev = ["ruff>=0.9"]
test = ["pytest>=7.0", "pyyaml>=6.0", "mpremote>=1.0"]
dev = ["ruff==0.11.6"]
test = ["pytest==7.4.0", "pyyaml==6.0.2", "mpremote>=1.0"]

[tool.setuptools]
# No Python packages to install — this project contains MicroPython drivers
packages = []

[project.urls]
Homepage = "https://www.steami.cc/"
Expand Down
3 changes: 0 additions & 3 deletions tests/requirements-test.txt

This file was deleted.

Loading