Skip to content

Commit e4bbcf1

Browse files
committed
Merge branch 'main' into feat/10.x
Adapts the main changes to 10.x: the #591 docs and tests use Files.new_data_source and data_system and drop the FDv1 case, the #587 test uses an initializer instead of an update processor, the README keeps the 3.11 minimum, and CI keeps the single v3 contract test step with the new action tag.
2 parents 2265718 + 6a3c799 commit e4bbcf1

16 files changed

Lines changed: 226 additions & 25 deletions

‎.github/dependabot.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directories:
5+
- '/'
6+
- '/.github/actions/*'
7+
schedule:
8+
interval: 'monthly'
9+
cooldown:
10+
default-days: 7
11+
exclude:
12+
- 'launchdarkly/*'

‎.github/renovate.json‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424

2525
- name: Set up uv
26-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
26+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929

30-
- uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores-v0
30+
- uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores/v0
3131
with:
3232
redis: true
3333
consul: true
@@ -55,7 +55,7 @@ jobs:
5555
run: make start-contract-test-service-bg
5656

5757
- name: Run contract tests
58-
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
58+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests/v1
5959
with:
6060
test_service_port: 9000
6161
token: ${{ secrets.GITHUB_TOKEN }}
@@ -70,7 +70,7 @@ jobs:
7070
run: make start-async-contract-test-service-bg
7171

7272
- name: Run async contract tests
73-
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
73+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests/v1
7474
with:
7575
test_service_port: 9001
7676
token: ${{ secrets.GITHUB_TOKEN }}
@@ -90,7 +90,7 @@ jobs:
9090
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9191

9292
- name: Set up uv
93-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
93+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
9494
with:
9595
python-version: "3.13"
9696

@@ -145,7 +145,7 @@ jobs:
145145
run: make start-contract-test-service-bg
146146

147147
- name: Run contract tests against the sdist
148-
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
148+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests/v1
149149
with:
150150
test_service_port: 9000
151151
enable_persistence_tests: "false"
@@ -157,7 +157,7 @@ jobs:
157157
run: make start-async-contract-test-service-bg
158158

159159
- name: Run async contract tests against the sdist
160-
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1
160+
uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests/v1
161161
with:
162162
test_service_port: 9001
163163
enable_persistence_tests: "false"
@@ -180,11 +180,11 @@ jobs:
180180
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
181181

182182
- name: Set up uv
183-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
183+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
184184
with:
185185
python-version: ${{ matrix.python-version }}
186186

187-
- uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores-v0
187+
- uses: launchdarkly/gh-actions/actions/persistent-stores@persistent-stores/v0
188188
with:
189189
redis: true
190190
consul: true

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2020

2121
- name: Set up uv
22-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
22+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
2323
with:
2424
python-version: "3.11"
2525

26-
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1
26+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets/v1
2727
name: "Get PyPI token"
2828
with:
2929
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Publish package distributions to PyPI
3535
if: ${{ format('{0}', inputs.dry_run) == 'false' }}
36-
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
36+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
3737
with:
3838
password: ${{env.PYPI_AUTH_TOKEN}}
3939

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323

2424
- name: Set up uv
2525
if: ${{ steps.release.outputs.releases_created == 'true' }}
26-
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
26+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
2727
with:
2828
python-version: "3.11"
2929

30-
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1
30+
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets/v1
3131
if: ${{ steps.release.outputs.releases_created == 'true' }}
3232
name: "Get PyPI token"
3333
with:
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Publish package distributions to PyPI
4444
if: ${{ steps.release.outputs.releases_created == 'true' }}
45-
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
45+
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
4646
with:
4747
password: ${{env.PYPI_AUTH_TOKEN}}
4848

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## Supported Python versions
1616

17-
This version of the LaunchDarkly SDK is compatible with Python 3.11+.
17+
While this version of the LaunchDarkly SDK requires Python 3.11 or later, you should use the latest patched version of a supported Python release.
1818

1919
## Getting started
2020

‎ldclient/datasystem.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ def streaming_ds_builder() -> StreamingDataSourceBuilder:
155155
def file_ds_builder(paths: List[str]) -> FileDataSourceBuilder:
156156
"""
157157
Returns a builder for a file-based data source.
158+
159+
File data has no LaunchDarkly selector, so the SDK reports it as cached data. Refer to
160+
:func:`ldclient.integrations.Files.new_data_source` for the warning that this causes.
158161
"""
159162
return FileDataSourceBuilder(paths)
160163

‎ldclient/impl/datasystem/async_fdv2.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ async def _run_initializers(self, set_on_ready: AsyncEvent) -> bool:
526526
return False
527527
except Exception as e:
528528
log.error("Initializer failed with exception: %s", e)
529+
if self._store.is_memory_initialized():
530+
set_on_ready.set()
529531
return False
530532

531533
async def _run_synchronizers(self, set_on_ready: AsyncEvent):

‎ldclient/impl/datasystem/fdv2.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ def _run_initializers(self, set_on_ready: Event) -> bool:
507507
return False
508508
except Exception as e:
509509
log.error("Initializer failed with exception: %s", e)
510+
if self._store.is_memory_initialized():
511+
set_on_ready.set()
510512
return False
511513

512514
def _run_synchronizers(self, set_on_ready: Event):

‎ldclient/impl/datasystem/store.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ def is_initialized(self) -> bool:
414414
"""Check if the active store is initialized."""
415415
return self.get_active_store().initialized
416416

417+
def is_memory_initialized(self) -> bool:
418+
"""Check if data has been applied to the in-memory store."""
419+
return self._memory_store.initialized
420+
417421

418422
class Store(_StoreBase):
419423
"""

0 commit comments

Comments
 (0)