Skip to content

Commit 46e5f0e

Browse files
committed
Merge branch 'main' into feat/overrides
Conflicts in the capability lists of the contract test services keep both sides: flag-overrides from feat/overrides, and the retry conformance, service endpoints, wrapper, proxy and TLS capabilities from main. The async override test that captured evaluation details used AsyncHook, which #548 removed from main; it now uses Hook, which the async client accepts.
2 parents 1e8d471 + ad37b18 commit 46e5f0e

78 files changed

Lines changed: 3837 additions & 820 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/lint-pr-title.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ permissions:
1212

1313
jobs:
1414
lint-pr-title:
15-
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@main
15+
uses: launchdarkly/gh-actions/.github/workflows/lint-pr-title.yml@85d687fe3b05b4e8281c0be3938e5dd1dad50f18 # main

‎.github/workflows/manual-publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ jobs:
3939

4040
- name: Attest build provenance
4141
if: ${{ format('{0}', inputs.dry_run) == 'false' }}
42-
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
42+
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
4343
with:
4444
subject-path: 'dist/*'

‎.github/workflows/release-please.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ jobs:
4848

4949
- name: Attest build provenance
5050
if: ${{ steps.release.outputs.releases_created == 'true' }}
51-
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
51+
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
5252
with:
5353
subject-path: 'dist/*'

‎.github/workflows/stale.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ permissions:
1111

1212
jobs:
1313
sdk-close-stale:
14-
uses: launchdarkly/gh-actions/.github/workflows/sdk-stale.yml@main
14+
uses: launchdarkly/gh-actions/.github/workflows/sdk-stale.yml@85d687fe3b05b4e8281c0be3938e5dd1dad50f18 # main

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "9.17.0"
2+
".": "9.20.0"
33
}

‎CHANGELOG.md‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,87 @@
22

