fb-python-sdk 1.1.8__py3-none-any.whl → 1.1.10__py3-none-any.whl
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.
- {fb_python_sdk-1.1.8.dist-info → fb_python_sdk-1.1.10.dist-info}/METADATA +16 -9
- {fb_python_sdk-1.1.8.dist-info → fb_python_sdk-1.1.10.dist-info}/RECORD +7 -7
- {fb_python_sdk-1.1.8.dist-info → fb_python_sdk-1.1.10.dist-info}/WHEEL +1 -1
- fbclient/streaming.py +16 -11
- fbclient/utils/__init__.py +1 -1
- {fb_python_sdk-1.1.8.dist-info → fb_python_sdk-1.1.10.dist-info}/licenses/LICENSE +0 -0
- {fb_python_sdk-1.1.8.dist-info → fb_python_sdk-1.1.10.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fb-python-sdk
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.10
|
|
4
4
|
Summary: A Python SDK for FeatBit plateform
|
|
5
5
|
Home-page: https://github.com/featbit/featbit-python-sdk
|
|
6
6
|
Author: Dian SUN
|
|
@@ -13,23 +13,21 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Topic :: Software Development
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Python: >=3.10, <3.15
|
|
24
22
|
Description-Content-Type: text/markdown
|
|
25
23
|
License-File: LICENSE
|
|
26
24
|
Requires-Dist: certifi>=2018.4.16
|
|
27
|
-
Requires-Dist: urllib3
|
|
25
|
+
Requires-Dist: urllib3<3,>=1.26.5
|
|
28
26
|
Requires-Dist: python-dateutil>=2.8.2
|
|
29
27
|
Requires-Dist: websocket-client>=1.0.0
|
|
30
28
|
Provides-Extra: dev
|
|
31
29
|
Requires-Dist: certifi>=2018.4.16; extra == "dev"
|
|
32
|
-
Requires-Dist: urllib3
|
|
30
|
+
Requires-Dist: urllib3<3,>=1.26.5; extra == "dev"
|
|
33
31
|
Requires-Dist: websocket-client>=1.0.0; extra == "dev"
|
|
34
32
|
Requires-Dist: python-dateutil>=2.8.2; extra == "dev"
|
|
35
33
|
Requires-Dist: flake8; extra == "dev"
|
|
@@ -53,6 +51,12 @@ Dynamic: summary
|
|
|
53
51
|
|
|
54
52
|
# FeatBit Server-Side SDK for Python
|
|
55
53
|
|
|
54
|
+
> **Important upgrade notice:** Versions **1.1.8 and 1.1.9** contain a streaming
|
|
55
|
+
> regression that can stop flag updates after the first heartbeat, leaving
|
|
56
|
+
> applications evaluating cached values. Online streaming users should upgrade to
|
|
57
|
+
> **1.1.10** as soon as it is available and update pinned dependencies or lock files.
|
|
58
|
+
> See [issue #18](https://github.com/featbit/featbit-python-sdk/issues/18).
|
|
59
|
+
|
|
56
60
|
## Introduction
|
|
57
61
|
|
|
58
62
|
This is the Python Server-Side SDK for the 100% open-source feature flags management platform [FeatBit](https://github.com/featbit/featbit).
|
|
@@ -71,7 +75,10 @@ If you want to use your own data source, see [Offline Mode](#offline-mode).
|
|
|
71
75
|
## Get Started
|
|
72
76
|
|
|
73
77
|
### Installation
|
|
74
|
-
Install the SDK using pip. This version is compatible with Python 3.
|
|
78
|
+
Install the SDK using pip. This version is compatible with Python 3.10 through 3.14.
|
|
79
|
+
CI is configured to test compatibility on Linux and Windows through Python 3.14,
|
|
80
|
+
including the full unit suite and SDK resource-lifecycle audit.
|
|
81
|
+
Free-threaded CPython 3.14 builds are not currently tested or supported.
|
|
75
82
|
|
|
76
83
|
```shell
|
|
77
84
|
pip install fb-python-sdk
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
fb_python_sdk-1.1.
|
|
1
|
+
fb_python_sdk-1.1.10.dist-info/licenses/LICENSE,sha256=Pp1Gaxzlu2F3GAFJ314grnBHifZdIK7_ZvCFV_khanM,1064
|
|
2
2
|
fbclient/__init__.py,sha256=ApEOR6dqgunNQ1mCeazg28z69DNRzVpQS39ApQ8Mf2M,2193
|
|
3
3
|
fbclient/category.py,sha256=DzblPnzVwsPKK_FSnLkK3HyWXStbNdPiRfdgSoEODVY,1058
|
|
4
4
|
fbclient/client.py,sha256=QPLkC2C1J3B5VenJz6xslVVheK9jM34dqpFWkf7371M,21236
|
|
@@ -13,15 +13,15 @@ fbclient/interfaces.py,sha256=YJ454VaIfOdGIgaNjZn6DxnW_-VkITwR3FYblTrXiZs,10461
|
|
|
13
13
|
fbclient/notice_broadcaster.py,sha256=5LGfY-D_TVU29qJqj8lJ5cskL3c7EWFcewZoNX6_Bpk,3231
|
|
14
14
|
fbclient/status.py,sha256=gn5rl8yowdyze8IbvgZThI50Xic_xKpPqtgrJswdaKA,5992
|
|
15
15
|
fbclient/status_types.py,sha256=-xB4zf2qHPNE1GHOSkO1h3SJ_5vQZqrvOymBVvvh5ts,3160
|
|
16
|
-
fbclient/streaming.py,sha256=
|
|
16
|
+
fbclient/streaming.py,sha256=f7xlXmbmryQ8olJDSEb2fvM36bACWG9WCIj1Lp2jRwU,16825
|
|
17
17
|
fbclient/update_processor.py,sha256=GCri2RzYSXuE-3nMtRJZRKrj0b1vtd4-rW1RpjG6bro,937
|
|
18
|
-
fbclient/utils/__init__.py,sha256=
|
|
18
|
+
fbclient/utils/__init__.py,sha256=oMDgzVDtPbbtiFNur7Q8ui1EEw825b7aQro45R8tATM,4372
|
|
19
19
|
fbclient/utils/exponential_backoff_jitter_strategy.py,sha256=xZk7Y0yi3__U8c3DaX3PRb55vZAsRX__Rna3b2Wj9JA,1950
|
|
20
20
|
fbclient/utils/http_client.py,sha256=1G9mGVvU4X166VFoQyL43ORvpzTVPGZCuoDve_R75j4,5754
|
|
21
21
|
fbclient/utils/repeatable_task.py,sha256=mLkxlUkfHHmT5OOKlbh3vE1QrAH9JPecErvrwqsNgtc,1835
|
|
22
22
|
fbclient/utils/rwlock.py,sha256=BfgKYNwZ8y63yk-CphlFTCZ1-0Txh4XQ8Pzh2pohh5A,1159
|
|
23
23
|
fbclient/utils/variation_splitting_algorithm.py,sha256=4_qBeVANWIFPacifmV1zl_JZXywOd-wv1fQmnb8qyAE,864
|
|
24
|
-
fb_python_sdk-1.1.
|
|
25
|
-
fb_python_sdk-1.1.
|
|
26
|
-
fb_python_sdk-1.1.
|
|
27
|
-
fb_python_sdk-1.1.
|
|
24
|
+
fb_python_sdk-1.1.10.dist-info/METADATA,sha256=-ApoFnwtY0C6kNU2M_V0St1w0bCFAQ5g2SPbQ7RBiUQ,15601
|
|
25
|
+
fb_python_sdk-1.1.10.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
26
|
+
fb_python_sdk-1.1.10.dist-info/top_level.txt,sha256=m0lqkwRY4CCAR7ABfB47YE1I62JGd4v0yixam1hlTZk,9
|
|
27
|
+
fb_python_sdk-1.1.10.dist-info/RECORD,,
|
fbclient/streaming.py
CHANGED
|
@@ -11,7 +11,7 @@ from fbclient.flag_change_notification import FlagChangedNotice
|
|
|
11
11
|
from fbclient.interfaces import UpdateProcessor
|
|
12
12
|
from fbclient.notice_broadcaster import NoticeBroadcater
|
|
13
13
|
from fbclient.status import DataUpdateStatusProviderImpl
|
|
14
|
-
from fbclient.status_types import (
|
|
14
|
+
from fbclient.status_types import (NETWORK_ERROR,
|
|
15
15
|
REQUEST_INVALID_ERROR, RUNTIME_ERROR,
|
|
16
16
|
SYSTEM_QUIT, UNKNOWN_CLOSE_CODE,
|
|
17
17
|
UNKNOWN_ERROR, WEBSOCKET_ERROR, State)
|
|
@@ -302,16 +302,21 @@ class Streaming(Thread, UpdateProcessor):
|
|
|
302
302
|
log.trace('Streaming WebSocket data: %s' % msg) # type: ignore
|
|
303
303
|
try:
|
|
304
304
|
all_data = json.loads(msg)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
305
|
+
except Exception:
|
|
306
|
+
log.exception('FB Python SDK: could not parse data-sync message; skipping message: %r', msg)
|
|
307
|
+
return
|
|
308
|
+
if isinstance(all_data, dict) and all_data.get('messageType') == 'data-sync':
|
|
309
|
+
try:
|
|
310
|
+
self._handle_data_sync_message(wsapp, all_data)
|
|
311
|
+
except Exception:
|
|
312
|
+
log.exception('FB Python SDK: could not process data-sync message; skipping message: %r', all_data)
|
|
313
|
+
|
|
314
|
+
def _handle_data_sync_message(self, wsapp: websocket.WebSocketApp, all_data):
|
|
315
|
+
if not valide_all_data(all_data):
|
|
316
|
+
log.error('FB Python SDK: invalid data-sync message; skipping message: %r', all_data)
|
|
317
|
+
return
|
|
318
|
+
if not self._on_process_data(all_data['data']):
|
|
319
|
+
log.error('FB Python SDK: could not apply data-sync message; skipping message: %r', all_data)
|
|
315
320
|
|
|
316
321
|
def stop(self):
|
|
317
322
|
log.info('FB Python SDK: Streaming is stopping...')
|
fbclient/utils/__init__.py
CHANGED
|
@@ -67,7 +67,7 @@ def unix_timestamp_in_milliseconds():
|
|
|
67
67
|
|
|
68
68
|
def valide_all_data(all_data=None) -> bool:
|
|
69
69
|
return isinstance(all_data, dict) \
|
|
70
|
-
and all_data.get('messageType'
|
|
70
|
+
and all_data.get('messageType') == 'data-sync' \
|
|
71
71
|
and 'data' in all_data and isinstance(all_data['data'], dict) \
|
|
72
72
|
and all(k in all_data['data'] for k in ('eventType', 'featureFlags', 'segments')) \
|
|
73
73
|
and any(k == all_data['data']['eventType'] for k in ('full', 'patch')) \
|
|
File without changes
|
|
File without changes
|