Skip to content

[UPSTREAM-16] feat(python): add @nexus.client-only - #74

Closed
moetemp wants to merge 1 commit into
moe/up/python-client-resourcesfrom
moe/up/python-client-only
Closed

moetemp wants to merge 1 commit into
moe/up/python-client-resourcesfrom
moe/up/python-client-only

Conversation

@moetemp

@moetemp moetemp commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds the @nexus.client-only interface directive. With --client, the Python target generates only the models and client.py of such a service, and no Workflow code.

  • Without --client, it generates only the models.
  • The parser refuses arguments, and refuses the directive together with @nexus.endpoint.
  • The other targets ignore it.

Depends on #57 (UPSTREAM-10).
Part of the Brook review series.

Why?

Some services are called only from outside a Workflow, so their Workflow code is dead code that a user can still import by mistake. It's a property of the interface, so it's a directive and not a CLI flag. Brook's stream-writer is such a service. Only Activities and clients call it, in process through the bridge. No Workflow or server does.

How did you test it?

tests/generate_python.rs checks the files that a client-only service generates, and compiler rejection fixtures cover the refused forms.
cargo validate passes and cargo clippy adds no warnings. Fork CI passes.

Some services are called only from outside a Workflow, for example a call
surface that a Worker serves in process. With the directive, Python generates
their models and caller module and no Workflow surface.
@moetemp
moetemp force-pushed the moe/up/python-client-only branch from 5978db2 to da80617 Compare October 26, 2026 20:56
@moetemp
moetemp force-pushed the moe/up/python-client-resources branch from 04274db to 571d3a9 Compare October 26, 2026 20:56
@moetemp

moetemp commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Closing, since --targets client in the reworked #54 replaces this directive. Brook's writer is its own WIT file, so it's generated with the client target only.

@moetemp moetemp closed this Oct 26, 2026
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