ibm-appconfiguration-python-sdk 0.3.4__tar.gz → 0.3.6__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.
Files changed (57) hide show
  1. {ibm_appconfiguration_python_sdk-0.3.4/ibm_appconfiguration_python_sdk.egg-info → ibm_appconfiguration_python_sdk-0.3.6}/PKG-INFO +16 -17
  2. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/README.md +14 -15
  3. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/configuration_handler.py +18 -6
  4. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/common/config_messages.py +1 -1
  5. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/version.py +1 -1
  6. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6/ibm_appconfiguration_python_sdk.egg-info}/PKG-INFO +16 -17
  7. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration_python_sdk.egg-info/requires.txt +1 -1
  8. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/setup.py +2 -2
  9. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/LICENSE +0 -0
  10. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/examples/__init__.py +0 -0
  11. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/examples/sample_app.py +0 -0
  12. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/examples/server_sample.py +0 -0
  13. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/__init__.py +0 -0
  14. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/appconfiguration.py +0 -0
  15. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/__init__.py +0 -0
  16. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/__init__.py +0 -0
  17. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/common/__init__.py +0 -0
  18. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/common/config_constants.py +0 -0
  19. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/__init__.py +0 -0
  20. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/api_manager.py +0 -0
  21. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/compute_percentage.py +0 -0
  22. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/connectivity.py +0 -0
  23. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/file_manager.py +0 -0
  24. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/logger.py +0 -0
  25. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/metering.py +0 -0
  26. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/socket.py +0 -0
  27. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/url_builder.py +0 -0
  28. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/internal/utils/validators.py +0 -0
  29. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/__init__.py +0 -0
  30. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/configuration_type.py +0 -0
  31. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/feature.py +0 -0
  32. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/property.py +0 -0
  33. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/rule.py +0 -0
  34. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/segment.py +0 -0
  35. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration/configurations/models/segment_rules.py +0 -0
  36. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration_python_sdk.egg-info/SOURCES.txt +0 -0
  37. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration_python_sdk.egg-info/dependency_links.txt +0 -0
  38. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/ibm_appconfiguration_python_sdk.egg-info/top_level.txt +0 -0
  39. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/integration_tests/__init__.py +0 -0
  40. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/integration_tests/test_integration.py +0 -0
  41. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/setup.cfg +0 -0
  42. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/__init__.py +0 -0
  43. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/__init__.py +0 -0
  44. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/__init__.py +0 -0
  45. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/test_feature.py +0 -0
  46. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/test_property.py +0 -0
  47. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/test_rule.py +0 -0
  48. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/test_segment.py +0 -0
  49. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/models/test_segment_rules.py +0 -0
  50. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/test_configuration_handler.py +0 -0
  51. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/__init__.py +0 -0
  52. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/test_api_manager.py +0 -0
  53. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/test_file_manager.py +0 -0
  54. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/test_metering.py +0 -0
  55. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/test_socket.py +0 -0
  56. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/configurations/utils/test_url_builder.py +0 -0
  57. {ibm_appconfiguration_python_sdk-0.3.4 → ibm_appconfiguration_python_sdk-0.3.6}/unit_tests/test_appconfiguration.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ibm-appconfiguration-python-sdk
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: IBM Cloud App Configuration Python SDK
5
5
  Home-page: https://github.com/IBM/appconfiguration-python-sdk
6
6
  Author: IBM
@@ -20,7 +20,7 @@ Requires-Dist: websocket-client<2.0.0,>=1.8.0
20
20
  Requires-Dist: ibm-cloud-sdk-core<4.0.0,>=3.20.3
21
21
  Requires-Dist: pyyaml>=5.4.1
22
22
  Requires-Dist: schema>=0.7.5
23
- Requires-Dist: mmh3==3.0.0
23
+ Requires-Dist: mmh3==5.0.1
24
24
 
25
25
  # IBM Cloud App Configuration Python server SDK
26
26
 
