-
Notifications
You must be signed in to change notification settings - Fork 0
Test case for v2 client #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
blast-hardcheese
wants to merge
18
commits into
main
Choose a base branch
from
dstewart/python-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
72435fa
Avoid git add in generate_client.sh
blast-hardcheese 20f6bf0
add schema-v2
blast-hardcheese a2728d0
Copying python to pythonv2
blast-hardcheese 26b0503
generate-v2
blast-hardcheese e44013a
python-protocolv2
blast-hardcheese 75cfd36
Permit hard-coding for very simple local-dev testing
blast-hardcheese ed806dc
Avoid // aesthetic in test runner output
blast-hardcheese 2141bae
Adding start-node-protocolv2 runner
blast-hardcheese 62c94a1
Adding an implementation for repeat.echo_prefix
blast-hardcheese e676e01
Add python v2 client to GHA
blast-hardcheese 5a42825
Mmm. Buggy client implementation.
blast-hardcheese b63feb6
Avoid deviant defaults
blast-hardcheese 5971546
err -> info
blast-hardcheese 2d89b46
Latest and greatest
blast-hardcheese 5ce3d04
Supporting unsupported test combinations
blast-hardcheese b28c453
There are some tests that are v1.x only
blast-hardcheese 43e9525
Avoid sinking errors
blast-hardcheese ec32fec
Upgrade to river-python
blast-hardcheese File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM python:3.11-slim-bookworm | ||
|
||
WORKDIR /usr/src/river | ||
|
||
RUN apt-get update && apt-get install -fy git | ||
RUN pip install uv==0.6.8 | ||
|
||
COPY pyproject.toml . | ||
COPY uv.lock . | ||
COPY README.md . | ||
COPY src src | ||
|
||
RUN uv sync | ||
|
||
# bash is required for "time" in python:3.11-slim-bookworm | ||
CMD ["bash", "-c", "time timeout 120 uv run python -u -m testservice.client --log-cli-level=debug"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
REPO_ROOT_DIR="$(git rev-parse --show-toplevel)" | ||
|
||
cd "${REPO_ROOT_DIR}/impls/python-protocolv2" | ||
|
||
rm -rf \ | ||
src/river_python_test/protos/*pb2* \ | ||
src/river_python_test/protos/service_river.py \ | ||
|| true | ||
git clean -fdx src/river_python_test/protos/ || true | ||
|
||
mkdir -p src/river_python_test/protos | ||
|
||
uv run python -m grpc_tools.protoc \ | ||
--proto_path="${REPO_ROOT_DIR}/protos" \ | ||
--python_out=./src \ | ||
--mypy_out=./src \ | ||
--grpc_python_out=./src \ | ||
--mypy_grpc_out=./src \ | ||
"${REPO_ROOT_DIR}/protos/testservice/protos/service.proto" | ||
|
||
uv run python -m replit_river.codegen \ | ||
server \ | ||
--module testservice.protos \ | ||
--output ./src/testservice/protos \ | ||
"${REPO_ROOT_DIR}/protos/testservice/protos/service.proto" | ||
|
||
uv run python -m replit_river.codegen \ | ||
client \ | ||
--output ./src/testservice/protos \ | ||
--client-name TestCient \ | ||
--protocol-version v2.0 \ | ||
"${REPO_ROOT_DIR}/schema-v2.json" | ||
|
||
"${REPO_ROOT_DIR}/scripts/patch-grpc.sh" "$(pwd)" | ||
|
||
if ! uv run ruff check --fix; then | ||
uv run ruff check --add-noqa | ||
fi | ||
|
||
uv run ruff format | ||
uv run pyright . | ||
|
||
echo "Completed" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[project] | ||
name = "river-python-test" | ||
version = "1.0.0" | ||
description = "River toolkit for Python" | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
dependencies = [ | ||
"replit-river==0.17.0", | ||
] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/testservice"] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"deptry>=0.23.0", | ||
"mypy>=1.15.0", | ||
"mypy-protobuf>=3.6.0", | ||
"pyright>=1.1.396", | ||
"pytest>=8.3.5", | ||
"pytest-asyncio>=0.25.3", | ||
"pytest-cov>=4.1.0", | ||
"pytest-mock>=3.14.0", | ||
"ruff>=0.11.0", | ||
"types-protobuf>=5.29.1.20250315", | ||
] | ||
|
||
[tool.ruff] | ||
lint.select = ["F", "E", "W", "I001"] | ||
|
||
# Should be kept in sync with mypy.ini in the project root. | ||
# The VSCode mypy extension can only read /mypy.ini. | ||
# While mypy run inside the chat container can only see this file. | ||
[tool.mypy] | ||
plugins = "pydantic.mypy" | ||
disallow_untyped_defs = true | ||
warn_return_any = true | ||
|
||
[tool.pytest.ini_options] | ||
asyncio_mode = "auto" # auto-detect async tests/fixtures | ||
addopts = "--tb=short" | ||
env = [ | ||
"DD_DOGSTATSD_DISABLE=true", | ||
"DD_TRACE_ENABLED=false", | ||
] | ||
filterwarnings = [ | ||
"ignore::DeprecationWarning", # google SDKs cause this noise | ||
] | ||
markers = [ | ||
"e2e: marks tests as end-to-end (deselect with '-m \"not e2e\"')", | ||
] | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
"google.auth.*", | ||
"google.oauth2.*", | ||
"google.cloud.sqlalchemy_spanner.sqlalchemy_spanner.*", | ||
"grpc.*", | ||
"grpc_tools.*", | ||
"nanoid.*", | ||
] | ||
ignore_missing_imports = true |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a version mismatch between the
pyproject.toml
file which requires Python ≥3.12 and theclient.dockerfile
which uses Python 3.11. This could lead to runtime issues or dependency conflicts. Consider either:Updating the dockerfile to use Python 3.12+:
FROM python:3.12-slim-bookworm
Or adjusting the
pyproject.toml
requirements to match the Docker environment:Ensuring version consistency will help prevent potential deployment problems.
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.