Skip to content

TypedPython: emit-c CLI and manifest for pypackpack's compile slot (#25 step 1) - #372

Merged
b-re-w merged 1 commit into
developfrom
feat/tp-emit-c
Nov 5, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/tp-emit-c

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 5, 2026

Copy link
Copy Markdown
Member

Part of #25 (step 1 of 3, approved by the lead; step 2, the Gradle task, goes to the Gradle-plugin owner).

What

  • python -m typedpython emit-c PATHS... --root DIR [--cache DIR] --manifest FILE runs pipeline.generate_project (TypedPython: cache the generated C, not the built extension, once the pypackpack compile slot builds it #113) and writes a JSON manifest.
  • nativeModules[i] maps to pypackpack ExtensionModuleSource(moduleName, sources, includeDirs, defines); notNativeModules[i] to NotNativeModule(module, kind NOT_MARKED|NOTHING_COMPILED, items). Package __init__ is in neither list. Absolute paths. Exit 0 / 1 (gate error, no manifest) / 2.
  • Format (version 1) fixed in docs/design/typedpython.md 4.3.2a; SPEC N-10 updated.

pypackpack state (read only, develop c81ed5f): ExtensionCompiler.kt holds the data types and ExtensionCompilerInterface only; no implementation and no nativeModules field in use yet.

Tests

  • New test_emit_c.py: red before (5 failed), green after (5 passed). The C compiler is monkeypatched to fail.
  • test_generate_project, test_module_report, test_cli: 25 passed.

… step 1)

python -m typedpython emit-c runs generate_project and writes a JSON manifest whose
nativeModules / notNativeModules entries map one to one onto pypackpack's
ExtensionModuleSource and NotNativeModule. The format (version 1) is fixed in
docs/design/typedpython.md 4.3.2a for the Gradle task (#25 step 2).
@b-re-w
b-re-w merged commit 9975a41 into develop Nov 5, 2026
5 checks passed
@b-re-w
b-re-w deleted the feat/tp-emit-c branch November 5, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant