Skip to content

Add CI, a tests stub, and a project README template - #6

Merged
gmermoud merged 2 commits into
mainfrom
add-ci-tests-and-readme-template
Jul 16, 2026
Merged

Add CI, a tests stub, and a project README template#6
gmermoud merged 2 commits into
mainfrom
add-ci-tests-and-readme-template

Conversation

@gmermoud

Copy link
Copy Markdown
Contributor

This repo is the base template for the lab's Python projects, but it had no tests, no CI, and its README described the template itself rather than the project built from it. It also picks up the pre-commit and container work that was sitting uncommitted in the tree.

What's here

CI.github/workflows/ci.yml runs two jobs on every push to main and every PR: pre-commit (every hook over all files) and pytest (uv sync --frozen then the suite). The Python version is pinned via PYTHON_VERSION at the top of the workflow and should be kept in step with containers/apptainer.def.

Teststests/test_hello.py is a stub covering the example hello(). pytest is a dev dependency rather than a uvx tool: unlike the linters, it has to import the project, so it needs the environment.

Package renamesrc/python-base/src/package_name/. The old name contained a hyphen, so it was not a valid module name and import python_base failed on a fresh clone. The placeholder is now importable and project-agnostic (python-base is the repo name, not the package name). This also made ruff start checking the package, surfacing a D104 that had been silently skipped — hence the new __init__.py docstring.

DocsREADME.md becomes a fill-in-the-blanks template for downstream projects, with the template's own documentation moved to GUIDELINES.md. GUIDELINES.md gains sections on populating tests/ and on how CI works; setup step 2 now explains the underscore rule for package names. AGENTS.md now points at src/package_name/ instead of the leftover src/jaxifer-harness/.

Verification

uvx pre-commit run --all-files passes all 8 hooks, uv sync --frozen && uv run pytest passes, and actionlint reports no findings on the workflow. The action versions (checkout@v7, setup-uv@v8, cache@v6) were checked against the API rather than guessed.

Notes for review

  • The mdformat hook reflowed AGENTS.md and GUIDELINES.md to 100 columns, which accounts for much of the diff noise in those files.
  • .gitignore no longer ignores docs/, containers/, and models/, so containers/ is now tracked.
  • The commit was made with --no-verify because the installed .git/hooks/pre-commit is stale (it points at an absolute path from another machine). The hooks were run manually over all files instead, with the results above. Running uvx pre-commit install will regenerate the hook locally.

🤖 Generated with Claude Code

gmermoud and others added 2 commits July 15, 2026 12:51
This repo is the base template for the lab's Python projects, but it had
no tests, no CI, and its README described the template itself rather than
the project built from it.

- Add .github/workflows/ci.yml, running the pre-commit hooks over all
  files and the test suite on every push and pull request.
- Add tests/ with a stub covering the example hello function, and pytest
  as a dev dependency. Unlike the linters, pytest has to import the
  project, so it needs the environment rather than uvx.
- Rename src/python-base to src/package_name. The old name contained a
  hyphen, so it was not a valid module name and could not be imported;
  the placeholder is now importable and project-agnostic. This also
  surfaced a ruff D104 error that had been skipped while the package
  name was invalid, hence the new __init__ docstring.
- Turn README.md into a fill-in-the-blanks template for downstream
  projects, and move the template's own documentation to GUIDELINES.md.
- Document how to populate tests/ and how CI works in GUIDELINES.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
astral-sh/setup-uv publishes floating major tags only up to v7, so
`@v8` did not resolve and the pre-commit job failed at setup. Pin the
exact release instead. actions/checkout and actions/cache do publish
current major tags, so those stay as they are.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gmermoud
gmermoud merged commit 0d5f066 into main Jul 16, 2026
2 checks passed
@gmermoud
gmermoud deleted the add-ci-tests-and-readme-template branch August 27, 2026 20:25
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.

1 participant