getstream 3.0.1__tar.gz → 3.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. getstream-3.0.2/.github/workflows/run_tests.yml +92 -0
  2. getstream-3.0.2/DEVELOPMENT.md +92 -0
  3. getstream-3.0.2/Makefile +124 -0
  4. {getstream-3.0.1 → getstream-3.0.2}/PKG-INFO +1 -1
  5. {getstream-3.0.1 → getstream-3.0.2}/dev.py +5 -0
  6. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/audio_track.py +2 -2
  7. getstream-3.0.1/.github/workflows/run_tests.yml +0 -108
  8. getstream-3.0.1/DEVELOPMENT.md +0 -80
  9. {getstream-3.0.1 → getstream-3.0.2}/.cursor/worktrees.json +0 -0
  10. {getstream-3.0.1 → getstream-3.0.2}/.env.example +0 -0
  11. {getstream-3.0.1 → getstream-3.0.2}/.github/actions/python-uv-setup/action.yml +0 -0
  12. {getstream-3.0.1 → getstream-3.0.2}/.github/workflows/ci.yml +0 -0
  13. {getstream-3.0.1 → getstream-3.0.2}/.github/workflows/release.yml +0 -0
  14. {getstream-3.0.1 → getstream-3.0.2}/.github/workflows/stream-py.code-workspace +0 -0
  15. {getstream-3.0.1 → getstream-3.0.2}/.gitignore +0 -0
  16. {getstream-3.0.1 → getstream-3.0.2}/.gitmodules +0 -0
  17. {getstream-3.0.1 → getstream-3.0.2}/.pre-commit-config.yaml +0 -0
  18. {getstream-3.0.1 → getstream-3.0.2}/AGENTS.md +0 -0
  19. {getstream-3.0.1 → getstream-3.0.2}/CHANGELOG.md +0 -0
  20. {getstream-3.0.1 → getstream-3.0.2}/LICENSE.md +0 -0
  21. {getstream-3.0.1 → getstream-3.0.2}/MIGRATION_v2_to_v3.md +0 -0
  22. {getstream-3.0.1 → getstream-3.0.2}/README.md +0 -0
  23. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/01-setup-and-auth.md +0 -0
  24. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/02-users.md +0 -0
  25. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/03-channels.md +0 -0
  26. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/04-messages-and-reactions.md +0 -0
  27. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/05-moderation.md +0 -0
  28. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/06-devices.md +0 -0
  29. {getstream-3.0.1 → getstream-3.0.2}/docs/migration-from-stream-chat-python/README.md +0 -0
  30. {getstream-3.0.1 → getstream-3.0.2}/generate.sh +0 -0
  31. {getstream-3.0.1 → getstream-3.0.2}/generate_webrtc.sh +0 -0
  32. {getstream-3.0.1 → getstream-3.0.2}/getstream/__init__.py +0 -0
  33. {getstream-3.0.1 → getstream-3.0.2}/getstream/base.py +0 -0
  34. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/__init__.py +0 -0
  35. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/async_channel.py +0 -0
  36. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/async_client.py +0 -0
  37. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/async_rest_client.py +0 -0
  38. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/channel.py +0 -0
  39. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/client.py +0 -0
  40. {getstream-3.0.1 → getstream-3.0.2}/getstream/chat/rest_client.py +0 -0
  41. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/__init__.py +0 -0
  42. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/async_client.py +0 -0
  43. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/async_rest_client.py +0 -0
  44. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/client.py +0 -0
  45. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/rest_client.py +0 -0
  46. {getstream-3.0.1 → getstream-3.0.2}/getstream/common/telemetry.py +0 -0
  47. {getstream-3.0.1 → getstream-3.0.2}/getstream/config.py +0 -0
  48. {getstream-3.0.1 → getstream-3.0.2}/getstream/feeds/__init__.py +0 -0
  49. {getstream-3.0.1 → getstream-3.0.2}/getstream/feeds/client.py +0 -0
  50. {getstream-3.0.1 → getstream-3.0.2}/getstream/feeds/feeds.py +0 -0
  51. {getstream-3.0.1 → getstream-3.0.2}/getstream/feeds/rest_client.py +0 -0
  52. {getstream-3.0.1 → getstream-3.0.2}/getstream/generic.py +0 -0
  53. {getstream-3.0.1 → getstream-3.0.2}/getstream/meta.py +0 -0
  54. {getstream-3.0.1 → getstream-3.0.2}/getstream/models/__init__.py +0 -0
  55. {getstream-3.0.1 → getstream-3.0.2}/getstream/moderation/__init__.py +0 -0
  56. {getstream-3.0.1 → getstream-3.0.2}/getstream/moderation/async_client.py +0 -0
  57. {getstream-3.0.1 → getstream-3.0.2}/getstream/moderation/async_rest_client.py +0 -0
  58. {getstream-3.0.1 → getstream-3.0.2}/getstream/moderation/client.py +0 -0
  59. {getstream-3.0.1 → getstream-3.0.2}/getstream/moderation/rest_client.py +0 -0
  60. {getstream-3.0.1 → getstream-3.0.2}/getstream/rate_limit.py +0 -0
  61. {getstream-3.0.1 → getstream-3.0.2}/getstream/stream.py +0 -0
  62. {getstream-3.0.1 → getstream-3.0.2}/getstream/stream_response.py +0 -0
  63. {getstream-3.0.1 → getstream-3.0.2}/getstream/tests/test_webhook.py +0 -0
  64. {getstream-3.0.1 → getstream-3.0.2}/getstream/utils/__init__.py +0 -0
  65. {getstream-3.0.1 → getstream-3.0.2}/getstream/utils/event_emitter.py +0 -0
  66. {getstream-3.0.1 → getstream-3.0.2}/getstream/utils/retry.py +0 -0
  67. {getstream-3.0.1 → getstream-3.0.2}/getstream/version.py +0 -0
  68. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/__init__.py +0 -0
  69. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/async_call.py +0 -0
  70. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/async_client.py +0 -0
  71. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/async_rest_client.py +0 -0
  72. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/call.py +0 -0
  73. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/client.py +0 -0
  74. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/openai.py +0 -0
  75. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rest_client.py +0 -0
  76. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/README.md +0 -0
  77. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/__init__.py +0 -0
  78. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/connection_manager.py +0 -0
  79. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/connection_utils.py +0 -0
  80. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/coordinator/__init__.py +0 -0
  81. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/coordinator/backoff.py +0 -0
  82. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/coordinator/errors.py +0 -0
  83. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/coordinator/ws.py +0 -0
  84. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/coordinator_api.py +0 -0
  85. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/encoders_patches.py +0 -0
  86. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/g711.py +0 -0
  87. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/location_discovery.py +0 -0
  88. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/models.py +0 -0
  89. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/network_monitor.py +0 -0
  90. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/participants.py +0 -0
  91. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/__init__.py +0 -0
  92. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/__init__.py +0 -0
  93. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/__init__.py +0 -0
  94. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/__init__.py +0 -0
  95. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/event/__init__.py +0 -0
  96. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/event/events_pb2.py +0 -0
  97. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/event/events_pb2.pyi +0 -0
  98. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/models/__init__.py +0 -0
  99. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/models/models_pb2.py +0 -0
  100. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/models/models_pb2.pyi +0 -0
  101. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/signal_rpc/__init__.py +0 -0
  102. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/signal_rpc/signal_pb2.py +0 -0
  103. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/signal_rpc/signal_pb2.pyi +0 -0
  104. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pb/stream/video/sfu/signal_rpc/signal_twirp.py +0 -0
  105. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/pc.py +0 -0
  106. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/peer_connection.py +0 -0
  107. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/reconnection.py +0 -0
  108. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/recording.py +0 -0
  109. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/signaling.py +0 -0
  110. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/stats_reporter.py +0 -0
  111. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/stats_tracer.py +0 -0
  112. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/tracer.py +0 -0
  113. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/track_util.py +0 -0
  114. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/tracks.py +0 -0
  115. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/twirp_client_wrapper.py +0 -0
  116. {getstream-3.0.1 → getstream-3.0.2}/getstream/video/rtc/utils.py +0 -0
  117. {getstream-3.0.1 → getstream-3.0.2}/getstream/webhook.py +0 -0
  118. {getstream-3.0.1 → getstream-3.0.2}/pyproject.toml +0 -0
  119. {getstream-3.0.1 → getstream-3.0.2}/pytest.ini +0 -0
  120. {getstream-3.0.1 → getstream-3.0.2}/uv.lock +0 -0
