This repository ships both a CLI and a Python package.
This guide is safe to use as a local release rehearsal for a test version. It does not assume that tagging, GitHub Release creation, or PyPI publishing must happen in the current working tree.
Run the local validation gates before tagging a release:
python -m pytest -q
python -m build --sdist --wheel
python -m twine check dist/*Check the currently published version before deciding whether to publish:
python -m pip index versions code2skillInstall the public package in an isolated environment when you need to compare the live PyPI experience against the local release candidate. The expected command list includes scan, estimate, ci, adapt, and doctor.
If you are only validating a test build locally:
- keep the repository on an unreleased working branch
- run the validation gates
- inspect the generated files in
dist/ - install the wheel in an isolated environment
- do not tag or upload anything yet
When doing repeated rehearsals, remove old dist/ contents first so you do not accidentally validate or upload stale artifacts from another version.
Optional clean-install smoke check:
python -m venv .venv-smoke
. .venv-smoke/bin/activate
pip install dist/code2skill-*.whl
code2skill --help
code2skill --version
python -m code2skill --help
code2skill scan . --structure-only --output-dir .code2skill-smoke
code2skill estimate . --output-dir .code2skill-smokeWindows PowerShell smoke check:
python -m venv .venv-smoke
.\.venv-smoke\Scripts\Activate.ps1
pip install (Get-ChildItem dist\code2skill-*.whl | Select-Object -First 1).FullName
code2skill --help
code2skill --version
python -m code2skill --help
code2skill scan . --structure-only --output-dir .code2skill-smoke
code2skill estimate . --output-dir .code2skill-smokeWhen cutting a new release:
- Update
__version__insrc/code2skill/version.py - Keep
pyproject.tomlon the dynamic version source unless the build backend changes - Add a new note in
docs/releases/ - Update
CHANGELOG.md
For a test-version rehearsal, you can skip this section and keep the current version unchanged.
This repository includes:
.github/workflows/ci.yml: unit tests plus package build and install smoke check.github/workflows/release.yml: version validation, build,twine check, and GitHub Release creation on version tags.github/workflows/publish-pypi.yml: manual PyPI publishing from a selected ref
The checked-in release workflow is intentionally repository-focused. It does not publish to PyPI automatically.
PyPI publishing is handled separately through the manual publish-pypi.yml workflow.
Use .github/workflows/publish-pypi.yml only when you explicitly want to publish a built version to PyPI.
Recommended flow:
- prepare and push the final release commit
- make sure
src/code2skill/version.pyhas the final version andpyproject.tomlstill points to the dynamic version source - run the
Releaseworkflow via a version tag so GitHub Release creation succeeds - manually run
Publish PyPIfrom the same ref and provide the exact version string
This keeps repository release automation and package publication separate.
Before publishing, confirm the built artifacts are for one version only and that the PyPI long description renders cleanly:
Remove-Item -Recurse -Force dist
python -m build --sdist --wheel
python -m twine check dist/*On non-Windows shells, use rm -rf dist instead of Remove-Item.
- do not use
twine upload dist/*ifdist/contains artifacts from multiple versions - upload only the exact wheel and sdist for the intended version
- tag and publish only from a clean
git status