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
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
python-version: "3.14"

- name: Configure git
run: |
git config --global user.name "Tester"
git config --global user.email "test@example.com"

- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@v10.3.2
- run: uvx --with tox-uv tox -e py,docs,style
- run: uv build
- uses: pypa/gh-action-pypi-publish@release/v1
46 changes: 9 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -31,35 +31,7 @@ jobs:
git config --global user.name "Tester"
git config --global user.email "test@example.com"

- uses: astral-sh/setup-uv@v7
- run: uvx --with tox-uv tox -e py

- uses: coverallsapp/github-action@v2
with:
file: .tox/test-reports/coverage.xml
flag-name: python-${{ matrix.python-version }}
parallel: true

test-eol:
name: Test py${{ matrix.python-version }} (EOL)
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.7"] # Only one ancient python needed for test coverage...

steps:
- uses: actions/checkout@v6
- uses: deadsnakes/action@v3.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Configure git
run: |
git config --global user.name "Tester"
git config --global user.email "test@example.com"

- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@v10.3.2
- run: uvx --with tox-uv tox -e py

- uses: coverallsapp/github-action@v2
Expand All @@ -70,7 +42,7 @@ jobs:

coveralls-finish:
name: Finish Coveralls
needs: [test, test-eol]
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Finish parallel build
Expand All @@ -82,10 +54,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
python-version: "3.15"

- uses: astral-sh/setup-uv@v7
- uses: astral-sh/setup-uv@v10.3.2
- run: uvx --with tox-uv tox -e docs,style
116 changes: 17 additions & 99 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,22 @@
# AGENTS.md
# setupmeta — repo context

## Purpose
setupmeta is a setuptools plugin: git-tag-based versioning and version bumps, plus auto-filled
`setup.py` metadata. It's self-hosted: our own `setup.py` uses it.

This file defines repo-specific guidance for coding agents working on `setupmeta`.
Use it as the first source of truth for how to make changes safely and consistently.
## Docs — read the relevant set before diving into the code

## Project Summary
- **[`docs/`](./docs/index.md)** — how the repo works inside (internal, not published).
- **[`README.rst`](./README.rst)** — the user guide, also published on PyPI as `long_description`.

- `setupmeta` primarily supports git-tag-based versioning and automated version bumps.
- Secondarily, it also:
- Provides custom setup commands: `explain`, `version`, and `check` (this will be phased out
as `setup.py` gets retired in favor of `pyproject.toml`).
- Helps keep `setup.py` files minimal by auto filling metadata and requirements (this will also
be sunset with `pyproject.toml`, as that format is declarative and doesn't lend itself to autofill).
- The project is self-hosted: `setup.py` uses `setupmeta` itself and has bootstrap behavior.
## Working notes

## Core Principles

- Preserve backward compatibility for users relying on legacy `setup.py` workflows.
- Keep runtime dependencies minimal; prefer stdlib for runtime code.
- Favor explicit, test-covered behavior over cleverness.
- Keep documentation aligned with actual behavior and test scenarios.

## Repository Layout

- `setupmeta/`: main library code (`commands`, `model`, `scm`, `versioning`, etc.)
- `tests/`: unit tests + scenario replay tests
- `tests/scenarios/` and `examples/`: behavior fixtures with `expected.txt` snapshots
- `docs/`: user and contributor documentation
- `setup.py`: self-bootstrapping package definition
- `tox.ini`: test/lint/docs/coverage orchestration

## Environment and Commands

Use these commands from repo root:

- Quick tests: `.venv/bin/pytest -q`
- Full test/lint/docs run: `tox`
- Single tox env: `tox -e py314`
- Fast compatibility matrix (old+new + coverage): `tox -e py39,py314,coverage`
- Style only: `tox -e style`
- Docs checks: `tox -e docs`
- Refresh scenario snapshots: `tox -e refreshscenarios`
- Manual command checks:
- `.venv/bin/python setup.py explain`
- `.venv/bin/python setup.py version`
- `.venv/bin/python setup.py check -q`

Notes:

- `tox.ini` pins `UV_CACHE_DIR` to `.tox/.uv-cache`, to help runs in sandboxed environments.
- `py37` tox target exists because it is the oldest Python still supported by this library.
- If `py37` is unavailable locally (common on macOS arm64), substitute the oldest available
interpreter and pair it with the newest one.
Example: system Python `3.9` + `3.14` via `tox -e py39,py314,coverage`.
- Intent: keep local runs fast while still exercising one older runtime and one modern runtime,
with `coverage combine` validating cross-env coverage data.

## Code Change Expectations

- Keep changes narrow and focused.
- Maintain Python compatibility targeted by this repo (including older supported versions).
- When changing behavior, update both tests and docs in the same change.
- Do not silently alter CLI output formats used by scenario snapshots unless intentional.
- If you touch versioning logic, verify:
- `tests/test_versioning.py`
- `tests/test_setup_py.py`
- scenario outputs that include `version`/`explain`.

## Scenario Snapshot Rules

- Scenario tests compare command output against `expected.txt`.
- If behavior changes are intentional:
1. Regenerate snapshots (`tox -e refreshscenarios`).
2. Review diffs in `tests/scenarios/*/expected.txt` and `examples/*/expected.txt`.
3. Ensure docs and release notes explain user-visible changes.
- If behavior changes are not intentional, fix code/tests instead of accepting snapshot churn.

## Documentation Rules

- Keep `README.rst`, `docs/*.rst`, and example READMEs consistent with current behavior.
- Avoid documenting deprecated/removed commands as active features.
- Keep versioning docs aligned with current strategy defaults and command examples.
- Record user-visible changes in `HISTORY.rst`.

## Safety and Review Checklist

Before finalizing a change, verify:

1. Tests pass for affected areas.
2. Formatting/lint checks pass.
3. Scenario snapshots are unchanged unless intentionally updated.
4. Docs are updated if behavior or commands changed.
5. No unrelated files were modified.

## When to Ask for Clarification

Ask the maintainer before proceeding if:

- A change could break backward compatibility.
- Expected output changes are broad/noisy and intent is unclear.
- A docs update conflicts with tested behavior.
- A refactor touches bootstrap or version bump internals in `setup.py`, `setupmeta/hook.py`, `setupmeta/versioning.py`, or `setupmeta/scm.py`.
- Quick tests: `.venv/bin/pytest -q`; before finishing, `tox -e style,docs` and the oldest +
newest Python with coverage (see [contributing](./docs/contributing.md)).
- Runtime code is stdlib-only, and must run on the oldest Python `python_requires` allows.
- Preserve backward compatibility for legacy `setup.py` users.
- Behavior changes ship with tests, README updates, and reviewed snapshot diffs in the same change.
- Keep the upcoming version's section at the top of [CHANGELOG.md](./CHANGELOG.md) current with
user-visible changes.
- Ask the maintainer before changing bootstrap or version bump internals (`setup.py`,
`setupmeta/hook.py`, `setupmeta/versioning.py`, `setupmeta/scm.py`), or when a change could
break backward compatibility or produce broad snapshot churn.
Loading
Loading