Local development

Install, test, lint, package, and run PYNE — Make targets after AXIS extraction.

This page

Local development

Abstract

A PYNE checkout is a Python-first workspace: src-layout package + Flask Pro API, optional VS Code extension (Node). PyneTS is the standalone hoox-sh/pynets / @hoox-sh/pynets package. The AXIS charting PWA is a sister repo (axis) — do not recreate frontend/ here.

Conceptual model

Diagram

Rendering…

Interface surface

Make targets (primary)

TargetEffect
make installpip install -e ".[lsp,pro]"
make testfull pytest tests/
make test-clitests/test_cli.py
make test-lsplangserver + lsp_features
make test-backendtests/test_backend.py
make lint / make fmtRuff on src/, tests/, backend/
make packagesdist + wheel (python -m build)
make buildNuitka LSP binary
make build-cliNuitka CLI binary
make build-checkimport check for lsp+cli (~30s)
make build-vscodecompile + package VSIX
make runFlask Pro API (:5002 typical)
make run-lsppython -m pynescript.langserver
make docker-buildbake api
make docker-build-clibake cli
make docker-build-lspbake lsp (pynescript-lsp:latest; GHCR name ghcr.io/hoox-sh/pyne/lsp)
make docker-build-allapi + api-dev + lsp + cli
make docker-buildxmulti-platform release bake (api + cli + lsp)
make docker-push-ghcrgh workflow run ghcr.yml
make docker-cli ARGS="…"compose profile cli (ephemeral)
make deploy-vpsrsync + restart API; health API :5002, AXIS :80 (VPS; local AXIS is :8081)
make docker-upcompose API on :5002
make docker-up-full+ redis profile
make docker-prodgunicorn overlay (ADMIN_TOKEN required)
make docker-smokecurl health on :5002
make docker-down / docker-logsstop / logs

Hatch

hatch run test:test
hatch run test:test-cov
hatch run lint:style
hatch run lint:typing
hatch run lint:gen-parser

Quick desk loop

git clone https://github.com/hoox-sh/pyne.git
cd pyne
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[lsp,compile,pro]"
pyne info
pyne check examples/rsi_strategy.pine
make test-cli
make run   # Pro API

From PyPI (no checkout)

pip install "hoox-pyne[lsp,compile]"
pyne --version   # 0.3.14

Internals

PathWhy it matters
src/pynescript/Editable package root
tests/conftest.pyOptional --example-scripts-dir only; no third-party corpus shipped
backend/requirements.txtPro API deps (also covered by [pro] extra)
hoox-sh/pynetsStandalone TS library (@hoox-sh/pynets); not an in-tree submodule
vscode-extension/PYNE VS Code extension
Dockerfiletargets api, api-dev, lsp, cli

Python

  • Requires-Python: >=3.10
  • CI matrix: 3.10–3.13
  • Hatch test matrix: 3.10–3.12 (no 3.13 cell)
  • Recommended: 3.12+ with venv

Optional extras

ExtraAdds
lsppygls / lsprotocol → pyne-lsp (alias pynescript-lsp)
compilenumpy / numba
data / datafeedccxt
proFlask + gunicorn + matplotlib + redis + compile

Invariants

  1. No frontend/ in this repo — AXIS is external.
  2. from __future__ import annotations required on new Python modules.
  3. Grammar edits only under resource/; regenerate via hatch, don’t hand-edit generated parser.
  4. Corpus fixture runs hundreds of cases — prefer focused unit tests for CI paths.
  5. CLI Docker runs as uid 1000; bind-mounts must be readable by others.

Failure modes

SymptomFix
No module named pynescriptactivate venv; pip install -e . or hoox-pyne
Pro API ImportError flaskpip install "hoox-pyne[pro]" or backend requirements
Nuitka missingpip install nuitka; make build-check first
Docker CLI can’t read filechmod host path; don’t use 0700-only dirs

See also