[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 pynescript on PyPI? That name is already owned by elbakramer/pynescript. Publishing under hoox-pyne avoids 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

  1. Sign in at pypi.org (2FA required).
  2. Account → PublishingAdd a new pending publisher.
  3. Fill:
FieldValue
PyPI project namehoox-pyne
Ownerjango-blockchained
Repositorypyne
Workflow namepublish.yml
Environment namepypi
  1. 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

JobWhenWhat
buildtag v* or dispatchpython -m build + twine check + artifact
publish-pypitag v* or dispatch with dry_run=falseOIDC upload via pypa/gh-action-pypi-publish

Failure modes

SymptomCauseFix
403 / no trusted publisherPending publisher not added or wrong workflow/env nameRe-check PyPI pending publisher fields exactly
Environment not foundMissing GitHub pypi envCreate environment
Wrong wheel name pynescript-*Old pyproject.toml nameEnsure name = "hoox-pyne"
Tag publish skippeddry_run dispatch onlyUse a real v* tag or dry_run=false

See also

  • Release — LSP binaries + VSIX
  • CI
  • Root CONTRIBUTING.md