@@ -0,0 +1,92 @@
1
+ name: _run-tests
2
+ on:
3
+ workflow_call:
4
+ inputs:
5
+ marker:
6
+ description: 'pytest -m expression (e.g., `not integration` or `integration`)'
7
+ required: true
8
+ type: string
9
+ secrets: { }
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ env:
15
+ # If set, uv will run without updating the uv.lock file. Equivalent to the `uv run --frozen`.
16
+ UV_FROZEN: "1"
17
+
18
+ jobs:
19
+ ruff:
20
+ name: Ruff
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout
24
+ uses: actions/checkout@v5
25
+ - name: Install dependencies
26
+ uses: ./.github/actions/python-uv-setup
27
+ - name: Run linter
28
+ run: make lint
29
+
30
+ typecheck:
31
+ name: Type Check (ty)
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - name: Checkout
35
+ uses: actions/checkout@v5
36
+ - name: Install dependencies
37
+ uses: ./.github/actions/python-uv-setup
38
+ - name: Run type checker
39
+ run: make typecheck
40
+
41
+ # ── Non-video tests (chat, feeds, etc.) ────────────────────────────
42
+ # Uses STREAM_CHAT_* credentials which do NOT have video enabled.
43
+ # Video paths and manual test paths are defined in the Makefile.
44
+ test-non-video:
45
+ name: Non-video tests (${{ matrix.python-version }})
46
+ environment:
47
+ name: ci
48
+ runs-on: ubuntu-latest
49
+ strategy:
50
+ fail-fast: false
51
+ matrix:
52
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
53
+ timeout-minutes: 30
54
+ steps:
55
+ - name: Checkout
56
+ uses: actions/checkout@v5
57
+ - name: Install dependencies
58
+ uses: ./.github/actions/python-uv-setup
59
+ with:
60
+ python-version: ${{ matrix.python-version }}
61
+ - name: Run tests
62
+ env:
63
+ STREAM_API_KEY: ${{ vars.STREAM_CHAT_API_KEY }}
64
+ STREAM_API_SECRET: ${{ secrets.STREAM_CHAT_API_SECRET }}
65
+ STREAM_BASE_URL: ${{ vars.STREAM_CHAT_BASE_URL }}
66
+ run: make test MARKER="${{ inputs.marker }}"
67
+
68
+ # ── Video tests (video-enabled credentials) ─────────────────────
69
+ # Uses STREAM_* credentials which have video enabled.
70
+ test-video:
71
+ name: Video tests (${{ matrix.python-version }})
72
+ environment:
73
+ name: ci
74
+ runs-on: ubuntu-latest
75
+ strategy:
76
+ fail-fast: false
77
+ matrix:
78
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
79
+ timeout-minutes: 30
80
+ steps:
81
+ - name: Checkout
82
+ uses: actions/checkout@v5
83
+ - name: Install dependencies
84
+ uses: ./.github/actions/python-uv-setup
85
+ with:
86
+ python-version: ${{ matrix.python-version }}
87
+ - name: Run tests
88
+ env:
89
+ STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
90
+ STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
91
+ STREAM_BASE_URL: ${{ vars.STREAM_BASE_URL }}
92
+ run: make test-video MARKER="${{ inputs.marker }}"
@@ -0,0 +1,92 @@
1
+ # Getstream Python SDK
2
+
3
+ ### Setup
4
+
5
+ Clone the repo and install dependencies:
6
+
7
+ ```
8
+ git clone git@github.com:GetStream/stream-py.git
9
+ uv sync --no-sources --all-packages --all-extras --dev
10
+ cp .env.example .env # fill in your Stream credentials
11
+ pre-commit install # optional: enable commit hooks
12
+ ```
13
+
14
+ ### Running tests
15
+
16
+ Run `make help` to see all available targets. The most common ones:
17
+
18
+ ```
19
+ make test # non-video tests (chat, feeds, moderation, etc.)
20
+ make test-video # video/WebRTC tests only
21
+ make test-all # both of the above
22
+ ```
23
+
24
+ Non-video and video tests are split because they require different Stream credentials.
25
+ The `MARKER` variable defaults to `"not integration"`. Override it for integration tests:
26
+
27
+ ```
28
+ make test-integration # runs both groups with -m "integration"
29
+ make test MARKER="integration" # or target a single group
30
+ ```
31
+
32
+ Two manual tests exist for local telemetry inspection (excluded from CI):
33
+
34
+ ```
35
+ make test-jaeger # requires local Jaeger (docker run ... jaegertracing/all-in-one)
36
+ make test-prometheus # requires getstream[telemetry] deps
37
+ ```
38
+
39
+ ### Linting and type checking
40
+
41
+ ```
42
+ make lint # ruff check + format check
43
+ make typecheck # ty type checker (excludes generated code)
44
+ ```
45
+
46
+ To auto-fix lint issues and format:
47
+
48
+ ```
49
+ make format
50
+ ```
51
+
52
+ Run lint, typecheck, and non-video tests in one go:
53
+
54
+ ```
55
+ make check
56
+ ```
57
+
58
+ ### Code generation
59
+
60
+ ```
61
+ make regen # regenerate OpenAPI + WebRTC protobuf code
62
+ ```
63
+
64
+ ### Legacy: dev.py
65
+
66
+ `dev.py` is an older CLI tool that predates the Makefile. It still works but does not
67
+ handle the video/non-video test split or manual test exclusions. Prefer `make` targets.
68
+
69
+ ## Release
70
+
71
+ Create a new release on Github, CI handles the rest. If you do need to do it manually follow these instructions:
72
+
73
+ ```
74
+ rm -rf dist
75
+ git tag v0.0.15
76
+ uv run hatch version # this should show the right version
77
+ git push origin main --tags
78
+ uv build --all
79
+ uv publish
80
+ ```
81
+
82
+ ## OpenAPI & Protobuf
83
+
84
+ Most API endpoints use openAPI definitions.
85
+ Part of the video endpoints use Protobuf.
86
+ Use these commands to regenerate:
87
+
88
+ ```
89
+ ./generate.sh
90
+ ./generate_webrtc.sh
91
+ ```
92
+
@@ -0,0 +1,124 @@
1
+ .DEFAULT_GOAL := help
2
+
3
+ # ── Pytest marker expression ───────────────────────────────────────
4
+ # Override on the command line: make test MARKER="integration"
5
+ # Default excludes integration tests for everyday local development.
6
+ MARKER ?= not integration
7
+
8
+ # ── Video-related test paths (single source of truth) ──────────────
9
+ # When you add a new video test file, add it here. Both test (via
10
+ # --ignore) and test-video (via positional args) stay in sync.
11
+ VIDEO_PATHS := \
12
+ getstream/video \
13
+ tests/rtc \
14
+ tests/test_audio_stream_track.py \
15
+ tests/test_connection_manager.py \
16
+ tests/test_connection_utils.py \
17
+ tests/test_signaling.py \
18
+ tests/test_video_examples.py \
19
+ tests/test_video_integration.py \
20
+ tests/test_video_openai.py \
21
+ tests/test_webrtc_generation.py
22
+
23
+ # ── Manual tests (require local infrastructure, never run in CI) ───
24
+ MANUAL_PATHS := \
25
+ tests/test_tracing_jaeger_manual.py \
26
+ tests/test_metrics_prometheus_manual.py
27
+
28
+ # ── Derived ignore flags ──────────────────────────────────────────
29
+ VIDEO_IGNORE := $(addprefix --ignore=,$(VIDEO_PATHS))
30
+ MANUAL_IGNORE := $(addprefix --ignore=,$(MANUAL_PATHS))
31
+
32
+ # ── Typecheck exclusions ──────────────────────────────────────────
33
+ TY_EXCLUDES := \
34
+ --exclude "getstream/models/" \
35
+ --exclude "getstream/video/rtc/pb/" \
36
+ --exclude "**/rest_client.py" \
37
+ --exclude "**/async_rest_client.py" \
38
+ --exclude "getstream/chat/channel.py" \
39
+ --exclude "getstream/chat/async_channel.py" \
40
+ --exclude "getstream/chat/client.py" \
41
+ --exclude "getstream/chat/async_client.py" \
42
+ --exclude "getstream/common/client.py" \
43
+ --exclude "getstream/common/async_client.py" \
44
+ --exclude "getstream/moderation/client.py" \
45
+ --exclude "getstream/moderation/async_client.py" \
46
+ --exclude "getstream/video/client.py" \
47
+ --exclude "getstream/video/async_client.py" \
48
+ --exclude "getstream/video/call.py" \
49
+ --exclude "getstream/video/async_call.py" \
50
+ --exclude "getstream/feeds/client.py" \
51
+ --exclude "getstream/feeds/feeds.py" \
52
+ --exclude "getstream/stream.py"
53
+
54
+ # ── Targets ───────────────────────────────────────────────────────
55
+
56
+ .PHONY: test test-video test-all test-integration test-jaeger test-prometheus lint format typecheck check regen help
57
+
58
+ ## Run non-video tests (chat, feeds, moderation, etc.)
59
+ test:
60
+ uv run pytest -m "$(MARKER)" tests/ getstream/ $(VIDEO_IGNORE) $(MANUAL_IGNORE)
61
+
62
+ ## Run video/WebRTC tests only
63
+ test-video:
64
+ uv run pytest -m "$(MARKER)" $(VIDEO_PATHS)
65
+
66
+ ## Run all tests (non-video + video), excluding manual tests
67
+ test-all:
68
+ uv run pytest -m "$(MARKER)" tests/ getstream/ $(MANUAL_IGNORE)
69
+
70
+ ## Run integration tests for both groups
71
+ test-integration:
72
+ $(MAKE) test MARKER="integration"
73
+ $(MAKE) test-video MARKER="integration"
74
+
75
+ ## Run the Jaeger tracing manual test (requires local Jaeger on :4317)
76
+ test-jaeger:
77
+ uv run pytest -m "integration" tests/test_tracing_jaeger_manual.py
78
+
79
+ ## Run the Prometheus metrics manual test (requires telemetry deps)
80
+ test-prometheus:
81
+ uv run pytest -m "integration" tests/test_metrics_prometheus_manual.py
82
+
83
+ ## Run Ruff linter and formatter check
84
+ lint:
85
+ uv run ruff check .
86
+ uv run ruff format --check .
87
+
88
+ ## Auto-fix lint issues and format
89
+ format:
90
+ uv run ruff check --fix .
91
+ uv run ruff format .
92
+
93
+ ## Run ty type checker
94
+ typecheck:
95
+ uvx ty@0.0.24 check getstream/ $(TY_EXCLUDES)
96
+
97
+ ## Run full check: lint + typecheck + non-video tests
98
+ check: lint typecheck test
99
+
100
+ ## Regenerate all generated code (OpenAPI + WebRTC protobuf)
101
+ regen:
102
+ ./generate.sh
103
+ ./generate_webrtc.sh
104
+
105
+ ## Show available targets
106
+ help:
107
+ @echo "Usage: make <target> [MARKER=\"...\"]"
108
+ @echo ""
109
+ @echo "Test targets:"
110
+ @echo " test Non-video tests (default MARKER='not integration')"
111
+ @echo " test-video Video/WebRTC tests only"
112
+ @echo " test-all All tests except manual infrastructure tests"
113
+ @echo " test-integration Integration tests (both non-video and video)"
114
+ @echo " test-jaeger Jaeger tracing manual test (needs Docker Jaeger)"
115
+ @echo " test-prometheus Prometheus metrics manual test (needs telemetry deps)"
116
+ @echo ""
117
+ @echo "Quality targets:"
118
+ @echo " lint Ruff linter + format check"
119
+ @echo " format Auto-fix lint issues and format code"
120
+ @echo " typecheck ty type checker"
121
+ @echo " check Full check: lint + typecheck + non-video tests"
122
+ @echo ""
123
+ @echo "Code generation:"
124
+ @echo " regen Regenerate OpenAPI + WebRTC protobuf code"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: getstream
3
- Version: 3.0.1
3
+ Version: 3.0.2
4
4
  Summary: GetStream Python SDK - Build scalable activity feeds, chat, and video calling applications