33
All notable changes to the LaunchDarkly Python SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [9.20.0](https://github.com/launchdarkly/python-server-sdk/compare/9.19.0...9.20.0) (2026-11-05)
6+
7+
8+
### Features
9+
10+
* Replace the expiringdict dependency with an internal cache ([#563](https://github.com/launchdarkly/python-server-sdk/issues/563)) ([ca34aad](https://github.com/launchdarkly/python-server-sdk/commit/ca34aad162af51c6ff343a7ead1d3f2710efbcf9))
11+
12+
13+
### Bug Fixes
14+
15+
* Ignore FDv2 objects with unrecognized kinds ([#541](https://github.com/launchdarkly/python-server-sdk/issues/541)) ([d5eeb80](https://github.com/launchdarkly/python-server-sdk/commit/d5eeb8064183705af6c93a727b13a0d26b0f6ce8))
16+
17+
## [9.19.0](https://github.com/launchdarkly/python-server-sdk/compare/9.18.4...9.19.0) (2026-11-02)
18+
19+
20+
### Breaking changes to the experimental async client
21+
22+
The async client is experimental, so these changes do not cause a major version bump. If you use `AsyncLDClient` with hooks or plugins, update your code:
23+
24+
* Remove the experimental `AsyncHook` class. The async client now uses the same synchronous `Hook` class as the sync client. Change each `AsyncHook` subclass to subclass `Hook`, and change its `async def` stages to `def`. The stages run on the event loop, so they must not block. ([#548](https://github.com/launchdarkly/python-server-sdk/issues/548)) ([2457311](https://github.com/launchdarkly/python-server-sdk/commit/2457311781966096c8553f054b03c7667b0b3996))
25+
* `AsyncPlugin.get_hooks` now returns a list of `Hook` instances. `AsyncPlugin.register` stays async. ([#548](https://github.com/launchdarkly/python-server-sdk/issues/548)) ([2457311](https://github.com/launchdarkly/python-server-sdk/commit/2457311781966096c8553f054b03c7667b0b3996))
26+
27+
28+
### Features
29+
30+
* Accept synchronous hooks on the async client ([#548](https://github.com/launchdarkly/python-server-sdk/issues/548)) ([2457311](https://github.com/launchdarkly/python-server-sdk/commit/2457311781966096c8553f054b03c7667b0b3996))
31+
32+
33+
### Bug Fixes
34+
35+
* Run after-evaluation hooks when an async evaluation is cancelled or raises ([2457311](https://github.com/launchdarkly/python-server-sdk/commit/2457311781966096c8553f054b03c7667b0b3996))
36+
37+
## [9.18.4](https://github.com/launchdarkly/python-server-sdk/compare/9.18.3...9.18.4) (2026-10-26)
38+
39+
40+
### Bug Fixes
41+
42+
* Use monotonic clocks for migration latency and FDv2 stream-init timing ([#539](https://github.com/launchdarkly/python-server-sdk/issues/539)) ([346e9be](https://github.com/launchdarkly/python-server-sdk/commit/346e9be7e63980878bc6f0cd384f521ea25bfafc))
43+
44+
## [9.18.3](https://github.com/launchdarkly/python-server-sdk/compare/9.18.2...9.18.3) (2026-10-20)
45+
46+
47+
### Bug Fixes
48+
49+
* Require certifi 2026.10.19 or newer ([#544](https://github.com/launchdarkly/python-server-sdk/issues/544)) ([518819d](https://github.com/launchdarkly/python-server-sdk/commit/518819dfe176357ef9441bbdf0bebe876f6b11ee))
50+
51+
## [9.18.2](https://github.com/launchdarkly/python-server-sdk/compare/9.18.1...9.18.2) (2026-10-12)
52+
53+
54+
### Bug Fixes
55+
56+
* Use monotonic clocks for stream-init durations and FDv2 state windows ([#537](https://github.com/launchdarkly/python-server-sdk/issues/537)) ([e8501c5](https://github.com/launchdarkly/python-server-sdk/commit/e8501c58e5ac8a28b591b6687073ac04aa86bfd7))
57+
58+
## [9.18.1](https://github.com/launchdarkly/python-server-sdk/compare/9.18.0...9.18.1) (2026-10-06)
59+
60+
61+
### Bug Fixes
62+
63+
* Reuse an in-flight big segment status poll instead of always querying twice ([#535](https://github.com/launchdarkly/python-server-sdk/issues/535)) ([66013b5](https://github.com/launchdarkly/python-server-sdk/commit/66013b520f448cf6cda3d6377cde93d8bb31b19c))
64+
65+
## [9.18.0](https://github.com/launchdarkly/python-server-sdk/compare/9.17.0...9.18.0) (2026-09-25)
66+
67+
68+
### Features
69+
70+
* Add retry state for RETRY-spec backoff ([#522](https://github.com/launchdarkly/python-server-sdk/issues/522)) ([e734558](https://github.com/launchdarkly/python-server-sdk/commit/e734558d52dbd3eeeb9d378f283dd3d3f5cee611))
71+
* Drive repeating tasks from a delay source ([9abe8cb](https://github.com/launchdarkly/python-server-sdk/commit/9abe8cbb878445b500211c89f0e3176fdbe4587a))
72+
* Retry indefinitely after a data source failure instead of stopping permanently in FDv1 ([e17e173](https://github.com/launchdarkly/python-server-sdk/commit/e17e1730de44f4494befd4df260381f7548ca74a))
73+
* Warn that payload filtering has no effect with FDv2 ([#518](https://github.com/launchdarkly/python-server-sdk/issues/518)) ([296311f](https://github.com/launchdarkly/python-server-sdk/commit/296311f9ea73f09e96bd8dfb7410405e08794776))
74+
* Warn when the SDK is used in a forked process without postfork ([#512](https://github.com/launchdarkly/python-server-sdk/issues/512)) ([75402e9](https://github.com/launchdarkly/python-server-sdk/commit/75402e90f38a154466ab8b2bdd53a819720e0001))
75+
76+
77+
### Bug Fixes
78+
79+
* Add async modules to the readthedocs API reference ([#513](https://github.com/launchdarkly/python-server-sdk/issues/513)) ([f40d3b2](https://github.com/launchdarkly/python-server-sdk/commit/f40d3b22c808e829e9deb4ac5feab05db85674e8))
80+
* Log the cached-data evaluation warning only once per client ([#520](https://github.com/launchdarkly/python-server-sdk/issues/520)) ([59ce998](https://github.com/launchdarkly/python-server-sdk/commit/59ce998668b6907fb0663699127b0b9895cbdcef))
81+
* Read all items when a collection is empty ([#524](https://github.com/launchdarkly/python-server-sdk/issues/524)) ([1087147](https://github.com/launchdarkly/python-server-sdk/commit/108714738b1ef0b955321b502bfa65dbced5eaee))
82+
* Repeating task wait duration is no longer reduced by a slow callback duration. ([9abe8cb](https://github.com/launchdarkly/python-server-sdk/commit/9abe8cbb878445b500211c89f0e3176fdbe4587a))
83+
* Report a distinct User-Agent for the async client ([#516](https://github.com/launchdarkly/python-server-sdk/issues/516)) ([514c467](https://github.com/launchdarkly/python-server-sdk/commit/514c46780cf5aa593c1f791bd1335c7048f6d235))
84+
* Warn and use the documented default for an invalid poll interval or initial reconnect delay ([e17e173](https://github.com/launchdarkly/python-server-sdk/commit/e17e1730de44f4494befd4df260381f7548ca74a))
85+
586
## [9.17.0](https://github.com/launchdarkly/python-server-sdk/compare/9.16.1...9.17.0) (2026-08-28)
687

788

‎PROVENANCE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To verify build provenance attestations, we recommend using the [GitHub CLI `att
99
<!-- x-release-please-start-version -->
1010
```
1111
# Set the version of the SDK to verify
12-
SDK_VERSION=9.17.0
12+
SDK_VERSION=9.20.0
1313
```
1414
<!-- x-release-please-end -->
1515

‎contract-tests/async_client_entity.py‎

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import requests
88
from async_big_segment_store_fixture import AsyncBigSegmentStoreFixture
99
from async_flag_change_listener import AsyncListenerRegistry
10-
from hook import AsyncPostingHook
10+
from hook import PostingHook
1111

1212
from ldclient import Context
1313
from ldclient.async_client import AsyncLDClient
@@ -16,6 +16,7 @@
1616
AsyncConfig,
1717
AsyncDataSystemConfig
1818
)
19+
from ldclient.config import HTTPConfig
1920
from ldclient.feature_store import CacheConfig
2021
from ldclient.impl.datasourcev2.async_polling import (
2122
AsyncFallbackToFDv1PollingDataSourceBuilder,
@@ -56,6 +57,31 @@ async def start(self):
5657
'version': tags.get('applicationVersion', ''),
5758
}
5859

60+
wrapper = config_params.get('wrapper') or {}
61+
if wrapper.get('name'):
62+
opts['wrapper_name'] = wrapper['name']
63+
if wrapper.get('version'):
64+
opts['wrapper_version'] = wrapper['version']
65+
66+
http_opts = {}
67+
tls = config_params.get('tls') or {}
68+
if tls.get('skipVerifyPeer', False):
69+
http_opts['disable_ssl_verification'] = True
70+
proxy = config_params.get('proxy') or {}
71+
if proxy.get('httpProxy'):
72+
http_opts['http_proxy'] = proxy['httpProxy']
73+
if http_opts:
74+
opts['http'] = HTTPConfig(**http_opts)
75+
76+
# Per-component base URIs below take precedence over these.
77+
endpoints = config_params.get('serviceEndpoints') or {}
78+
if endpoints.get('streaming'):
79+
opts['stream_uri'] = endpoints['streaming']
80+
if endpoints.get('polling'):
81+
opts['base_uri'] = endpoints['polling']
82+
if endpoints.get('events'):
83+
opts['events_uri'] = endpoints['events']
84+
5985
datasystem_config = config_params.get('dataSystem')
6086
if config_params.get('overrides') is not None and datasystem_config is None:
6187
raise ValueError("flag overrides require the data system to be configured")
@@ -76,7 +102,9 @@ async def start(self):
76102
if polling.get("filter") is not None:
77103
opts["payload_filter_key"] = polling["filter"]
78104
_set_optional_time_prop(polling, "pollIntervalMs", opts, "poll_interval")
79-
else:
105+
elif not endpoints.get('streaming') and not endpoints.get('polling'):
106+
# No data source config and no streaming or polling endpoint means daemon mode.
107+
# A config that sets only an endpoint gets the default streaming data source.
80108
opts['use_ldd'] = True
81109

82110
if config_params.get("events") is not None:
@@ -94,10 +122,9 @@ async def start(self):
94122
else:
95123
opts["send_events"] = False
96124

97-
hooks = []
98125
if config_params.get("hooks") is not None:
99-
hooks = [
100-
AsyncPostingHook(h["name"], h["callbackUri"], h.get("data", {}), h.get("errors", {}))
126+
opts["hooks"] = [
127+
PostingHook(h["name"], h["callbackUri"], h.get("data", {}), h.get("errors", {}))
101128
for h in config_params["hooks"]["hooks"]
102129
]
103130

@@ -118,10 +145,6 @@ async def start(self):
118145
sdk_config = AsyncConfig(**opts)
119146

120147
self._client = AsyncLDClient(sdk_config)
121-
# The async client accepts AsyncHook instances only; register the
122-
# harness's async posting hooks via add_hook() before start().
123-
for hook in hooks:
124-
self._client.add_hook(hook)
125148
await self._client.start(start_wait / 1000.0)
126149
self._listeners = AsyncListenerRegistry(self._client.flag_tracker)
127150

‎contract-tests/async_service.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ async def handle_status(request: aiohttp.web.Request) -> aiohttp.web.Response:
7070
'persistent-data-store-redis',
7171
'fdv1-fallback',
7272
'flag-overrides',
73+
'retry-conformance-fdv1-streaming',
74+
'retry-conformance-fdv1-polling',
75+
'service-endpoints',
76+
'wrapper',
77+
'http-proxy',
78+
'tls:skip-verify-peer',
7379
]
7480
}
7581
return aiohttp.web.Response(

‎contract-tests/client_entity.py‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Operation,
1919
Stage
2020
)
21-
from ldclient.config import BigSegmentsConfig
21+
from ldclient.config import BigSegmentsConfig, HTTPConfig
2222
from ldclient.datasystem import (
2323
custom,
2424
fdv1_fallback_ds_builder,
@@ -44,6 +44,31 @@ def __init__(self, tag, config):
4444
'version': tags.get('applicationVersion', ''),
4545
}
4646

47+
wrapper = config.get('wrapper') or {}
48+
if wrapper.get('name'):
49+
opts['wrapper_name'] = wrapper['name']
50+
if wrapper.get('version'):
51+
opts['wrapper_version'] = wrapper['version']
52+
53+
http_opts = {}
54+
tls = config.get('tls') or {}
55+
if tls.get('skipVerifyPeer', False):
56+
http_opts['disable_ssl_verification'] = True
57+
proxy = config.get('proxy') or {}
58+
if proxy.get('httpProxy'):
59+
http_opts['http_proxy'] = proxy['httpProxy']
60+
if http_opts:
61+
opts['http'] = HTTPConfig(**http_opts)
62+
63+
# Per-component base URIs below take precedence over these.
64+
endpoints = config.get('serviceEndpoints') or {}
65+
if endpoints.get('streaming'):
66+
opts['stream_uri'] = endpoints['streaming']
67+
if endpoints.get('polling'):
68+
opts['base_uri'] = endpoints['polling']
69+
if endpoints.get('events'):
70+
opts['events_uri'] = endpoints['events']
71+
4772
datasystem_config = config.get('dataSystem')
4873
if config.get('overrides') is not None and datasystem_config is None:
4974
raise ValueError("flag overrides require the data system to be configured")
@@ -131,7 +156,9 @@ def __init__(self, tag, config):
131156
if polling.get("filter") is not None:
132157
opts["payload_filter_key"] = polling["filter"]
133158
_set_optional_time_prop(polling, "pollIntervalMs", opts, "poll_interval")
134-
else:
159+
elif not endpoints.get('streaming') and not endpoints.get('polling'):
160+
# No data source config and no streaming or polling endpoint means daemon mode.
161+
# A config that sets only an endpoint gets the default streaming data source.
135162
opts['use_ldd'] = True
136163

137164
if config.get("events") is not None:

0 commit comments

Comments
 (0)