Add connect() client mode and Japanese README#2
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy
One package now exposes both entry points over the same PLCClient: launch() spawns the bundled server (private or exposed via server_mode), and connect() talks to a gomc-rest server already running elsewhere without starting the binary. Re-uses gomc-rest-client; no protocol/client reimplementation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy
… tests P1: publish a binary-free sdist alongside the platform wheels so client-only users on platforms without a prebuilt wheel (macOS, Windows arm64, glibc < 2.34) can still 'pip install gomc-rest' and use connect(); launch() then raises a clear error. Document this in both READMEs. P2: use an absolute URL for the README_JP link so it resolves in the PyPI long description (relative repo links break there). Tests: add tests/test_connect.py pinning that connect() returns a PLCClient, forwards base_url and token, and never spawns a subprocess. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SQbVkPEprK2ebcjck5ouUy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One package now covers both "bundle and run the server" and "just be a client", over the same
PLCClient:connect(base_url, token=None)— talk to a gomc-rest server already running elsewhere (another machine, a shared instance, or one started withserver_mode=True) without spawning the bundled binary. Returns aPLCClientand supports the context-manager protocol.launch()(bundle + auto-start, private by default or exposed viaserver_mode=True) is unchanged.This reuses
gomc-rest-client— no protocol or HTTP-client reimplementation, so there is no second source of truth to keep in sync.Changes
src/gomc_rest/__init__.py: addconnect(), export it, update module docstring.README.md/README_JP.md: document the client mode; add a Japanese README with an English/日本語 cross-link.Notes
launch().connect()is a thin wrapper overPLCClient(base_url, token=...).🤖 Generated with Claude Code
Generated by Claude Code