PyPI publish
Ship hoox-pyne to PyPI under the personal jango-blockchained account (API token or Trusted Publishing). Import package stays pynescript.
This page
PyPI publish
Abstract
The Python distribution name on PyPI is hoox-pyne. After install, the import path stays pynescript; preferred CLIs are pyne / pyne-lsp (aliases: pynescript / pynescript-lsp).
PyPI ownership is the personal account jango-blockchained (not a PyPI organization — org approval is not required). Automation still runs on GitHub hoox-sh/pyne via .github/workflows/publish.yml.
Auth modes (first match wins):
- API token — repo secret
PYPI_API_TOKENfrom the personal PyPI account (recommended while no PyPI org is needed). - Trusted Publishing (OIDC) — pending publisher created while logged in as
jango-blockchained, with GitHub Owner =hoox-sh(where Actions run).
Why not
pynescriptorpyneon PyPI?pynescriptis owned by elbakramer/pynescript; plainpyne/PyNEis an unrelated 0.1.0 process-networking library. We ship ashoox-pyne; the import package stayspynescript.
Install surface
pip install hoox-pyne
pip install "hoox-pyne[lsp]"
pip install "hoox-pyne[pro]"
python -c "import pynescript; print(pynescript.__version__)"
pyne --help
pyne-lsp # stdio language server (alias: pynescript-lsp)
One-time setup (personal PyPI account)
A. Recommended — API token (no org, no OIDC)
- Sign in at pypi.org as
jango-blockchained(2FA required). - Account settings → API tokens → Add API token.
- Name: e.g.
hoox-sh-pyne-gha - Scope: Entire account for the first upload of
hoox-pyne; after the project exists you can rotate to a project-scoped token.
- Name: e.g.
- Copy the token (
pypi-…) once. - On GitHub:
# Environment (optional reviewers / wait timer)
gh api -X PUT repos/hoox-sh/pyne/environments/pypi
# Never commit the token — Actions secret only
gh secret set PYPI_API_TOKEN -R hoox-sh/pyne
# paste pypi-... token
- First successful tag (or
workflow_dispatchwithdry_run=false) createshoox-pyneunder your personal account.
B. Optional — Trusted Publishing (OIDC)
Use this when you prefer no long-lived token. Log into PyPI as jango-blockchained (personal user), then:
| Field | Value |
|---|---|
| PyPI project name | hoox-pyne |
| Owner | hoox-sh ← GitHub repo owner (workflow host), not your PyPI username |
| Repository | pyne |
| Workflow name | publish.yml |
| Environment name | pypi |
Leave PYPI_API_TOKEN unset so the publish job uses OIDC.
Do not put
jango-blockchainedin the GitHub Owner field unless the workflow actually runs undergithub.com/jango-blockchained/pyne. OIDC is bound to the repo that executes the job (hoox-sh/pyne).
GitHub environment
Repo Settings → Environments → pypi on hoox-sh/pyne. Optional: required reviewers on production uploads.
Cut a release
# 1. Version + changelog on main
# src/pynescript/__about__.py → 0.3.14
# vscode-extension/package.json version (same pin when shipping VSIX)
# 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.14-*.whl and hoox_pyne-0.3.14.tar.gz
# 3. Push main, then tag
git tag -a v0.3.14 -m "v0.3.14"
git push origin v0.3.14
# 4. Watch Actions → Publish
If a tag already exists and the wheel was never uploaded, re-run:
Actions → Publish → Run workflow → dry_run=false (builds from that workflow’s default branch / checked-out tag context as configured), or retag a new patch version.
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 | Token if PYPI_API_TOKEN set, else OIDC |
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
| 403 invalid token | Wrong/revoked PYPI_API_TOKEN | Create new token as jango-blockchained; re-gh secret set |
| 403 / no trusted publisher | OIDC path without pending publisher | Add pending publisher or set API token |
| Wrong GitHub Owner in pending publisher | Used PyPI username as Owner | Set Owner to hoox-sh (GitHub org of the repo) |
| Environment not found | Missing GitHub pypi env | gh api -X PUT repos/hoox-sh/pyne/environments/pypi |
| File already exists | Version already on PyPI | Bump __about__.__version__ and tag a new version |
| Tag publish skipped | dry_run dispatch only | Use a real v* tag or dry_run=false |
See also
- Release — CLI/LSP binaries + VSIX
- Publish checklist
- CI
- Root
CONTRIBUTING.md