Publishing aegis-ai-sast to PyPI

The installable distribution name is aegis-ai-sast. The PyPI name aegis-scan belongs to an unrelated project and must never be used in install instructions.

Git tags v4.6.1 and later already run .github/workflows/release.yml. That workflow builds the wheel, attests provenance, and publishes with PyPI Trusted Publishing (OIDC). It does not use a long-lived PYPI_API_TOKEN.

Publishing is off. The repository is private, and an upload to PyPI makes the source public to anyone. publish-pypi is skipped unless the repository variable PUBLISH_TO_PYPI is true (Settings → Secrets and variables → Actions → Variables). A tag still runs verify, build and container.

A successful upload requires four things that cannot be committed:

  1. A pending Trusted Publisher on PyPI for the unpublished name

aegis-ai-sast.

  1. A GitHub Actions environment named exactly pypi on

ThomasGenua/aegis.

  1. The release tag existing on GitHub.com ThomasGenua/aegis.

This Origin repo is an inbound mirror; pushing a tag here does not start GitHub Actions.

  1. The repository variable PUBLISH_TO_PYPI set to true.

Until the first upload succeeds, https://pypi.org/pypi/aegis-ai-sast/json returns 404 and pip install aegis-ai-sast cannot work.

Trusted Publisher fields

Create the publisher at https://pypi.org/manage/account/publishing (Pending publisher → GitHub). Values must match the workflow file byte-for-byte:

FieldValue
PyPI project nameaegis-ai-sast
OwnerThomasGenua
Repositoryaegis
Workflow namerelease.yml
Environment namepypi

Do not put a directory prefix on the workflow name. PyPI matches the file name in .github/workflows/.

GitHub environment

On ThomasGenua/aegis → Settings → Environments → New environment:

until someone approves the publish-pypi job

No environment secrets are required. The job's id-token: write permission is the credential.

First publish

  1. Save the pending publisher on PyPI before the release job runs.

The first successful OIDC publish creates the project.

  1. Confirm v4.6.3 (or the version in pyproject.toml) exists on

GitHub.com and that Actions is enabled.

  1. Set PUBLISH_TO_PYPI to true only once the source may be public.
  2. The Release workflow must show verify → build → publish-pypi.
  3. Confirm https://pypi.org/pypi/aegis-ai-sast/4.6.3/json (or the

tagged version) returns 200.

Re-running publish-pypi after a successful upload fails because the version is immutable. That is intended.

Local build only

From a clone, with no credentials. Use requirements-release.txt, not the test extra: Twine 7.0.0 needs packaging>=26.1, and the runtime pin is packaging==24.2. Mixing them in one pip install fails before pytest runs.

python3 -m pip install -r requirements-release.txt
python3 -m build
python3 -m twine check dist/*

The Tests workflow dist job and the Release workflow build job run those commands. Do not twine upload with an API token unless Trusted Publishing is unavailable; if you must, use a scoped token and delete it after the first upload.

Name collision

PyPI already has an unrelated project named aegis-scan. Never install that name for this software. The only supported distribution is aegis-ai-sast. After the first upload succeeds:

pip install aegis-ai-sast

Until then, install from a clone with pip install -e ..