devcycle-python-server-sdk 3.4.1__py3-none-any.whl → 3.5.1__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.
@@ -1 +1 @@
1
- 3.4.1
1
+ 3.5.1
@@ -14,9 +14,9 @@ from devcycle_python_sdk.models.event import DevCycleEvent
14
14
  from devcycle_python_sdk.models.variable import Variable
15
15
  from devcycle_python_sdk.models.feature import Feature
16
16
  from devcycle_python_sdk.util.version import sdk_version
17
- from devcycle_python_sdk.openfeature.provider import DevCycleProvider
17
+ from devcycle_python_sdk.open_feature_provider.provider import DevCycleProvider
18
18
 
19
- from openfeature.provider.provider import AbstractProvider
19
+ from openfeature.provider import AbstractProvider
20
20
 
21
21
  logger = logging.getLogger(__name__)
22
22
 
@@ -4,7 +4,7 @@ from abc import abstractmethod
4
4
  from devcycle_python_sdk.models.user import DevCycleUser
5
5
  from devcycle_python_sdk.models.variable import Variable
6
6
 
7
- from openfeature.provider.provider import AbstractProvider
7
+ from openfeature.provider import AbstractProvider
8
8
 
9
9
 
10
10
  class AbstractDevCycleClient:
@@ -14,8 +14,8 @@ from devcycle_python_sdk.models.feature import Feature
14
14
  from devcycle_python_sdk.models.platform_data import default_platform_data
15
15
  from devcycle_python_sdk.models.user import DevCycleUser
16
16
  from devcycle_python_sdk.models.variable import Variable
17
- from devcycle_python_sdk.openfeature.provider import DevCycleProvider
18
- from openfeature.provider.provider import AbstractProvider
17
+ from devcycle_python_sdk.open_feature_provider.provider import DevCycleProvider
18
+ from openfeature.provider import AbstractProvider
19
19
 
20
20
  logger = logging.getLogger(__name__)
21
21
 
@@ -55,14 +55,16 @@ class OptInSettings:
55
55
  class ProjectSettings:
56
56
  edge_db: Optional[EdgeDBSettings]
57
57
  opt_in: Optional[OptInSettings]
58
+ disable_passthrough_rollouts: Optional[bool]
58
59
 
59
60
  @classmethod
60
61
  def from_json(cls, data: dict) -> "ProjectSettings":
61
62
  return cls(
62
- edge_db=EdgeDBSettings.from_json(data["edgeDB"])
63
- if "edgeDB" in data
64
- else None,
63
+ edge_db=(
64
+ EdgeDBSettings.from_json(data["edgeDB"]) if "edgeDB" in data else None
65
+ ),
65
66
  opt_in=OptInSettings.from_json(data["optIn"]) if "optIn" in data else None,
67
+ disable_passthrough_rollouts=data.get("disablePassthroughRollouts", False),
66
68
  )
67
69
 
68
70
 
@@ -79,9 +81,11 @@ class Project:
79
81
  id=data["_id"],
80
82
  key=data["key"],
81
83
  a0_organization=data["a0_organization"],
82
- settings=ProjectSettings.from_json(data["settings"])
83
- if "settings" in data
84
- else None,
84
+ settings=(
85
+ ProjectSettings.from_json(data["settings"])
86
+ if "settings" in data
87
+ else None
88
+ ),
85
89
  )
86
90
 
87
91
 
@@ -94,7 +94,9 @@ class DevCycleUser:
94
94
  )
95
95
 
96
96
  @staticmethod
