Feat: add python sdk for Agones game server#4496
Feat: add python sdk for Agones game server#4496hiromesh wants to merge 6 commits intoagones-dev:mainfrom
Conversation
- Introduced core SDK functionality for managing GameServer lifecycle, including methods for connecting, marking readiness, and handling player connections. - Implemented Alpha and Beta features for player tracking and counters/lists management. - Added gRPC code generation script and necessary configuration files. - Included README documentation for installation and usage instructions. - Created .gitignore to exclude unnecessary files from version control. Signed-off-by: hiromesh <417969567@qq.com>
- Added Python Client SDK documentation with installation and usage instructions. - Updated README to include a link to the new Python Client SDK. - Enhanced the main SDK documentation index to reference the Python SDK. Signed-off-by: hiromesh <417969567@qq.com>
- Introduced Dockerfile for building Python SDK images, including installation of Python and necessary packages. - Added code generation script (gen.sh) for setting up a Python virtual environment and installing grpcio-tools. - Included test script (test.sh) for running pytest with required dependencies. - Updated Makefile to support Python SDK commands for generation and conformance testing. Signed-off-by: hiromesh <417969567@qq.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
markmandel
left a comment
There was a problem hiding this comment.
This is a huge PR 😄 so tough to review - but let's see if it passes CI at least!
| @@ -0,0 +1,23 @@ | |||
| # Copyright 2026 Google LLC All Rights Reserved. | |||
There was a problem hiding this comment.
This will need to have the new CNCF header, but we don't quite know what that is yet 😄 bear with us.
|
/gcbrun |
|
Build Failed 😭 Build Id: 4cc02a9e-8564-4474-9261-5fdda1e658b3 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
- Replaced sed commands with a Python script to modify import statements for relative imports in generated gRPC files. - Removed obsolete license classifier from pyproject.toml. Signed-off-by: hiromesh <417969567@qq.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
/gcbrun |
found the issue: generate.sh was using sed -i '' (macos-only syntax) which fails on linux. |
|
/gcbrun |
|
Build Failed 😭 Build Id: c8baa8f7-c622-4b89-9105-9eee017856f7 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
- Introduced a new test script (sdktest.sh) for setting up a Python virtual environment and running the Agones SDK client. - Added a comprehensive Python client implementation (testSDKClient.py) for managing player connections, counters, and lists within the Agones game server. Signed-off-by: hiromesh <417969567@qq.com>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
thanks for triggering the build — really helpful! found the issue: the missing sdktest.sh + conformance test client which the sdk conformance step requires. fix is pushed : ) |
What type of PR is this?
/kind feature
What this PR does / Why we need it:
Adds a Python SDK for the Agones game server platform, providing a gRPC client for communicating with the Agones sidecar.
The SDK follows the same architecture and API patterns as the existing Go, Rust, and Node.js SDKs:
Commits:
feat: add initial Python SDK for Agones game serveragones/sdk.py,agones/alpha.py,agones/beta.py— SDK implementationagones/_generated/— generated gRPC/protobuf codegenerate.sh— proto code generation script (strips HTTP/swagger annotations)pyproject.toml— package configurationtests/test_sdk.py,tests/test_alpha.py,tests/test_beta.py— 37 unit testsdocs: add Python Client SDK documentation and update READMEsite/content/en/docs/Guides/Client SDKs/python.md— full SDK documentation pagesite/content/en/docs/Guides/Client SDKs/_index.md— added Python to SDK indexsdks/README.md— added Python entrysdks/python/README.md— simplified to point to site docsfeat: add Python SDK Dockerfile and scriptsbuild/build-sdk-images/python/Dockerfile— Docker build imagebuild/build-sdk-images/python/gen.sh— code generation entrypointbuild/build-sdk-images/python/test.sh— test runner entrypointbuild/includes/sdk.mk— added Python targets and conformance testbuild/scripts/sdk-update-version/main.go— addedpyproject.tomlto version update listTesting:
All tests use
unittest.mock.MagicMockto mock gRPC stubs (same approach as Go'ssdkMockand Node.js'sspyOn).Which issue(s) this PR fixes:
None — new feature.
Special notes for your reviewer:
agones/_generated/) is checked in, same approach as the Node.js SDKgenerate.shstrips HTTP/swagger annotations from proto files before compilation to avoid unnecessary runtime dependencies