Publishing AgentFEM to PyPI¶
AgentFEM is distributed as a pure Python package. It expects users to install a compatible FEniCSx/DOLFINx stack first, usually from conda-forge, then install AgentFEM with pip.
First-Time PyPI Setup¶
- Create or log in to the PyPI account that will own
agentfem. - Create a pending Trusted Publisher for:
- owner:
haoming-luo - repository:
agentfem - workflow filename:
publish-pypi.yml - environment name:
pypi - Confirm the package name
agentfemis available on PyPI.
Trusted Publishing is preferred because GitHub Actions can publish with OIDC without storing a long-lived PyPI API token in repository secrets.
Release Checklist¶
- Update the version in
pyproject.toml. - Update
__version__in__init__.py. - Update
CITATION.cff,CHANGELOG.md, and the versioned release contract. - Run the smoke examples in a FEniCSx environment.
- Run the same release gate used by CI:
python -m pip install -e ".[dev]"
python -m build
python -m twine check dist/*
python release_gate.py --dist dist --smoke
- Commit the release changes.
- Create and push a version tag:
The GitHub Actions workflow .github/workflows/publish-pypi.yml builds the
wheel and source distribution exactly once. It then installs and verifies that
immutable wheel through the complete serial, MPI, checkpoint, project-template,
and release-workflow gates. Only those same artifacts are published to PyPI;
GitHub provenance attestation is added when repository visibility supports it,
and the workflow never rebuilds after verification.
Install Command for Users¶
After publication:
For optional mesh format conversion: