growthbook 1.4.0__tar.gz → 1.4.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.
- {growthbook-1.4.0/growthbook.egg-info → growthbook-1.4.2}/PKG-INFO +3 -3
- {growthbook-1.4.0 → growthbook-1.4.2}/README.md +2 -2
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/__init__.py +1 -1
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/growthbook.py +11 -6
- {growthbook-1.4.0 → growthbook-1.4.2/growthbook.egg-info}/PKG-INFO +3 -3
- {growthbook-1.4.0 → growthbook-1.4.2}/setup.cfg +1 -1
- {growthbook-1.4.0 → growthbook-1.4.2}/LICENSE +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/MANIFEST.in +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/common_types.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/core.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/growthbook_client.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/plugins/__init__.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/plugins/base.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/plugins/growthbook_tracking.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/plugins/request_context.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook/py.typed +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook.egg-info/SOURCES.txt +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook.egg-info/dependency_links.txt +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook.egg-info/requires.txt +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/growthbook.egg-info/top_level.txt +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/pyproject.toml +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/setup.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/tests/conftest.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/tests/test_growthbook.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/tests/test_growthbook_client.py +0 -0
- {growthbook-1.4.0 → growthbook-1.4.2}/tests/test_plugins.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: growthbook
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Powerful Feature flagging and A/B testing for Python apps
|
|
5
5
|
Home-page: https://github.com/growthbook/growthbook-python
|
|
6
6
|
Author: GrowthBook
|
|
@@ -49,7 +49,7 @@ Powerful Feature flagging and A/B testing for Python apps.
|
|
|
49
49
|
- **Use your existing event tracking** (GA, Segment, Mixpanel, custom)
|
|
50
50
|
- **Remote configuration** to change feature flags without deploying new code
|
|
51
51
|
- **Async support** with real-time feature updates
|
|
52
|
-
- Python 3.
|
|
52
|
+
- Python 3.9+
|
|
53
53
|
- 100% test coverage
|
|
54
54
|
|
|
55
55
|
## Installation
|
|
@@ -660,7 +660,7 @@ gb.run(Experiment(
|
|
|
660
660
|
key = "by-company-id",
|
|
661
661
|
variations = ["A", "B"],
|
|
662
662
|
hashAttribute = "company"
|
|
663
|
-
))
|
|
663
|
+
))
|
|
664
664
|
```
|
|
665
665
|
|
|
666
666
|
## Logging
|
|
@@ -14,7 +14,7 @@ Powerful Feature flagging and A/B testing for Python apps.
|
|
|
14
14
|
- **Use your existing event tracking** (GA, Segment, Mixpanel, custom)
|
|
15
15
|
- **Remote configuration** to change feature flags without deploying new code
|
|
16
16
|
- **Async support** with real-time feature updates
|
|
17
|
-
- Python 3.
|
|
17
|
+
- Python 3.9+
|
|
18
18
|
- 100% test coverage
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
@@ -625,7 +625,7 @@ gb.run(Experiment(
|
|
|
625
625
|
key = "by-company-id",
|
|
626
626
|
variations = ["A", "B"],
|
|
627
627
|
hashAttribute = "company"
|
|
628
|
-
))
|
|
628
|
+
))
|
|
629
629
|
```
|
|
630
630
|
|
|
631
631
|
## Logging
|
|
@@ -120,12 +120,13 @@ class InMemoryStickyBucketService(AbstractStickyBucketService):
|
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
class SSEClient:
|
|
123
|
-
def __init__(self, api_host, client_key, on_event, reconnect_delay=5, headers=None):
|
|
123
|
+
def __init__(self, api_host, client_key, on_event, reconnect_delay=5, headers=None, timeout=30):
|
|
124
124
|
self.api_host = api_host
|
|
125
125
|
self.client_key = client_key
|
|
126
126
|
|
|
127
127
|
self.on_event = on_event
|
|
128
128
|
self.reconnect_delay = reconnect_delay
|
|
129
|
+
self.timeout = timeout
|
|
129
130
|
|
|
130
131
|
self._sse_session = None
|
|
131
132
|
self._sse_thread = None
|
|
@@ -173,7 +174,8 @@ class SSEClient:
|
|
|
173
174
|
|
|
174
175
|
while self.is_running:
|
|
175
176
|
try:
|
|
176
|
-
async with aiohttp.ClientSession(headers=self.headers
|
|
177
|
+
async with aiohttp.ClientSession(headers=self.headers,
|
|
178
|
+
timeout=aiohttp.ClientTimeout(connect=self.timeout)) as session:
|
|
177
179
|
self._sse_session = session
|
|
178
180
|
|
|
179
181
|
async with session.get(url) as response:
|
|
@@ -214,7 +216,7 @@ class SSEClient:
|
|
|
214
216
|
self.on_event(event_data)
|
|
215
217
|
|
|
216
218
|
async def _wait_for_reconnect(self):
|
|
217
|
-
logger.
|
|
219
|
+
logger.info(f"Attempting to reconnect streaming in {self.reconnect_delay} seconds")
|
|
218
220
|
await asyncio.sleep(self.reconnect_delay)
|
|
219
221
|
|
|
220
222
|
async def _close_session(self):
|
|
@@ -407,10 +409,10 @@ class FeatureRepository(object):
|
|
|
407
409
|
return data
|
|
408
410
|
|
|
409
411
|
|
|
410
|
-
def startAutoRefresh(self, api_host, client_key, cb):
|
|
412
|
+
def startAutoRefresh(self, api_host, client_key, cb, streaming_timeout=30):
|
|
411
413
|
if not client_key:
|
|
412
414
|
raise ValueError("Must specify `client_key` to start features streaming")
|
|
413
|
-
self.sse_client = self.sse_client or SSEClient(api_host=api_host, client_key=client_key, on_event=cb)
|
|
415
|
+
self.sse_client = self.sse_client or SSEClient(api_host=api_host, client_key=client_key, on_event=cb, timeout=streaming_timeout)
|
|
414
416
|
self.sse_client.connect()
|
|
415
417
|
|
|
416
418
|
def stopAutoRefresh(self):
|
|
@@ -443,6 +445,7 @@ class GrowthBook(object):
|
|
|
443
445
|
sticky_bucket_identifier_attributes: List[str] = None,
|
|
444
446
|
savedGroups: dict = {},
|
|
445
447
|
streaming: bool = False,
|
|
448
|
+
streaming_connection_timeout: int = 30,
|
|
446
449
|
plugins: List = None,
|
|
447
450
|
# Deprecated args
|
|
448
451
|
trackingCallback=None,
|
|
@@ -471,6 +474,7 @@ class GrowthBook(object):
|
|
|
471
474
|
self._trackingCallback = on_experiment_viewed or trackingCallback
|
|
472
475
|
|
|
473
476
|
self._streaming = streaming
|
|
477
|
+
self._streaming_timeout = streaming_connection_timeout
|
|
474
478
|
|
|
475
479
|
# Deprecated args
|
|
476
480
|
self._user = user
|
|
@@ -587,7 +591,8 @@ class GrowthBook(object):
|
|
|
587
591
|
feature_repo.startAutoRefresh(
|
|
588
592
|
api_host=self._api_host,
|
|
589
593
|
client_key=self._client_key,
|
|
590
|
-
cb=self._dispatch_sse_event
|
|
594
|
+
cb=self._dispatch_sse_event,
|
|
595
|
+
streaming_timeout=self._streaming_timeout
|
|
591
596
|
)
|
|
592
597
|
|
|
593
598
|
def stopAutoRefresh(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: growthbook
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Powerful Feature flagging and A/B testing for Python apps
|
|
5
5
|
Home-page: https://github.com/growthbook/growthbook-python
|
|
6
6
|
Author: GrowthBook
|
|
@@ -49,7 +49,7 @@ Powerful Feature flagging and A/B testing for Python apps.
|
|
|
49
49
|
- **Use your existing event tracking** (GA, Segment, Mixpanel, custom)
|
|
50
50
|
- **Remote configuration** to change feature flags without deploying new code
|
|
51
51
|
- **Async support** with real-time feature updates
|
|
52
|
-
- Python 3.
|
|
52
|
+
- Python 3.9+
|
|
53
53
|
- 100% test coverage
|
|
54
54
|
|
|
55
55
|
## Installation
|
|
@@ -660,7 +660,7 @@ gb.run(Experiment(
|
|
|
660
660
|
key = "by-company-id",
|
|
661
661
|
variations = ["A", "B"],
|
|
662
662
|
hashAttribute = "company"
|
|
663
|
-
))
|
|
663
|
+
))
|
|
664
664
|
```
|
|
665
665
|
|
|
666
666
|
## Logging
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|