[PyPI publish]
Ship hoox-pyne to PyPI via Trusted Publishing (OIDC). Import package stays pynescript.
PyPI publish
Abstract
The Python distribution name on PyPI is hoox-pyne. After install, the import path and CLIs stay pynescript / pynescript-lsp. Automation lives in .github/workflows/publish.yml and uses Trusted Publishing (OIDC) against the GitHub environment pypi.
Why not
pynescripton PyPI? That name is already owned by elbakramer/pynescript. Publishing underhoox-pyneavoids a name collision while keeping the code package id.
Install surface
pip install hoox-pyne
pip install "hoox-pyne[lsp]"
pip install "hoox-pyne[pro]"
python -c "import pynescript; print(pynescript.__version__)"
pynescript --help
pynescript-lsp # stdio language server
One-time registration (do this before the first tag)
1. PyPI pending trusted publisher
- Sign in at pypi.org (2FA required).
- Account → Publishing → Add a new pending publisher.
- Fill:
| Field | Value |
|---|---|
| PyPI project name | hoox-pyne |
| Owner | jango-blockchained |
| Repository | pyne |
| Workflow name | publish.yml |
| Environment name | pypi |
- Save. The project is created automatically on the first successful upload.
2. GitHub environment
Repo Settings → Environments → New environment → pypi.
Optional: required reviewers, wait timer, or branch policy limited to tags / main.
# CLI equivalent (no protection rules):
gh api -X PUT repos/jango-blockchained/pyne/environments/pypi
3. Private repo note
pyne may be private. Trusted Publishing still works; the workflow only needs id-token: write on the publish job (already set).
Cut a release
# 1. Version + changelog on main
# src/pynescript/__about__.py → e.g. 0.3.0
# CHANGELOG.md
# 2. Local smoke (no upload)
pip install build twine
rm -rf dist/
python -m build
twine check dist/*
# expect: hoox_pyne-0.3.0-*.whl and hoox_pyne-0.3.0.tar.gz
# 3. Push main, then tag
git tag -a v0.3.0 -m "v0.3.0"
git push origin v0.3.0
# 4. Watch Actions → Publish
Dry-run without upload: Actions → Publish → Run workflow → dry_run=true.
Workflow map
| Job | When | What |
|---|---|---|
build | tag v* or dispatch | python -m build + twine check + artifact |
publish-pypi | tag v* or dispatch with dry_run=false | OIDC upload via pypa/gh-action-pypi-publish |
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
| 403 / no trusted publisher | Pending publisher not added or wrong workflow/env name | Re-check PyPI pending publisher fields exactly |
| Environment not found | Missing GitHub pypi env | Create environment |
Wrong wheel name pynescript-* | Old pyproject.toml name | Ensure name = "hoox-pyne" |
| Tag publish skipped | dry_run dispatch only | Use a real v* tag or dry_run=false |