97
- def create_user_from_context(context: EvaluationContext) -> "DevCycleUser":
97
+ def create_user_from_context(
98
+ context: Optional[EvaluationContext],
99
+ ) -> "DevCycleUser":
98
100
  """
99
101
  Builds a DevCycleUser instance from the evaluation context. Will raise a TargetingKeyMissingError if
100
102
  the context does not contain a valid targeting key or user_id attribute
@@ -5,7 +5,7 @@ from typing import Any, Optional, Union, List
5
5
  from devcycle_python_sdk import AbstractDevCycleClient
6
6
  from devcycle_python_sdk.models.user import DevCycleUser
7
7
 
8
- from openfeature.provider.provider import AbstractProvider
8
+ from openfeature.provider import AbstractProvider
9
9
  from openfeature.evaluation_context import EvaluationContext
10
10
  from openfeature.flag_evaluation import FlagResolutionDetails, Reason
11
11
  from openfeature.exception import ErrorCode, InvalidContextError, TypeMismatchError
@@ -58,9 +58,11 @@ class DevCycleProvider(AbstractProvider):
58
58
  else:
59
59
  return FlagResolutionDetails(
60
60
  value=variable.value,
61
- reason=Reason.DEFAULT
62
- if variable.isDefaulted
63
- else Reason.TARGETING_MATCH,
61
+ reason=(
62
+ Reason.DEFAULT
63
+ if variable.isDefaulted
64
+ else Reason.TARGETING_MATCH
65
+ ),
64
66
  )
65
67
  except ValueError as e:
66
68
  # occurs if the key or default value is None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: devcycle-python-server-sdk
3
- Version: 3.4.1
3
+ Version: 3.5.1
4
4
  Summary: DevCycle Python SDK
5
5
  Home-page: https://github.com/devcycleHQ/python-server-sdk
6
6
  Author: UNKNOWN
@@ -10,10 +10,10 @@ Keywords: DevCycle
10
10
  Platform: UNKNOWN
11
11
  Requires-Dist: setuptools >=21.0.0
12
12
  Requires-Dist: urllib3 >=1.15.1
13
- Requires-Dist: requests ~=2.31.0
13
+ Requires-Dist: requests ~=2.31
14
14
  Requires-Dist: wasmtime ==9.0.0
15
15
  Requires-Dist: protobuf >=4.23.3
16
- Requires-Dist: openfeature-sdk >=0.3.1
16
+ Requires-Dist: openfeature-sdk >=0.7.0
17
17
 
18
18
  The DevCycle Python SDK used for feature management.
19
19
 
@@ -1,10 +1,10 @@
1
- devcycle_python_sdk/VERSION.txt,sha256=zHFPXgIkp4MR9INen7uI5pujX2Xn3Vy32GyrtKhLvXI,6
1
+ devcycle_python_sdk/VERSION.txt,sha256=60H4bD1nKZtGSQzeEBWKUhFI_cA2QaoUqT-ieXvs14w,6
2
2
  devcycle_python_sdk/__init__.py,sha256=30TcYb9PbvVi97gwk16omCGG1UoUI9lmmU7xpvxNMvc,336
3
- devcycle_python_sdk/bucketing-lib.release.wasm,sha256=qbaUme7XJuFIJBdQjKhKm0gcUUyRgA3T55rThefe2kg,201773
4
- devcycle_python_sdk/cloud_client.py,sha256=ZzJ4JWN5bLECOIm96a36V1liWq7Yl8uaN-vWcRQ1m5U,7351
5
- devcycle_python_sdk/devcycle_client.py,sha256=8Ue_lHzJuqAeqpAlWJooEmBQvAX2XkqBK8jpMeWAjMU,926
3
+ devcycle_python_sdk/bucketing-lib.release.wasm,sha256=yrNDrAxZS1h9VlTzsdOrNLP4ngnM04PmKxcWop1yrt4,202623
4
+ devcycle_python_sdk/cloud_client.py,sha256=UMfXvXwO4v3pZW9ZA52ivxPH1Lp4Goy5gpV_s0qCpxQ,7352
5
+ devcycle_python_sdk/devcycle_client.py,sha256=W5MeOslkXjTqZtoSy_Bbbug8gVoicjxshpKjDteEr6E,917
6
6
  devcycle_python_sdk/exceptions.py,sha256=Et7fS8pEFbHkFY86T2pJoEUstwjh4_rzhJxVH8fzAns,1053
7
- devcycle_python_sdk/local_client.py,sha256=tCJpDiA83IDz43YXR_vjLFsfU9qRM-kgUbNiJ7vNiBI,9372
7
+ devcycle_python_sdk/local_client.py,sha256=5PFEUmBs-QsgaiXWBQfhhjcN2TbB64JH3iVwpJteG7o,9373
8
8
  devcycle_python_sdk/options.py,sha256=Ejr6HbdyqzZajFVkEqWLk5XLfdtqCIkvsyWaRt_lgwU,4575
9
9
  devcycle_python_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  devcycle_python_sdk/api/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
@@ -17,15 +17,15 @@ devcycle_python_sdk/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
17
17
  devcycle_python_sdk/managers/config_manager.py,sha256=_-1kWwyyAcwVF_DibXjnehXi3Qj6HR8orYfgNfgWJOc,3248
18
18
  devcycle_python_sdk/managers/event_queue_manager.py,sha256=06TcdlRoB89C7vGH1UTnnoDFsSnT71tPwf0gn1NK-W0,8071
19
19
  devcycle_python_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- devcycle_python_sdk/models/bucketed_config.py,sha256=rSKpxMTF-IbUVQ9gAWrWnb9Q9YF94ATqEFWNWuoQntk,3814
20
+ devcycle_python_sdk/models/bucketed_config.py,sha256=NsdT-6RbEuDy5QuK5qlr6UqNKQQnwjoXVYN-uQp0P-E,3999
21
21
  devcycle_python_sdk/models/error_response.py,sha256=r_dRUDAbral9UGaMYcnBsZOr9Hmkyi1SQbhGmZilgpA,442
22
22
  devcycle_python_sdk/models/event.py,sha256=-6bhKp72mAgaoSxvhS__G4vvfQ9Psj83fc0Igelzw3o,3713
23
23
  devcycle_python_sdk/models/feature.py,sha256=m3wxxIjC5jxhKpPLI4RcsBaNLuy-zsMqoAgc8ySPe0I,852
24
24
  devcycle_python_sdk/models/platform_data.py,sha256=kIFevH5trsxI32qp7BW6glUCpipgpaVBKGqJWzQd5Xo,783
25
- devcycle_python_sdk/models/user.py,sha256=XrbVUXvlqVPlb3-pOyDi11oGb0sRUYgI2VBIqD_jGWU,6241
25
+ devcycle_python_sdk/models/user.py,sha256=57d_n8Yy8g-zsGzVF0hmSf4McPtFPJJ0LLY_ql75FWk,6266
26
26
  devcycle_python_sdk/models/variable.py,sha256=qp00SyCNyfYiMlTwnDSDJ4ZetRF35JHTbYZQOBxFIqY,1711
27
- devcycle_python_sdk/openfeature/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- devcycle_python_sdk/openfeature/provider.py,sha256=0oz3WzUaucl0_bXc4O2CUncZdfl2wkB0wnp8qUlmLEI,4484
27
+ devcycle_python_sdk/open_feature_provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
+ devcycle_python_sdk/open_feature_provider/provider.py,sha256=VjUMhCYiMLixXUSSIjQ7kVCQrls1QD_Nltooe5EjGks,4539
29
29
  devcycle_python_sdk/protobuf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  devcycle_python_sdk/protobuf/utils.py,sha256=zi-kVx6yvgS2c04cUobLd2IDc_ZqKkWduay9YcpjoGc,4684
31
31
  devcycle_python_sdk/protobuf/variableForUserParams_pb2.py,sha256=Zf4-8n67UnulC0Sz90aqLYsXCFEgywOqfiSHuXZomLk,4244
@@ -34,7 +34,7 @@ devcycle_python_sdk/util/strings.py,sha256=gH0Xm3gIXNqn6hczKPk10Jn5_9knuD7OB5MrB
34
34
  devcycle_python_sdk/util/version.py,sha256=Cz7Us_EuXP-T8GI47g2WHYdBJj_zKo-5y545IDHJAjI,253
35
35
  example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  example/cloud_client_example.py,sha256=YD8ZsTv3dPYfbFUKraRpRT0VsJGrPwjm8ZCuA5H54yI,2463
37
- example/local_bucketing_client_example.py,sha256=zSJsllQ5aSvUTj-VFvt0w7pVTMRW6z-gTj9R7ZNPlyE,2797
37
+ example/local_bucketing_client_example.py,sha256=TaIfy3VnW9fXii9NPYs5UOuP4fLKruXMjnZApveqzl4,2796
38
38
  example/openfeature_example.py,sha256=kO6F-Xk20l6CPiMfIxSRreshEGmHMFHRg3zbeLXa3AI,2410
39
39
  test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  test/test_cloud_client.py,sha256=zjk302m7qKMCQryolkc1WKLFmbGWUxA0VtHlZk0rY-0,11442
@@ -43,7 +43,7 @@ test/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  test/api/test_bucketing_client.py,sha256=M2mjACowLvbsIjXdP-w8-fwY02xqv1X1r_h9v-pXa7A,7739
44
44
  test/api/test_config_client.py,sha256=oZMBlXGw4UHb5-rSNF_ARTrAjvbvkbFgb8GAK4ExR14,4413
45
45
  test/api/test_event_client.py,sha256=v4Xoum-PdywfczrfMV1llM5vrIJoqHybzxPLVokh09g,3310
46
- test/api/test_local_bucketing.py,sha256=xbv4rsZWB5iTg3ZBuZVgI3vZoRVU0A78ZuU3ng6FjEY,15631
46
+ test/api/test_local_bucketing.py,sha256=lPL3ThZcGG-8-67jFxRvGrwL8NB6-sM5qGJb0p2O__Q,15254
47
47
  test/fixture/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  test/fixture/data.py,sha256=6ReLxWPMhCDbJ5Ex24_iR0PJNjKzPFV1I9j_v0FVbBU,1462
49
49
  test/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -51,16 +51,16 @@ test/managers/test_config_manager.py,sha256=_MtvyxK06xpBzzEsN1zsLdYrk3DsPsbCmSj7
51
51
  test/managers/test_event_queue_manager.py,sha256=KquHBuYiDdoVStm5Ga9mIB-wvmJnChiFRBNC8sMKaxQ,11053
52
52
  test/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  test/models/test_bucketed_config.py,sha256=8wCEyxaHxY21nl7ZbiFzp-IzZQBZIPIVPPzeREjumQk,858
54
- test/models/test_user.py,sha256=deBYiGymYSgkeVpXcBP1x2XfjGSDsX4lHR6FV2FvtGk,6745
55
- test/openfeature/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- test/openfeature/test_provider.py,sha256=rzpfSoGcKkwin2GIu9kkCO-yohuO5kvJl0olVC6Akuc,7652
57
- test/openfeature/test_provider_local_sdk.py,sha256=CVMt0WFQGbVtW3qFm2Gi_FfwlbYVZ2yJx33vnuXVfU0,4435
54
+ test/models/test_user.py,sha256=ZNTBSKLDrqrsqZuaw5AHtc_FW4empSTaeNPZHZaFlI4,6736
55
+ test/openfeature_test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ test/openfeature_test/test_provider.py,sha256=UPxAD5e7NvpIhmqNFCrTY_yrKrMyYxBc2xuMAgdSGvw,7653
57
+ test/openfeature_test/test_provider_local_sdk.py,sha256=5NjfUDalW4F7Oe8n1740VO7l5OIBEOldnSryM98uO2w,4426
58
58
  test/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  test/util/test_strings.py,sha256=T5H5U0af7_ld1yJC8IdDmay_Mx-iJQ5Fi5fbvKcAc7A,862
60
60
  test/util/test_utils.py,sha256=tVBJm_qnqg-4PssLpXIxqlk0JehuiAIPs4zpi2oNVnY,6671
61
61
  test/util/test_version.py,sha256=3Xg0_84m0bdHXz6pxd2Z85Oz9DoUC1T0Ol_WqEH_jac,335
62
- devcycle_python_server_sdk-3.4.1.dist-info/LICENSE,sha256=tHQMqu-Jic2UpMGqb-vNFbGygysl8IG4l1clnnh0OFo,1071
63
- devcycle_python_server_sdk-3.4.1.dist-info/METADATA,sha256=YyTRHrcAsPW_5AlilC6d0pEevp0Ax-tRNy4b2Ny4fb4,510
64
- devcycle_python_server_sdk-3.4.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
65
- devcycle_python_server_sdk-3.4.1.dist-info/top_level.txt,sha256=34f8zDzihAHoH7siAFlmscyO_QLNWWq9HApFlwtYL4k,33
66
- devcycle_python_server_sdk-3.4.1.dist-info/RECORD,,
62
+ devcycle_python_server_sdk-3.5.1.dist-info/LICENSE,sha256=tHQMqu-Jic2UpMGqb-vNFbGygysl8IG4l1clnnh0OFo,1071
63
+ devcycle_python_server_sdk-3.5.1.dist-info/METADATA,sha256=PS7S5CVN27W5_HuluZwNfRekWMdcgP8MbMTcZPXTiSs,508
64
+ devcycle_python_server_sdk-3.5.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
65
+ devcycle_python_server_sdk-3.5.1.dist-info/top_level.txt,sha256=34f8zDzihAHoH7siAFlmscyO_QLNWWq9HApFlwtYL4k,33
66
+ devcycle_python_server_sdk-3.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -7,7 +7,7 @@ from devcycle_python_sdk import DevCycleLocalClient, DevCycleLocalOptions
7
7
  from devcycle_python_sdk.models.user import DevCycleUser
8
8
  from devcycle_python_sdk.models.event import DevCycleEvent, EventType
9
9
 
10
- VARIABLE_KEY = "test-boolean-variable"
10
+ VARIABLE_KEY = "python-example-tests"
11
11
 
12
12
  logger = logging.getLogger(__name__)
13
13
 
@@ -5,10 +5,7 @@ import unittest
5
5
  from devcycle_python_sdk.api.local_bucketing import LocalBucketing, WASMAbortError
6
6
  from devcycle_python_sdk.models.bucketed_config import (
7
7
  Environment,
8
- EdgeDBSettings,
9
8
  FeatureVariation,
10
- OptInColors,
11
- OptInSettings,
12
9
  Project,
13
10
  ProjectSettings,
14
11
  )
@@ -211,22 +208,15 @@ class LocalBucketingTest(unittest.TestCase):
211
208
  self.assertIsNotNone(result)
212
209
  self.assertEqual(result.user, user)
213
210
  self.assertEqual(
214
- result.project,
215
211
  Project(
216
212
  id="61f97628ff4afcb6d057dbf0",
217
213
  key="emma-project",
218
214
  a0_organization="org_tPyJN5dvNNirKar7",
219
215
  settings=ProjectSettings(
220
- edge_db=EdgeDBSettings(enabled=False),
221
- opt_in=OptInSettings(
222
- enabled=True,
223
- title="EarlyAccess",
224
- description="Getearlyaccesstobetafeaturesbelow!",
225
- image_url="",
226
- colors=OptInColors(primary="#531cd9", secondary="#16dec0"),
227
- ),
216
+ edge_db=None, opt_in=None, disable_passthrough_rollouts=False
228
217
  ),
229
218
  ),
219
+ result.project,
230
220
  )
231
221
  self.assertEqual(
232
222
  result.environment,
test/models/test_user.py CHANGED
@@ -3,7 +3,7 @@ import unittest
3
3
 
4
4
  from devcycle_python_sdk.models.user import DevCycleUser
5
5
 
6
- from openfeature.provider.provider import EvaluationContext
6
+ from openfeature.provider import EvaluationContext
7
7
  from openfeature.exception import TargetingKeyMissingError, InvalidContextError
8
8
 
9
9
 
@@ -2,7 +2,7 @@ import logging
2
2
  import unittest
3
3
  from unittest.mock import MagicMock
4
4
 
5
- from openfeature.provider.provider import EvaluationContext
5
+ from openfeature.provider import EvaluationContext
6
6
  from openfeature.flag_evaluation import Reason
7
7
  from openfeature.exception import (
8
8
  ErrorCode,
@@ -13,7 +13,7 @@ from openfeature.exception import (
13
13
 
14
14
  from devcycle_python_sdk.models.variable import Variable, TypeEnum
15
15
 
16
- from devcycle_python_sdk.openfeature.provider import (
16
+ from devcycle_python_sdk.open_feature_provider.provider import (
17
17
  DevCycleProvider,
18
18
  )
19
19
 
@@ -7,7 +7,7 @@ import responses
7
7
  from devcycle_python_sdk import DevCycleLocalClient, DevCycleLocalOptions
8
8
  from test.fixture.data import small_config_json
9
9
 
10
- from openfeature.provider.provider import EvaluationContext
10
+ from openfeature.provider import EvaluationContext
11
11
  from openfeature.flag_evaluation import Reason
12
12
 
13
13
  logger = logging.getLogger(__name__)
File without changes