Skip to content

Commit 0dd0712

Browse files
authored
add 3.7 .. 3.10 to supported python versions + offline autopoll fix + test fix (#43)
1 parent 5e2a2cf commit 0dd0712

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

configcatclient/configcatclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def set_offline(self):
332332

333333
def is_offline(self):
334334
"""
335-
True when the SDK is configured not to initiate HTTP requests, otherwise false.
335+
True when the SDK is configured not to initiate HTTP requests, otherwise False.
336336
"""
337337
if self._config_service:
338338
return self._config_service.is_offline()

configcatclient/configentry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def to_json(self):
3333
}
3434

3535

36-
ConfigEntry.empty = ConfigEntry()
36+
ConfigEntry.empty = ConfigEntry(etag='empty')

configcatclient/configservice.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, sdk_key, polling_mode, hooks, config_fetcher, log, config_cac
2828
self._fetch_finished = Event()
2929
self._start_time = utils.get_utc_now()
3030

31-
if isinstance(self._polling_mode, AutoPollingMode):
31+
if isinstance(self._polling_mode, AutoPollingMode) and not is_offline:
3232
self._start_poll()
3333
else:
3434
self._set_initialized()
@@ -66,7 +66,6 @@ def set_online(self):
6666
self._is_offline = False
6767
if isinstance(self._polling_mode, AutoPollingMode):
6868
self._start_poll()
69-
self.log.debug('Switched to ONLINE mode.')
7069

7170
def set_offline(self):
7271
with self._lock:
@@ -78,8 +77,6 @@ def set_offline(self):
7877
self._stopped.set()
7978
self._thread.join()
8079

81-
self.log.debug('Switched to OFFLINE mode.')
82-
8380
def is_offline(self):
8481
return self._is_offline # atomic operation in python (lock is not needed)
8582

configcatclient/rolloutevaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, log):
3434

3535
def evaluate(self, key, user, default_value, default_variation_id, settings):
3636
"""
37-
returns value, variation_id. matched_evaluation_rule, matched_evaluation_percentage_rule, error
37+
returns value, variation_id, matched_evaluation_rule, matched_evaluation_percentage_rule, error
3838
"""
3939
setting_descriptor = settings.get(key)
4040

configcatclient/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONFIGCATCLIENT_VERSION = "7.0.0"
1+
CONFIGCATCLIENT_VERSION = "7.0.1"

configcatclienttests/test_configcatclient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def test_get_value_details(self):
157157
client = ConfigCatClient.get('test', ConfigCatOptions(polling_mode=PollingMode.manual_poll()))
158158
client.force_refresh()
159159

160-
user = User("[email protected]")
160+
user = User('[email protected]')
161161
details = client.get_value_details('testStringKey', '', user)
162162

163163
self.assertEqual('fake1', details.value)
@@ -202,7 +202,7 @@ def test_default_user_get_value(self):
202202

203203
client.close()
204204

205-
def test_default_user_get_all_value(self):
205+
def test_default_user_get_all_values(self):
206206
client = ConfigCatClient.get('test', ConfigCatOptions(polling_mode=PollingMode.manual_poll(),
207207
config_cache=ConfigCacheMock()))
208208
user1 = User("[email protected]")

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def parse_requirements(filename):
66
return [line for line in lines if line]
77

88

9-
configcatclient_version = '7.0.0'
9+
configcatclient_version = '7.0.1'
1010

1111
requirements = parse_requirements('requirements.txt')
1212

@@ -37,6 +37,10 @@ def parse_requirements(filename):
3737
'Programming Language :: Python :: 3.4',
3838
'Programming Language :: Python :: 3.5',
3939
'Programming Language :: Python :: 3.6',
40+
'Programming Language :: Python :: 3.7',
41+
'Programming Language :: Python :: 3.8',
42+
'Programming Language :: Python :: 3.9',
43+
'Programming Language :: Python :: 3.10',
4044
'Topic :: Software Development',
4145
'Topic :: Software Development :: Libraries',
4246
],

0 commit comments

Comments
 (0)