5
5
  Author-email: sachaarbonel <sacha.arbonel@hotmail.fr>, tbarbugli <tbarbugli@gmail.com>
6
6
  License-File: LICENSE.md
@@ -2,6 +2,11 @@
2
2
  """
3
3
  Development CLI tool for getstream SDK.
4
4
  Essential dev commands for testing, linting, and type checking.
5
+
6
+ NOTE: Prefer using the Makefile instead (run `make help` for available targets).
7
+ The Makefile is a superset of this script.
8
+
9
+ This script is kept for backwards compatibility.
5
10
  """
6
11
 
7
12
  import os
@@ -130,7 +130,7 @@ class AudioStreamTrack(aiortc.mediastreams.MediaStreamTrack):
130
130
  )
131
131
 
132
132
  # Drop from the beginning of the buffer to keep latest data
133
- self._buffer = self._buffer[bytes_to_drop:]
133
+ del self._buffer[:bytes_to_drop]
134
134
 
135
135
  buffer_duration_ms = (
136
136
  len(self._buffer)
@@ -192,7 +192,7 @@ class AudioStreamTrack(aiortc.mediastreams.MediaStreamTrack):
192
192
  if len(self._buffer) >= self._bytes_per_frame:
193
193
  # We have enough data
194
194
  audio_bytes = bytes(self._buffer[: self._bytes_per_frame])
195
- self._buffer = self._buffer[self._bytes_per_frame :]
195
+ del self._buffer[: self._bytes_per_frame]
196
196
  elif len(self._buffer) > 0:
197
197
  # We have some data but not enough - pad with silence
198
198
  audio_bytes = bytes(self._buffer)
@@ -1,108 +0,0 @@
1
- name: _run-tests
2
- on:
3
- workflow_call:
4
- inputs:
5
- marker:
6
- description: 'pytest -m expression (e.g., `not integration` or `integration`)'
7
- required: true
8
- type: string
9
- secrets: { }
10
- concurrency:
11
- group: ${{ github.workflow }}-${{ github.ref }}
12
- cancel-in-progress: true
13
-
14
- env:
15
- # If set, uv will run without updating the uv.lock file. Equivalent to the `uv run --frozen`.
16
- UV_FROZEN: "1"
17
-
18
- jobs:
19
- ruff:
20
- name: Ruff
21
- runs-on: ubuntu-latest
22
- steps:
23
- - name: Checkout
24
- uses: actions/checkout@v5
25
- - name: Install dependencies
26
- uses: ./.github/actions/python-uv-setup
27
- - name: Run Ruff linter
28
- run: uv run ruff check .
29
- - name: Run Ruff formatter
30
- run: uv run ruff format --check .
31
-
32
- typecheck:
33
- name: Type Check (ty)
34
- runs-on: ubuntu-latest
35
- steps:
36
- - name: Checkout
37
- uses: actions/checkout@v5
38
- - name: Install dependencies
39
- uses: ./.github/actions/python-uv-setup
40
- - name: Run ty type checker
41
- run: |
42
- uvx ty check getstream/ \
43
- --exclude "getstream/models/" \
44
- --exclude "getstream/video/rtc/pb/" \
45
- --exclude "**/rest_client.py" \
46
- --exclude "**/async_rest_client.py" \
47
- --exclude "getstream/chat/channel.py" \
48
- --exclude "getstream/chat/async_channel.py" \
49
- --exclude "getstream/chat/client.py" \
50
- --exclude "getstream/chat/async_client.py" \
51
- --exclude "getstream/common/client.py" \
52
- --exclude "getstream/common/async_client.py" \
53
- --exclude "getstream/moderation/client.py" \
54
- --exclude "getstream/moderation/async_client.py" \
55
- --exclude "getstream/video/client.py" \
56
- --exclude "getstream/video/async_client.py" \
57
- --exclude "getstream/video/call.py" \
58
- --exclude "getstream/video/async_call.py" \
59
- --exclude "getstream/feeds/client.py" \
60
- --exclude "getstream/feeds/feeds.py" \
61
- --exclude "getstream/stream.py"
62
-
63
- test:
64
- name: Test "${{ inputs.marker }}"
65
- environment:
66
- name: ci
67
- runs-on: ubuntu-latest
68
- strategy:
69
- fail-fast: false
70
- matrix:
71
- python-version: ["3.10", "3.11", "3.12", "3.13"]
72
- timeout-minutes: 30
73
- steps:
74
- - name: Checkout
75
- uses: actions/checkout@v5
76
- - name: Install dependencies
77
- uses: ./.github/actions/python-uv-setup
78
- with:
79
- python-version: ${{ matrix.python-version }}
80
- - name: Run non-video tests
81
- env:
82
- STREAM_API_KEY: ${{ vars.STREAM_CHAT_API_KEY }}
83
- STREAM_API_SECRET: ${{ secrets.STREAM_CHAT_API_SECRET }}
84
- STREAM_BASE_URL: ${{ vars.STREAM_CHAT_BASE_URL }}
85
- run: |
86
- uv run pytest -m "${{ inputs.marker }}" tests/ getstream/ \
87
- --ignore=tests/rtc \
88
- --ignore=tests/test_video_examples.py \
89
- --ignore=tests/test_video_integration.py \
90
- --ignore=tests/test_video_openai.py \
91
- --ignore=tests/test_signaling.py \
92
- --ignore=tests/test_audio_stream_track.py \
93
- --ignore=getstream/video
94
- - name: Run video tests
95
- env:
96
- STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
97
- STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
98
- STREAM_BASE_URL: ${{ vars.STREAM_BASE_URL }}
99
- run: |
100
- uv run pytest -m "${{ inputs.marker }}" \
101
- tests/rtc \
102
- tests/test_video_examples.py \
103
- tests/test_video_integration.py \
104
- tests/test_video_openai.py \
105
- tests/test_signaling.py \
106
- tests/test_audio_stream_track.py \
107
- getstream/video
108
-
@@ -1,80 +0,0 @@
1
- # Getstream Python SDK
2
-
3
- ### Running tests
4
-
5
- Clone the repo and sync
6
-
7
- ```
8
- git clone git@github.com:GetStream/stream-py.git
9
- uv sync --no-sources --all-packages --all-extras --dev
10
- ```
11
-
12
- Env setup
13
-
14
- ```
15
- cp .env.example .env
16
- ```
17
-
18
- Run tests
19
-
20
- ```
21
- uv run pytest -m "not integration" tests/ getstream/
22
- ```
23
-
24
- ### Commit hook
25
-
26
- ```
27
- pre-commit install
28
- ```
29
-
30
- ### Check
31
-
32
- Shortcut to ruff, ty (type checker) and non integration tests:
33
-
34
- ```
35
- uv run python dev.py
36
- ```
37
-
38
- ### Formatting
39
-
40
- ```
41
- uv run ruff check --fix
42
- ```
43
-
44
- ### Type checking (ty)
45
-
46
- Type checking is run via the `ty` type checker, excluding generated code:
47
-
48
- ```
49
- uv run python dev.py ty
50
- ```
51
-
52
- Or manually (note: requires exclude flags for generated code - see dev.py for the full list):
53
- ```
54
- uvx ty check getstream/ --exclude "getstream/models/" --exclude "getstream/video/rtc/pb/" ...
55
- ```
56
-
57
- ## Release
58
-
59
- Create a new release on Github, CI handles the rest. If you do need to do it manually follow these instructions:
60
-
61
- ```
62
- rm -rf dist
63
- git tag v0.0.15
64
- uv run hatch version # this should show the right version
65
- git push origin main --tags
66
- uv build --all
67
- uv publish
68
- ```
69
-
70
- ## OpenAPI & Protobuf
71
-
72
- Most API endpoints use openAPI definitions.
73
- Part of the video endpoints use Protobuf.
74
- Use these commands to regenerate:
75
-
76
- ```
77
- ./generate.sh
78
- ./generate_webrtc.sh
79
- ```
80
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes