Skip to content

feat: fail CI if pyproject.toml still has placeholder strings - #59

Merged
TomKaltofen merged 2 commits into
mainfrom
feat/placeholder-check
May 25, 2026
Merged

feat: fail CI if pyproject.toml still has placeholder strings#59
TomKaltofen merged 2 commits into
mainfrom
feat/placeholder-check

Conversation

@TKaltofen

@TKaltofen TKaltofen commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds [testenv:placeholders] in tox.ini that greps pyproject.toml for the template placeholder strings and exits 1 if any are found. Uses skip_install = true and an inline shell grep, so it does not pay the install cost or re-trigger setuptools on the placeholder name.
  • The check covers every field the README setup walks through: name (placeholder-my-plugin), authors name (Your Name placeholder), authors email (placeholder@placeholder.com), description (TEMPLATE PLACEHOLDER), tool.setuptools.packages.find.include ("placeholder*"), and tool.pytest.ini_options.testpaths ("placeholder"). Patterns use POSIX character classes ([.], [*]) for GNU/BSD grep portability.
  • Wires the check into .github/workflows/test.yml as an additional step on the existing test job, gated by matrix.python-version == '3.10' && github.repository != 'mloda-ai/mloda-plugin-template'. The template repo's own CI is green; scaffolded plugins inherit no exemption and fail until they update pyproject.toml.
  • Documents tox -e placeholders in README.md "Setup Your Plugin" with the template-repo exemption explicitly called out.
  • Adds a one-line note in docs/github-repository-settings.md so a reader who reshapes the Python matrix knows the placeholder check rides on the 3.10 leg.

The default tox invocation (envlist python310) is unchanged, so the template repo's local and CI runs stay green. The new env runs only via tox -e placeholders.

Closes #47

Test plan

  • tox -e placeholders on current main fails with exit 1, printing all five matching pyproject.toml lines (name, description, authors, include, testpaths) and an instructional error
  • Same env passes when every placeholder field is temporarily replaced (verified via per-field swaps on a pyproject.toml.bak, then restored; git diff pyproject.toml empty afterward)
  • Default tox (matrix python310) still passes after the changes
  • Workflow if: expression syntax validated by GitHub Actions parser (Actions tab on the push for this branch)
  • Post-merge: @TKaltofen will confirm the new CI step appears (and fails as intended) on the first scaffolded plugin's PR. The if: gate cannot be fully exercised pre-merge without pushing the workflow file to a non-mloda-ai/mloda-plugin-template fork.

TKaltofen added 2 commits May 25, 2026 14:38
Adds a `placeholders` tox env that greps `pyproject.toml` for the
template's placeholder strings (`placeholder-my-plugin`,
`Your Name placeholder`, `placeholder@placeholder.com`) and fails if
any are present.

The check is wired into `test.yml` as a step gated by
`github.repository != 'mloda-ai/mloda-plugin-template'` (and pinned
to the 3.10 matrix leg so it runs once per workflow). This keeps the
template repo's own CI green while scaffolded plugins fail until
they update `pyproject.toml`.

README "Setup Your Plugin" documents how to run the check locally and
the template-repo exemption. `docs/github-repository-settings.md`
notes that the check rides on the 3.10 matrix leg.

Closes #47
The check now flags the description and the setuptools/pytest
placeholder entries in addition to name and authors, so it matches
every field the README setup walks the user through. Patterns use
POSIX character classes ([.], [*]) instead of backslash escapes for
portability across GNU and BSD grep.
@TKaltofen
TKaltofen force-pushed the feat/placeholder-check branch from aeee62b to 114af4e Compare May 25, 2026 14:42
@TomKaltofen
TomKaltofen merged commit 1803e33 into main May 25, 2026
5 checks passed
@TomKaltofen
TomKaltofen deleted the feat/placeholder-check branch May 25, 2026 14:45
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.

feat: fail CI if pyproject.toml still has placeholder strings

2 participants