Skip to content

ci: make pytest and flake8 checks executable (#11) - #34

Open
2022117144 wants to merge 1 commit into
PiLab-Indonesia:mainfrom
2022117144:fix-ci-pytest-flake8-issue11
Open

2022117144 wants to merge 1 commit into
PiLab-Indonesia:mainfrom
2022117144:fix-ci-pytest-flake8-issue11

Conversation

@2022117144

Copy link
Copy Markdown

Summary

Closes #11.

Make the existing GitHub Actions workflow useful on both pushes and pull requests by replacing its broken dependency step (there is no requirements.txt in this repo), using Python 3.11 (the code uses str | None annotations), and checking Python files with real pytest and flake8 commands.

Changes

  • CI: install lightweight test-only dependencies (pytest and flake8) without requiring an absent requirements file; execute test suite from tests/; use flake8 --select=E9,F63,F7,F82 to catch Python syntax and critical Pyflakes errors across the repo without turning unrelated pre-existing style warnings into failures.
  • Regression tests: eight SQLite-only tests for device insert, upsert, uniqueness, liveness conversion, retrieval, null name, schema idempotency and missing IDs. Tests rely on temporary databases: no Raspberry Pi, Docker, external services or API credentials.
  • Tests README: document reproducible commands and why the lint subset is intentionally limited.

Verification

Run from repo root (Windows, Python 3.10):

  • python -m pytest -q tests: 8 passed (0.25s).
  • python -m flake8 . --select=E9,F63,F7,F82 --show-source: exit 0 (flake8 7.4.1, installed outside repository).
  • git diff --check: exit 0.

CI will run Python 3.11 on ubuntu-latest; I have not claimed an actual GitHub Actions run until checks execute on the PR. This is intentionally a minimal, functioning CI flow, not an assertion that the entire repository is fully style-compliant.

AI-assisted implementation under a human-operated GitHub account. No paid contract, task award or platform payout is implied.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

projects (ci): add GitHub Actions CI (tests + lint)

1 participant