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
Rendering…
Interface surface
Make targets (primary)
| Target | Effect |
|---|---|
make install | pip install -e ".[lsp,pro]" |
make test | full pytest tests/ |
make test-cli | tests/test_cli.py |
make test-lsp | langserver + lsp_features |
make test-backend | tests/test_backend.py |
make lint / make fmt | Ruff on src/, tests/, backend/ |
make package | sdist + wheel (python -m build) |
make build | Nuitka LSP binary |
make build-cli | Nuitka CLI binary |
make build-check | import check for lsp+cli (~30s) |
make build-vscode | compile + package VSIX |
make run | Flask Pro API (:5002 typical) |
make run-lsp | python -m pynescript.langserver |
make docker-build | bake api |
make docker-build-cli | bake cli |
make docker-build-lsp | bake lsp (pynescript-lsp:latest; GHCR name ghcr.io/hoox-sh/pyne/lsp) |
make docker-build-all | api + api-dev + lsp + cli |
make docker-buildx | multi-platform release bake (api + cli + lsp) |
make docker-push-ghcr | gh workflow run ghcr.yml |
make docker-cli ARGS="…" | compose profile cli (ephemeral) |
make deploy-vps | rsync + restart API; health API :5002, AXIS :80 (VPS; local AXIS is :8081) |
make docker-up | compose API on :5002 |
make docker-up-full | + redis profile |
make docker-prod | gunicorn overlay (ADMIN_TOKEN required) |
make docker-smoke | curl health on :5002 |
make docker-down / docker-logs | stop / 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
| Path | Why it matters |
|---|---|
src/pynescript/ | Editable package root |
tests/conftest.py | Optional --example-scripts-dir only; no third-party corpus shipped |
backend/requirements.txt | Pro API deps (also covered by [pro] extra) |
| hoox-sh/pynets | Standalone TS library (@hoox-sh/pynets); not an in-tree submodule |
vscode-extension/ | PYNE VS Code extension |
Dockerfile | targets 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
| Extra | Adds |
|---|---|
lsp | pygls / lsprotocol → pyne-lsp (alias pynescript-lsp) |
compile | numpy / numba |
data / datafeed | ccxt |
pro | Flask + gunicorn + matplotlib + redis + compile |
Invariants
- No
frontend/in this repo — AXIS is external. from __future__ import annotationsrequired on new Python modules.- Grammar edits only under
resource/; regenerate via hatch, don’t hand-edit generated parser. - Corpus fixture runs hundreds of cases — prefer focused unit tests for CI paths.
- CLI Docker runs as uid 1000; bind-mounts must be readable by others.
Failure modes
| Symptom | Fix |
|---|---|
No module named pynescript | activate venv; pip install -e . or hoox-pyne |
| Pro API ImportError flask | pip install "hoox-pyne[pro]" or backend requirements |
| Nuitka missing | pip install nuitka; make build-check first |
| Docker CLI can’t read file | chmod host path; don’t use 0700-only dirs |