validate-builds
Purpose
Provide a concise, auditable checklist and commands for agents to validate package builds produced by uv build and to inspect the generated artifacts (dist/). This skill documents both quick manual checks and steps suitable for automation in CI or agent workflows.
Inputs
- •A checkout of the repository with working
pyproject.tomlanduv.lock(if present). - •A Python virtual environment for install/validation steps.
Outputs
- •Verified build artifacts in
dist/(source distribution and wheel). - •A short validation report (pass/fail) including any mismatches or missing files.
Preconditions
- •
uv(and the pinneduv_buildbackend) is installed and available on PATH. - •Tests and linters have been run and passed locally or in CI.
- •The repository declares
uv_buildin[build-system].requiresfor pure-Python packages.
Validation Steps (manual and automated)
- •
Build the project reproducibly
- •Run:
uv build --locked - •Expected:
dist/contains exactly one sdist (*.tar.gz) and one wheel (*.whl) matching the project name and version.
- •Run:
- •
Inspect artifact filenames and counts
- •Verify wheel filename format:
{name}-{version}-py3-none-any.whlfor pure-Python packages. - •Verify sdist filename format:
{name}-{version}.tar.gz.
- •Verify wheel filename format:
- •
Inspect wheel contents
- •List wheel contents:
python -m zipfile -l dist/*.whlorunzip -l dist/*.whl. - •Check that the top-level module is present (e.g.,
pytextgen/files) and that small data files are in the module root or.datadirectory as expected. - •Confirm
.dist-infometadata exists and containsMETADATA,RECORD, andentry_points.txt(if applicable).
- •List wheel contents:
- •
Inspect sdist contents
- •Extract or list the sdist and confirm
pyproject.tomland the module source are included.
- •Extract or list the sdist and confirm
- •
Quick smoke install
- •Create a fresh venv and install the wheel without dependencies:
python -m venv .venv.test && .\.venv.test\Scripts\Activate.ps1(Windows) orpython -m venv .venv.test && source .venv.test/bin/activate(POSIX). - •Install:
python -m pip install --no-deps dist/*.whl. - •Verify import and version:
python -c "import pytextgen; print(pytextgen.VERSION)"(should matchpyproject.tomlversion).
- •Create a fresh venv and install the wheel without dependencies:
- •
Validate metadata and license
- •Confirm
project.licensefiles are copied into.dist-info(look for LICENSE files). - •Confirm
project.readmeis included in package metadata (pip/packaging UI uses it).
- •Confirm
- •
Optional deeper checks
- •Run a test install from sdist:
python -m pip install --no-deps dist/*.tar.gzand run the smoke import above. - •Use
pip show -f pytextgento list installed files and confirm layout.
- •Run a test install from sdist:
- •
Capture build logs and backend version
- •For debugging, enable verbose logs:
RUST_LOG=uv=debug uv build --locked(or set RUST_LOG=uv=verbose) to confirm whichuv_buildwas used.
- •For debugging, enable verbose logs:
Automated validation checklist (CI-friendly)
- •Run
uv build --locked. - •Assert that
dist/*.whlanddist/*.tar.gzexist and their names encode the package name and version. - •Run
python -m pip install --no-deps dist/*.whlin a fresh venv and assertpython -c "import pytextgen; print(pytextgen.VERSION)"exits 0 and prints the expected version. - •Check
unzip -l dist/*.whloutput contains the module root and.dist-info/METADATAwith expected license and version strings.
What to report when validation fails
- •Missing artifact(s) (wheel or sdist).
- •Filenames don't match expected
{name}-{version}pattern. - •Missing top-level module files inside the wheel.
- •Installed package import failure or version mismatch.
- •Missing license or README in package metadata.
Notes & Tips
- •Always use
--lockedto ensure builds are reproducible with the lockfile. - •For non-pure-Python projects (extension modules), the
uv_buildbackend is not suitable; follow the alternative backend guidance in project documentation. - •If using agents, include a small script to run the automated checklist and emit structured JSON or simple pass/fail output for telemetry.
Examples
- •Local quick check:
powershell
uv build --locked python -m venv .venv.test .\.venv.test\Scripts\Activate.ps1 python -m pip install --no-deps dist/*.whl python -c "import pytextgen; print(pytextgen.VERSION)"
- •Minimal CI job step (psuedocode):
yaml
- run: uv build --locked - run: python -m pip install --no-deps dist/*.whl - run: python -c "import pytextgen; assert pytextgen.VERSION == '$(cat pyproject.toml | grep version | ... )'"
If you want, I can also add a small validation script (scripts/validate_build.py) that implements the automated checklist and returns an exit code and JSON report for agents to consume.