Skip to content

v6.4.3 — Standalone runner fix & strict marker check

Choose a tag to compare

@wallneradam wallneradam released this 03 May 07:28
· 506 commits to main since this release

What's new

Standalone runner is no longer broken at startup

Every PyneComp-compiled script that uses the canonical bottom-of-file pattern

if __name__ == "__main__":
    from pynecore.standalone import run
    run(__file__)

failed immediately with

TypeError: Path.resolve() missing 1 required positional argument: 'self'

at pynecore/standalone.py:21, regardless of Python version (3.12, 3.13, 3.14 all reproduced). The error fired before any user code ran, so the entire "compile online → download → run locally with python script.py data.csv" workflow was unusable on 6.4.2.

Why it broke — loose marker check

The import hook's marker check was a substring match: any module whose docstring contained the string @pyne anywhere got fully AST-transformed. standalone.py's own docstring mentioned the marker in prose ("Standalone runner for PyneComp-compiled @pyne scripts."), so the runner module was transformed too. Its Path(data_arg).resolve() call was wrapped in the function-isolation machinery, which ended up dispatching resolve unbound — producing the missing-self TypeError.

Strict marker rule

The check now requires the @pyne marker to be the first non-whitespace content of the module docstring, followed by whitespace or end-of-string:

  • The first statement of the file must be a module docstring ("""…""").
  • The docstring's first non-whitespace token must be @pyne.
  • @pyne must be followed by whitespace or end of the docstring (so @pynex does not match, and a docstring that mentions @pyne after a description line does not count — the marker has to come first).

Library modules may now safely mention @pyne in prose anywhere in their docstrings, comments, or strings.

Documentation

  • New section in docs/advanced/ast-transformations.md documenting the marker recognition rules.
  • docs/getting-started/first-script.md, docs/scripting.md, docs/faq.md, and docs/overview/differences.md updated with the strict placement rule (including the troubleshooting hint for "my script isn't being recognized").
  • Throughout the docs, the term "Pyne script" has been renamed to "Pyne code". PyneSys-runnable Python is canonically called Pyne code — phonetically distinct from Pine Script (TradingView's language) — to avoid the near-homophone collision in conversation, demos, and recordings. The magic marker token itself is unchanged.