Skip to content

feat: add MODULE_NAME keyword to cython_transpile#92

Merged
henryiii merged 1 commit into
mainfrom
feat/module-name
Jul 10, 2026
Merged

feat: add MODULE_NAME keyword to cython_transpile#92
henryiii merged 1 commit into
mainfrom
feat/module-name

Conversation

@henryiii

@henryiii henryiii commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Adds a MODULE_NAME keyword to cython_transpile() that forwards --module-name to the Cython CLI. Without it, Cython derives the module's dotted name from the filename and can only qualify it with the containing package if it can walk __init__ files from the source location — not always possible (e.g. a .pyx generated outside the package tree), which affects __module__, pickling, and error messages.

The multiple_packages test fixture's package3 case (previously passing --module-name via CYTHON_ARGS) now uses MODULE_NAME directly, and the test asserts the generated .c contains the fully-qualified name.

Addresses item 2 of the first comment on #84.

@henryiii
henryiii marked this pull request as ready for review July 9, 2026 21:43
Without it, Cython derives the module's dotted name from the filename
and can only qualify it with the containing package if it can walk
__init__ files from the source location, which isn't always possible
(e.g. generated .pyx files outside the package tree). This affects
__module__, pickling, and error messages. A first-class MODULE_NAME
keyword forwards --module-name to the cython CLI.

Assisted-by: ClaudeCode:claude-sonnet-5
@henryiii
henryiii merged commit 96b1737 into main Jul 10, 2026
28 checks passed
@henryiii
henryiii deleted the feat/module-name branch July 10, 2026 19:24
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