@@ -173,14 +173,14 @@ Use the `feature.get_current_value(entity_id=entity_id, entity_attributes=entity
173
173
  value of the feature flag. This method returns one of the Enabled/Disabled/Overridden value based on the evaluation. The
174
174
  data type of returned value matches that of feature flag.
175
175
 
176
- ```py
177
- entity_id = "john_doe"
178
- entity_attributes = {
179
- 'city': 'Bangalore',
180
- 'country': 'India'
181
- }
182
- feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
183
- ```
176
+ ```py
177
+ entity_id = "john_doe"
178
+ entity_attributes = {
179
+ 'city': 'Bangalore',
180
+ 'country': 'India'
181
+ }
182
+ feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
183
+ ```
184
184
 
185
185
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the feature is
186
186
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -214,14 +214,14 @@ Use the `property.get_current_value(entity_id=entity_id, entity_attributes=entit
214
214
  value of the property. This method returns the default property value or its overridden value based on the evaluation.
215
215
  The data type of returned value matches that of property.
216
216
 
217
- ```py
218
- entity_id = "john_doe"
219
- entity_attributes = {
217
+ ```py
218
+ entity_id = "john_doe"
219
+ entity_attributes = {
220
220
  'city': 'Bangalore',
221
221
  'country': 'India'
222
- }
223
- property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
224
- ```
222
+ }
223
+ property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
224
+ ```
225
225
 
226
226
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the property is
227
227
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -348,7 +348,6 @@ def configuration_update(self):
348
348
  # new_value = feature.get_current_value(entity_id, entity_attributes)
349
349
 
350
350
  appconfig_client.register_configuration_update_listener(configuration_update)
351
-
352
351
  ```
353
352
 
354
353
  ## Fetch latest data
@@ -149,14 +149,14 @@ Use the `feature.get_current_value(entity_id=entity_id, entity_attributes=entity
149
149
  value of the feature flag. This method returns one of the Enabled/Disabled/Overridden value based on the evaluation. The
150
150
  data type of returned value matches that of feature flag.
151
151
 
152
- ```py
153
- entity_id = "john_doe"
154
- entity_attributes = {
155
- 'city': 'Bangalore',
156
- 'country': 'India'
157
- }
158
- feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
159
- ```
152
+ ```py
153
+ entity_id = "john_doe"
154
+ entity_attributes = {
155
+ 'city': 'Bangalore',
156
+ 'country': 'India'
157
+ }
158
+ feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
159
+ ```
160
160
 
161
161
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the feature is
162
162
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -190,14 +190,14 @@ Use the `property.get_current_value(entity_id=entity_id, entity_attributes=entit
190
190
  value of the property. This method returns the default property value or its overridden value based on the evaluation.
191
191
  The data type of returned value matches that of property.
192
192
 
193
- ```py
194
- entity_id = "john_doe"
195
- entity_attributes = {
193
+ ```py
194
+ entity_id = "john_doe"
195
+ entity_attributes = {
196
196
  'city': 'Bangalore',
197
197
  'country': 'India'
198
- }
199
- property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
200
- ```
198
+ }
199
+ property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
200
+ ```
201
201
 
202
202
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the property is
203
203
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -324,7 +324,6 @@ def configuration_update(self):
324
324
  # new_value = feature.get_current_value(entity_id, entity_attributes)
325
325
 
326
326
  appconfig_client.register_configuration_update_listener(configuration_update)
327
-
328
327
  ```
329
328
 
330
329
  ## Fetch latest data
@@ -32,6 +32,14 @@ from .internal.utils.socket import Socket
32
32
  from .internal.utils.url_builder import URLBuilder
33
33
  from .internal.utils.connectivity import Connectivity
34
34
  from .internal.utils.api_manager import APIManager
35
+ import sys
36
+ from time import sleep
37
+
38
+ # Server max time out is assumed to be 1 week = 604800 seconds = 40320*15
39
+ sys.setrecursionlimit(40320)
40
+
41
+ # delay between each web socket connection retry
42
+ delay = 15
35
43
 
36
44
 
37
45
  class ConfigurationHandler:
@@ -62,7 +70,7 @@ class ConfigurationHandler:
62
70
  self.__segment_map = dict()
63
71
  self.__live_config_update_enabled = True
64
72
  ConfigurationHandler.__instance = self
65
- self.__retry_interval = 600
73
+ self.__retry_interval = 120
66
74
  self.__bootstrap_file = None
67
75
  self.__persistent_cache_dir = None
68
76
  self.__persistent_data = None
@@ -510,7 +518,7 @@ class ConfigurationHandler:
510
518
  Logger.error(f'error while while fetching {exception}')
511
519
  else:
512
520
  Logger.error(response.get_result())
513
- if status_code is None:
521
+ if status_code is None or status_code == 499:
514
522
  """
515
523
  status_code will be None in-case of
516
524
 
@@ -518,7 +526,7 @@ class ConfigurationHandler:
518
526
  Check api_manager.py for more info.
519
527
  2. request failed due to unknown "Exception".
520
528
  """
521
- Logger.info(config_messages.RETRY_AFTER_TEN_MINUTES)
529
+ Logger.info(config_messages.RETRY_AFTER_TWO_MINUTES)
522
530
  timer = Timer(self.__retry_interval, self.__fetch_from_api)
523
531
  timer.daemon = True
524
532
  timer.start()
@@ -534,12 +542,16 @@ class ConfigurationHandler:
534
542
  Logger.debug(f'Received message from socket. {message}')
535
543
  elif error_state:
536
544
  Logger.error(f'Received error from socket. {error_state}')
545
+ Logger.info('Reconnecting to server....')
546
+ self.__on_socket_retry = True
547
+ sleep(delay)
537
548
  self.__start_web_socket()
538
549
  elif closed_state:
539
550
  Logger.error('Received close connection from socket.')
540
- if self.__socket is not None:
541
- self.__on_socket_retry = True
542
- self.__start_web_socket()
551
+ Logger.info('Reconnecting to server....')
552
+ self.__on_socket_retry = True
553
+ sleep(delay)
554
+ self.__start_web_socket()
543
555
  elif open_state:
544
556
  if self.__on_socket_retry:
545
557
  self.__on_socket_retry = False
@@ -38,5 +38,5 @@ FEATURE_INVALID = "Invalid feature_id - "
38
38
  NO_INTERNET_CONNECTION_ERROR = 'No connection to internet. Please re-connect.'
39
39
  PROPERTY_INVALID = "Invalid property_id - "
40
40
  CONFIGURATIONS_FETCH_SUCCESS = "Successfully fetched the configurations."
41
- RETRY_AFTER_TEN_MINUTES = "Failed to fetch the configurations. Retrying after 10 minutes."
41
+ RETRY_AFTER_TWO_MINUTES = "Failed to fetch the configurations. Retrying after 2 minutes."
42
42
  INPUT_PARAMETER_NOT_BOOLEAN = "Input parameter passed to use_private_endpoint() method is not boolean. Default value will be used."
@@ -15,4 +15,4 @@
15
15
  """
16
16
  Version of ibm-appconfiguration-python-sdk
17
17
  """
18
- __version__ = '0.3.4'
18
+ __version__ = '0.3.6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ibm-appconfiguration-python-sdk
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: IBM Cloud App Configuration Python SDK
5
5
  Home-page: https://github.com/IBM/appconfiguration-python-sdk
6
6
  Author: IBM
@@ -20,7 +20,7 @@ Requires-Dist: websocket-client<2.0.0,>=1.8.0
20
20
  Requires-Dist: ibm-cloud-sdk-core<4.0.0,>=3.20.3
21
21
  Requires-Dist: pyyaml>=5.4.1
22
22
  Requires-Dist: schema>=0.7.5
23
- Requires-Dist: mmh3==3.0.0
23
+ Requires-Dist: mmh3==5.0.1
24
24
 
25
25
  # IBM Cloud App Configuration Python server SDK
26
26
 
@@ -173,14 +173,14 @@ Use the `feature.get_current_value(entity_id=entity_id, entity_attributes=entity
173
173
  value of the feature flag. This method returns one of the Enabled/Disabled/Overridden value based on the evaluation. The
174
174
  data type of returned value matches that of feature flag.
175
175
 
176
- ```py
177
- entity_id = "john_doe"
178
- entity_attributes = {
179
- 'city': 'Bangalore',
180
- 'country': 'India'
181
- }
182
- feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
183
- ```
176
+ ```py
177
+ entity_id = "john_doe"
178
+ entity_attributes = {
179
+ 'city': 'Bangalore',
180
+ 'country': 'India'
181
+ }
182
+ feature_value = feature.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
183
+ ```
184
184
 
185
185
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the feature is
186
186
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -214,14 +214,14 @@ Use the `property.get_current_value(entity_id=entity_id, entity_attributes=entit
214
214
  value of the property. This method returns the default property value or its overridden value based on the evaluation.
215
215
  The data type of returned value matches that of property.
216
216
 
217
- ```py
218
- entity_id = "john_doe"
219
- entity_attributes = {
217
+ ```py
218
+ entity_id = "john_doe"
219
+ entity_attributes = {
220
220
  'city': 'Bangalore',
221
221
  'country': 'India'
222
- }
223
- property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
224
- ```
222
+ }
223
+ property_value = property.get_current_value(entity_id=entity_id, entity_attributes=entity_attributes)
224
+ ```
225
225
 
226
226
  - entity_id: Id of the Entity. This will be a string identifier related to the Entity against which the property is
227
227
  evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that
@@ -348,7 +348,6 @@ def configuration_update(self):
348
348
  # new_value = feature.get_current_value(entity_id, entity_attributes)
349
349
 
350
350
  appconfig_client.register_configuration_update_listener(configuration_update)
351
-
352
351
  ```
353
352
 
354
353
  ## Fetch latest data
@@ -4,4 +4,4 @@ websocket-client<2.0.0,>=1.8.0
4
4
  ibm-cloud-sdk-core<4.0.0,>=3.20.3
5
5
  pyyaml>=5.4.1
6
6
  schema>=0.7.5
7
- mmh3==3.0.0
7
+ mmh3==5.0.1
@@ -12,7 +12,7 @@
12
12
  from setuptools import setup, find_packages
13
13
 
14
14
  NAME = "ibm-appconfiguration-python-sdk"
15
- VERSION = "0.3.4"
15
+ VERSION = "0.3.6"
16
16
  # To install the library, run the following
17
17
  #
18
18
  # python setup.py install
@@ -27,7 +27,7 @@ REQUIRES = [
27
27
  "ibm-cloud-sdk-core>=3.20.3,<4.0.0",
28
28
  "pyyaml>=5.4.1",
29
29
  "schema>=0.7.5",
30
- "mmh3==3.0.0"
30
+ "mmh3==5.0.1"
31
31
  ]
32
32
  with open("README.md", "r", encoding="utf-8") as fh:
33
33
  long_description = fh.read()