Repository navigation
refactor: unify CLI, kill Settings hack, dedup queue init - #28
Merged
Merged
Conversation
janbjorge
commented
Apr 19, 2026
Owner
- Add pipegate/cli.py: single typer entry point with token/client/server subcommands. Replaces three separate python -m invocations.
- auth.py: replace make_jwt_bearer() + Settings(_cli_parse_args=True) hack with pure generate_token(connection_id, settings) -> tuple[str, str].
- client.py: strip typer app wiring; keep handle_request/main as pure async.
- server.py: extract _get_or_create_queue() to remove duplicated init logic in handle_http_request and handle_websocket; drop main block.
- pyproject.toml: add [project.scripts] pipegate = "pipegate.cli:app".
- Tests: add TestGenerateToken (5 cases) and test_cli.py (7 cases); remove all Settings(_cli_parse_args=False) noise from fixtures.
- README: update all python -m pipegate.* to pipegate token/client/server.
- Add pipegate/cli.py: single typer entry point with token/client/server subcommands. Replaces three separate python -m invocations. - auth.py: replace make_jwt_bearer() + Settings(_cli_parse_args=True) hack with pure generate_token(connection_id, settings) -> tuple[str, str]. - client.py: strip typer app wiring; keep handle_request/main as pure async. - server.py: extract _get_or_create_queue() to remove duplicated init logic in handle_http_request and handle_websocket; drop __main__ block. - pyproject.toml: add [project.scripts] pipegate = "pipegate.cli:app". - Tests: add TestGenerateToken (5 cases) and test_cli.py (7 cases); remove all Settings(_cli_parse_args=False) noise from fixtures. - README: update all python -m pipegate.* to pipegate token/client/server.
… setdefault - generate_token(settings, connection_id=None): explicit arg > env var > random UUID. Removes the Settings(_cli_parse_args=True) hack while keeping the UX. - token_cmd: add --connection-id / -c Typer option. - server.py: revert setdefault back to explicit check — setdefault eagerly constructs asyncio.Queue on every request even when key exists (hot path). - README: document both --connection-id flag and PIPEGATE_CONNECTION_ID env var. - Tests: cover flag, env var, and flag-over-env precedence.
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.