openfeature-provider-flagd 0.1.4__tar.gz → 0.2.0__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 (99) hide show
  1. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/.gitignore +3 -0
  2. openfeature_provider_flagd-0.2.0/CHANGELOG.md +118 -0
  3. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/LICENSE +1 -1
  4. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/PKG-INFO +132 -14
  5. openfeature_provider_flagd-0.2.0/README.md +148 -0
  6. openfeature_provider_flagd-0.2.0/pyproject.toml +136 -0
  7. openfeature_provider_flagd-0.2.0/pytest.ini +22 -0
  8. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/config.py +229 -0
  9. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/provider.py +186 -0
  10. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/__init__.py +5 -0
  11. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/grpc.py +354 -0
  12. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/in_process.py +131 -0
  13. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py +11 -0
  14. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py +106 -0
  15. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py +192 -0
  16. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/custom_ops.py +165 -0
  17. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py +95 -0
  18. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/process/targeting.py +35 -0
  19. openfeature_provider_flagd-0.2.0/src/openfeature/contrib/provider/flagd/resolvers/protocol.py +47 -0
  20. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.py +72 -0
  21. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2.pyi +450 -0
  22. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.py +358 -0
  23. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/evaluation/v1/evaluation_pb2_grpc.pyi +155 -0
  24. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.py +50 -0
  25. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2.pyi +148 -0
  26. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.py +186 -0
  27. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/flagd/sync/v1/sync_pb2_grpc.pyi +86 -0
  28. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/schema/v1/schema_pb2.py +72 -0
  29. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/schema/v1/schema_pb2.pyi +451 -0
  30. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.py +358 -0
  31. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/schema/v1/schema_pb2_grpc.pyi +156 -0
  32. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/sync/v1/sync_service_pb2.py +47 -0
  33. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/sync/v1/sync_service_pb2.pyi +174 -0
  34. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.py +143 -0
  35. openfeature_provider_flagd-0.2.0/src/openfeature/schemas/protobuf/sync/v1/sync_service_pb2_grpc.pyi +70 -0
  36. openfeature_provider_flagd-0.2.0/tests/conftest.py +23 -0
  37. openfeature_provider_flagd-0.2.0/tests/e2e/__init__.py +0 -0
  38. openfeature_provider_flagd-0.2.0/tests/e2e/conftest.py +9 -0
  39. openfeature_provider_flagd-0.2.0/tests/e2e/file/__init__.py +0 -0
  40. openfeature_provider_flagd-0.2.0/tests/e2e/file/conftest.py +27 -0
  41. openfeature_provider_flagd-0.2.0/tests/e2e/file/test_flaqd.py +5 -0
  42. openfeature_provider_flagd-0.2.0/tests/e2e/flagd_container.py +82 -0
  43. openfeature_provider_flagd-0.2.0/tests/e2e/inprocess/__init__.py +0 -0
  44. openfeature_provider_flagd-0.2.0/tests/e2e/inprocess/conftest.py +19 -0
  45. openfeature_provider_flagd-0.2.0/tests/e2e/inprocess/test_flaqd.py +5 -0
  46. openfeature_provider_flagd-0.2.0/tests/e2e/parsers.py +7 -0
  47. openfeature_provider_flagd-0.2.0/tests/e2e/paths.py +2 -0
  48. openfeature_provider_flagd-0.2.0/tests/e2e/rpc/__init__.py +0 -0
  49. openfeature_provider_flagd-0.2.0/tests/e2e/rpc/conftest.py +19 -0
  50. openfeature_provider_flagd-0.2.0/tests/e2e/rpc/test_flaqd.py +5 -0
  51. openfeature_provider_flagd-0.2.0/tests/e2e/step/_utils.py +30 -0
  52. openfeature_provider_flagd-0.2.0/tests/e2e/step/config_steps.py +107 -0
  53. openfeature_provider_flagd-0.2.0/tests/e2e/step/context_steps.py +73 -0
  54. openfeature_provider_flagd-0.2.0/tests/e2e/step/event_steps.py +90 -0
  55. openfeature_provider_flagd-0.2.0/tests/e2e/step/flag_step.py +96 -0
  56. openfeature_provider_flagd-0.2.0/tests/e2e/step/provider_steps.py +141 -0
  57. openfeature_provider_flagd-0.2.0/tests/e2e/testfilter.py +125 -0
  58. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-broken-default.json +13 -0
  59. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-broken-state.json +13 -0
  60. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-broken-targeting.json +15 -0
  61. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-broken-variants.json +15 -0
  62. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-disabled.json +13 -0
  63. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-invalid.not-json +13 -0
  64. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-no-state.json +12 -0
  65. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-wrong-structure.json +11 -0
  66. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag-wrong-variant.json +12 -0
  67. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag.json +13 -0
  68. openfeature_provider_flagd-0.2.0/tests/flags/basic-flag.yaml +8 -0
  69. openfeature_provider_flagd-0.2.0/tests/flags/invalid-fractional-args-wrong-content.json +16 -0
  70. openfeature_provider_flagd-0.2.0/tests/flags/invalid-fractional-args.json +16 -0
  71. openfeature_provider_flagd-0.2.0/tests/flags/invalid-fractional-weights-strings.json +19 -0
  72. openfeature_provider_flagd-0.2.0/tests/flags/invalid-fractional-weights.json +19 -0
  73. openfeature_provider_flagd-0.2.0/tests/flags/invalid-semver-args.json +16 -0
  74. openfeature_provider_flagd-0.2.0/tests/flags/invalid-semver-op.json +16 -0
  75. openfeature_provider_flagd-0.2.0/tests/flags/invalid-stringcomp-args.json +16 -0
  76. openfeature_provider_flagd-0.2.0/tests/test_config.py +149 -0
  77. openfeature_provider_flagd-0.2.0/tests/test_errors.py +112 -0
  78. openfeature_provider_flagd-0.2.0/tests/test_file_store.py +46 -0
  79. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/tests/test_flagd.py +1 -1
  80. openfeature_provider_flagd-0.2.0/tests/test_targeting.py +262 -0
  81. openfeature_provider_flagd-0.1.4/CHANGELOG.md +0 -53
  82. openfeature_provider_flagd-0.1.4/README.md +0 -35
  83. openfeature_provider_flagd-0.1.4/pyproject.toml +0 -64
  84. openfeature_provider_flagd-0.1.4/scripts/gen_protos.sh +0 -10
  85. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/config.py +0 -35
  86. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py +0 -62
  87. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py +0 -267
  88. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py +0 -40
  89. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py +0 -135
  90. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py +0 -62
  91. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py +0 -267
  92. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py +0 -37
  93. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py +0 -102
  94. openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/provider.py +0 -194
  95. openfeature_provider_flagd-0.1.4/tests/conftest.py +0 -10
  96. openfeature_provider_flagd-0.1.4/tests/test_config.py +0 -29
  97. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/src/openfeature/contrib/provider/flagd/__init__.py +0 -0
  98. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/src/openfeature/contrib/provider/flagd/flag_type.py +0 -0
  99. {openfeature_provider_flagd-0.1.4 → openfeature_provider_flagd-0.2.0}/tests/__init__.py +0 -0
@@ -51,3 +51,6 @@ docs/_build/
51
51
 
52
52
  # Virtual env directories
53
53
  .venv
54
+
55
+ # vscode
56
+ .vscode/
@@ -0,0 +1,118 @@
1
+ # Changelog
2
+
3
+ ## [0.2.0](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.5...openfeature-provider-flagd/v0.2.0) (2025-02-18)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * drop Python 3.8 support ([#187](https://github.com/open-feature/python-sdk-contrib/issues/187))
9
+ * **flagd-rpc:** add events for rpc mode, some breaking config fixes ([#108](https://github.com/open-feature/python-sdk-contrib/issues/108))
10
+
11
+ ### 🐛 Bug Fixes
12
+
13
+ * **flagd:** fix semver version parsing to allow "v" prefix([#106](https://github.com/open-feature/python-sdk-contrib/issues/106)) ([#107](https://github.com/open-feature/python-sdk-contrib/issues/107)) ([93fee85](https://github.com/open-feature/python-sdk-contrib/commit/93fee8593c8c278dff6371b68b21366bea9d5f01))
14
+ * **flagd:** improve targeting and fix fractional issue([#92](https://github.com/open-feature/python-sdk-contrib/issues/92)) ([#105](https://github.com/open-feature/python-sdk-contrib/issues/105)) ([eb31b83](https://github.com/open-feature/python-sdk-contrib/commit/eb31b8324662df113cd27205eb12f09a1cf30b06))
15
+ * object resolution for RPC and Object types, add test-harness ([ca76802](https://github.com/open-feature/python-sdk-contrib/commit/ca7680242085fb9b77d9b0844147468544010074))
16
+ * object resolution for RPC and Object types, add test-harness. ([#103](https://github.com/open-feature/python-sdk-contrib/issues/103)) ([ca76802](https://github.com/open-feature/python-sdk-contrib/commit/ca7680242085fb9b77d9b0844147468544010074))
17
+ * remove modifications to license files ([#81](https://github.com/open-feature/python-sdk-contrib/issues/81)) ([a23f61e](https://github.com/open-feature/python-sdk-contrib/commit/a23f61e1c14c70e45a4bce4a014d5599813f1d28))
18
+
19
+
20
+ ### ✨ New Features
21
+
22
+ * attempts with connection improvements ([#118](https://github.com/open-feature/python-sdk-contrib/issues/118)) ([8e23a70](https://github.com/open-feature/python-sdk-contrib/commit/8e23a700244a85291671b41083b1be82670cf79d))
23
+ * Change fractional custom op from percentage-based to relative weighting. ([#91](https://github.com/open-feature/python-sdk-contrib/issues/91)) ([7b34822](https://github.com/open-feature/python-sdk-contrib/commit/7b34822afdabfb89e991ae81a91681cafcbdfbd3))
24
+ * **flagd-rpc:** add caching ([#110](https://github.com/open-feature/python-sdk-contrib/issues/110)) ([16179e3](https://github.com/open-feature/python-sdk-contrib/commit/16179e3e68eb5bc18b5d12ec80caf511b7dec762))
25
+ * **flagd-rpc:** add events for rpc mode, some breaking config fixes ([#108](https://github.com/open-feature/python-sdk-contrib/issues/108)) ([b62d3d1](https://github.com/open-feature/python-sdk-contrib/commit/b62d3d1ab5ce40f275e795ae2682ae3fe315f431))
26
+ * **flagd-rpc:** adding grace attempts ([#117](https://github.com/open-feature/python-sdk-contrib/issues/117)) ([41d0ad8](https://github.com/open-feature/python-sdk-contrib/commit/41d0ad8b6a5b32272c75684cfcbabffb57e53470))
27
+ * **flagd:** add custom cert path ([#131](https://github.com/open-feature/python-sdk-contrib/issues/131)) ([f50351a](https://github.com/open-feature/python-sdk-contrib/commit/f50351a0435064111fb98753a49139fafa8307e6))
28
+ * **flagd:** Add in-process evaluator ([#104](https://github.com/open-feature/python-sdk-contrib/issues/104)) ([01285e7](https://github.com/open-feature/python-sdk-contrib/commit/01285e726baa3acbf1b5d6ed0e802be54342a6d9))
29
+ * **flagd:** add ssl cert path option ([f50351a](https://github.com/open-feature/python-sdk-contrib/commit/f50351a0435064111fb98753a49139fafa8307e6))
30
+ * **flagd:** migrate to new provider mode file and update e2e tests ([#121](https://github.com/open-feature/python-sdk-contrib/issues/121)) ([eed1ee0](https://github.com/open-feature/python-sdk-contrib/commit/eed1ee053191ecaca21f82749da9fe443712206f))
31
+ * **flagd:** use test-harness version number for integration tests ([#120](https://github.com/open-feature/python-sdk-contrib/issues/120)) ([3c3e9c8](https://github.com/open-feature/python-sdk-contrib/commit/3c3e9c86e7111fc165eebd650453069a0e8f4dae))
32
+
33
+
34
+ ### 🧹 Chore
35
+
36
+ * **deps:** update dependency grpcio-health-checking to v1.68.1 ([#125](https://github.com/open-feature/python-sdk-contrib/issues/125)) ([4e75a36](https://github.com/open-feature/python-sdk-contrib/commit/4e75a366468ab0f588031587a7224d16ae6cd0c6))
37
+ * **deps:** update dependency grpcio-health-checking to v1.69.0 ([#147](https://github.com/open-feature/python-sdk-contrib/issues/147)) ([905b42b](https://github.com/open-feature/python-sdk-contrib/commit/905b42b6e654c86c9161f02d87a812ad4ac42bed))
38
+ * **deps:** update dependency grpcio-health-checking to v1.70.0 ([#168](https://github.com/open-feature/python-sdk-contrib/issues/168)) ([06a9b58](https://github.com/open-feature/python-sdk-contrib/commit/06a9b5880093680575422e3e16d14a81f2cd7bef))
39
+ * **deps:** update dependency providers/openfeature-provider-flagd/openfeature/test-harness to v0.5.21 ([#145](https://github.com/open-feature/python-sdk-contrib/issues/145)) ([1495263](https://github.com/open-feature/python-sdk-contrib/commit/149526337c5fd9948e10a1e3aab0176f2d1e7c8b))
40
+ * **deps:** update dependency providers/openfeature-provider-flagd/openfeature/test-harness to v2 ([#178](https://github.com/open-feature/python-sdk-contrib/issues/178)) ([ce16a54](https://github.com/open-feature/python-sdk-contrib/commit/ce16a5406e7e2d36fabe1ebe704f3a528e72027f))
41
+ * **deps:** update dependency providers/openfeature-provider-flagd/openfeature/test-harness to v2.2.0 ([#190](https://github.com/open-feature/python-sdk-contrib/issues/190)) ([9db9ad6](https://github.com/open-feature/python-sdk-contrib/commit/9db9ad62445deae3bb50505cb9d6a902d3234d34))
42
+ * **deps:** update pre-commit hook astral-sh/ruff-pre-commit to v0.9.0 ([#149](https://github.com/open-feature/python-sdk-contrib/issues/149)) ([24b11e1](https://github.com/open-feature/python-sdk-contrib/commit/24b11e14599251a47d70ee5b4080a326206f85a6))
43
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/schemas digest to 76d611f ([#138](https://github.com/open-feature/python-sdk-contrib/issues/138)) ([853ece7](https://github.com/open-feature/python-sdk-contrib/commit/853ece72feb558b208cad5680c358c4b09aabf91))
44
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/schemas digest to b81a56e ([#134](https://github.com/open-feature/python-sdk-contrib/issues/134)) ([a2a0ba0](https://github.com/open-feature/python-sdk-contrib/commit/a2a0ba0d9a59c763829fa630fdc2f28b93b2f037))
45
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to 54952f3 ([#188](https://github.com/open-feature/python-sdk-contrib/issues/188)) ([d88b29a](https://github.com/open-feature/python-sdk-contrib/commit/d88b29a01b14d411027007395e6de881602e91a1))
46
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to 5b07065 ([#171](https://github.com/open-feature/python-sdk-contrib/issues/171)) ([6f45c15](https://github.com/open-feature/python-sdk-contrib/commit/6f45c15b4da2a404cc0583fa3c4f8d22de13fad1))
47
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to 6c673d7 ([#151](https://github.com/open-feature/python-sdk-contrib/issues/151)) ([1c2c650](https://github.com/open-feature/python-sdk-contrib/commit/1c2c650bd7f0f5b5953bbb3948c3d657172e46ff))
48
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to 8d6eeb3 ([#177](https://github.com/open-feature/python-sdk-contrib/issues/177)) ([02dcfc0](https://github.com/open-feature/python-sdk-contrib/commit/02dcfc02089f3a0a3f300e3a2485e9f847ff765e))
49
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to 95fe981 ([#184](https://github.com/open-feature/python-sdk-contrib/issues/184)) ([f1fb247](https://github.com/open-feature/python-sdk-contrib/commit/f1fb2477f61a1a37ecfcbd858a80bdfac277340b))
50
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to a69f748 ([#193](https://github.com/open-feature/python-sdk-contrib/issues/193)) ([4251f36](https://github.com/open-feature/python-sdk-contrib/commit/4251f36d8ac1fbb70e44a87bea3b2755bcf09ecf))
51
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to be56f22 ([#186](https://github.com/open-feature/python-sdk-contrib/issues/186)) ([a15d5a2](https://github.com/open-feature/python-sdk-contrib/commit/a15d5a230e5a7d5a66a2cce4341f312bf98a3503))
52
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to d261f68 ([#140](https://github.com/open-feature/python-sdk-contrib/issues/140)) ([6801522](https://github.com/open-feature/python-sdk-contrib/commit/68015220ea9005286c0a45d4cdeb3891d9f43b3b))
53
+ * **deps:** update providers/openfeature-provider-flagd/openfeature/spec digest to ed0f9ef ([#135](https://github.com/open-feature/python-sdk-contrib/issues/135)) ([bee9205](https://github.com/open-feature/python-sdk-contrib/commit/bee9205d475473b5005fbbea9b4b5c756ad1d20e))
54
+ * drop Python 3.8 support ([#187](https://github.com/open-feature/python-sdk-contrib/issues/187)) ([b55cc1e](https://github.com/open-feature/python-sdk-contrib/commit/b55cc1e0f823d05a330c12af6861dbd3bec69c3a))
55
+
56
+
57
+ ### 🔄 Refactoring
58
+
59
+ * replace typing_extensions import ([#98](https://github.com/open-feature/python-sdk-contrib/issues/98)) ([adb8a69](https://github.com/open-feature/python-sdk-contrib/commit/adb8a69d9ed1b0b03cb96d924b2269d973822794))
60
+
61
+ ## [0.1.5](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.4...openfeature-provider-flagd/v0.1.5) (2024-04-11)
62
+
63
+
64
+ ### ✨ New Features
65
+
66
+ * in-process offline flagd resolver ([#74](https://github.com/open-feature/python-sdk-contrib/issues/74)) ([8cea506](https://github.com/open-feature/python-sdk-contrib/commit/8cea5066ee96f637f3108a9dc3a7539c450a14be))
67
+
68
+ ## [0.1.4](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.3...openfeature-provider-flagd/v0.1.4) (2024-03-26)
69
+
70
+
71
+ ### 🐛 Bug Fixes
72
+
73
+ * include targetingKey in flagd serialized evaluation context ([#58](https://github.com/open-feature/python-sdk-contrib/issues/58)) ([ddd79a4](https://github.com/open-feature/python-sdk-contrib/commit/ddd79a49b765aa0679a2c1938447c61b37b6d0fe))
74
+ * respect timeout setting in grpc method calls ([#60](https://github.com/open-feature/python-sdk-contrib/issues/60)) ([0149cf7](https://github.com/open-feature/python-sdk-contrib/commit/0149cf7ced8116f54a9b220549834a1970460bd9))
75
+ * return proper metadata object in FlagdProvider ([#59](https://github.com/open-feature/python-sdk-contrib/issues/59)) ([6508234](https://github.com/open-feature/python-sdk-contrib/commit/6508234486ba0b650e849cbee22505988233131a))
76
+
77
+
78
+ ### ✨ New Features
79
+
80
+ * implement environment-variable based config ([#62](https://github.com/open-feature/python-sdk-contrib/issues/62)) ([a8b78b2](https://github.com/open-feature/python-sdk-contrib/commit/a8b78b28fe44ca712b00db04ac1a23a9c9bc6d9b))
81
+ * replace schema with tls argument in FlagdProvider constructor ([#61](https://github.com/open-feature/python-sdk-contrib/issues/61)) ([7a7210f](https://github.com/open-feature/python-sdk-contrib/commit/7a7210f6f63a9cba886f4d512c01ebac39d910a9))
82
+
83
+
84
+ ### 🧹 Chore
85
+
86
+ * exclude generated protobuf files from coverage report ([#51](https://github.com/open-feature/python-sdk-contrib/issues/51)) ([660a0cb](https://github.com/open-feature/python-sdk-contrib/commit/660a0cbc9bb932ac0dd9cb09f1d75177b161601b))
87
+
88
+
89
+ ### 🔄 Refactoring
90
+
91
+ * add mypy and fix typing issues ([#72](https://github.com/open-feature/python-sdk-contrib/issues/72)) ([b405925](https://github.com/open-feature/python-sdk-contrib/commit/b4059255045cdb7054a35bc338207e23c42ce068))
92
+
93
+ ## [0.1.3](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.2...openfeature-provider-flagd/v0.1.3) (2024-02-23)
94
+
95
+
96
+ ### 🐛 Bug Fixes
97
+
98
+ * include proto file in build for openfeature-provider-flagd ([#45](https://github.com/open-feature/python-sdk-contrib/issues/45)) ([7783cc8](https://github.com/open-feature/python-sdk-contrib/commit/7783cc8e7fb8fe0f9b812938efcd1f4c07e3ff68))
99
+
100
+ ## [0.1.2](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd-v0.1.1...openfeature-provider-flagd/v0.1.2) (2024-02-22)
101
+
102
+
103
+ ### 🐛 Bug Fixes
104
+
105
+ * remove mention of local eval in readme ([41df80e](https://github.com/open-feature/python-sdk-contrib/commit/41df80e1b3044356e3b228a484f3a13c92068d91))
106
+ * remove setup from flagd tests ([#39](https://github.com/open-feature/python-sdk-contrib/issues/39)) ([85661ff](https://github.com/open-feature/python-sdk-contrib/commit/85661ff170b378d37b0a3d5d0a955dad3417f538))
107
+
108
+
109
+ ### 🧹 Chore
110
+
111
+ * **main:** release providers/flagd 0.1.1 ([#40](https://github.com/open-feature/python-sdk-contrib/issues/40)) ([d42ee1e](https://github.com/open-feature/python-sdk-contrib/commit/d42ee1e531249e0023456dbe46db2f4f0c52a5c5))
112
+
113
+ ## [0.1.1](https://github.com/open-feature/python-sdk-contrib/compare/providers/flagd-v0.1.0...providers/flagd/v0.1.1) (2024-02-22)
114
+
115
+
116
+ ### 🐛 Bug Fixes
117
+
118
+ * remove setup from flagd tests ([#39](https://github.com/open-feature/python-sdk-contrib/issues/39)) ([85661ff](https://github.com/open-feature/python-sdk-contrib/commit/85661ff170b378d37b0a3d5d0a955dad3417f538))
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright The OpenTelemetry Authors
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: openfeature-provider-flagd
3
- Version: 0.1.4
3
+ Version: 0.2.0
4
4
  Summary: OpenFeature provider for the flagd flag evaluation engine
5
5
  Project-URL: Homepage, https://github.com/open-feature/python-sdk-contrib
6
6
  Author-email: OpenFeature <openfeature-core@groups.io>
@@ -192,7 +192,7 @@ License: Apache License
192
192
  same "printed page" as the copyright notice for easier
193
193
  identification within third-party archives.
194
194
 
195
- Copyright The OpenTelemetry Authors
195
+ Copyright [yyyy] [name of copyright owner]
196
196
 
197
197
  Licensed under the Apache License, Version 2.0 (the "License");
198
198
  you may not use this file except in compliance with the License.
@@ -209,15 +209,20 @@ License-File: LICENSE
209
209
  Classifier: License :: OSI Approved :: Apache Software License
210
210
  Classifier: Programming Language :: Python
211
211
  Classifier: Programming Language :: Python :: 3
212
- Requires-Python: >=3.8
213
- Requires-Dist: grpcio>=1.60.0
214
- Requires-Dist: openfeature-sdk>=0.4.0
215
- Requires-Dist: protobuf>=4.25.2
212
+ Requires-Python: >=3.9
213
+ Requires-Dist: cachebox
214
+ Requires-Dist: grpcio>=1.68.1
215
+ Requires-Dist: mmh3>=4.1.0
216
+ Requires-Dist: openfeature-sdk>=0.6.0
217
+ Requires-Dist: panzi-json-logic>=1.0.1
218
+ Requires-Dist: protobuf>=4.29.2
219
+ Requires-Dist: pyyaml>=6.0.1
220
+ Requires-Dist: semver<4,>=3
216
221
  Description-Content-Type: text/markdown
217
222
 
218
223
  # flagd Provider for OpenFeature
219
224
 
220
- This provider is designed to use flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto).
225
+ This provider is designed to use flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto), or locally evaluate flags defined in a flagd [flag definition](https://github.com/open-feature/schemas/blob/main/json/flagd-definitions.json) via the OpenFeature Python SDK.
221
226
 
222
227
  ## Installation
223
228
 
@@ -227,6 +232,14 @@ pip install openfeature-provider-flagd
227
232
 
228
233
  ## Configuration and Usage
229
234
 
235
+ The flagd provider can operate in two modes: [RPC](#remote-resolver-rpc) (evaluation takes place in flagd, via gRPC calls) or [in-process](#in-process-resolver) (evaluation takes place in-process, with the provider getting a ruleset from a compliant sync-source).
236
+
237
+ ### Remote resolver (RPC)
238
+
239
+ This is the default mode of operation of the provider.
240
+ In this mode, `FlagdProvider` communicates with [flagd](https://github.com/open-feature/flagd) via the gRPC protocol.
241
+ Flag evaluations take place remotely at the connected flagd instance.
242
+
230
243
  Instantiate a new FlagdProvider instance and configure the OpenFeature SDK to use it:
231
244
 
232
245
  ```python
@@ -236,16 +249,121 @@ from openfeature.contrib.provider.flagd import FlagdProvider
236
249
  api.set_provider(FlagdProvider())
237
250
  ```
238
251
 
252
+ ### In-process resolver
253
+
254
+ This mode performs flag evaluations locally (in-process). Flag configurations for evaluation are obtained via gRPC protocol using [sync protobuf schema](https://buf.build/open-feature/flagd/file/main:sync/v1/sync_service.proto) service definition.
255
+
256
+ Consider the following example to create a `FlagdProvider` with in-process evaluations,
257
+
258
+ ```python
259
+ from openfeature import api
260
+ from openfeature.contrib.provider.flagd import FlagdProvider
261
+ from openfeature.contrib.provider.flagd.config import ResolverType
262
+
263
+ api.set_provider(FlagdProvider(
264
+ resolver_type=ResolverType.IN_PROCESS,
265
+ ))
266
+ ```
267
+
268
+ In the above example, in-process handlers attempt to connect to a sync service on address `localhost:8013` to obtain [flag definitions](https://github.com/open-feature/schemas/blob/main/json/flags.json).
269
+
270
+ <!--
271
+ #### Sync-metadata
272
+
273
+ To support the injection of contextual data configured in flagd for in-process evaluation, the provider exposes a `getSyncMetadata` accessor which provides the most recent value returned by the [GetMetadata RPC](https://buf.build/open-feature/flagd/docs/main:flagd.sync.v1#flagd.sync.v1.FlagSyncService.GetMetadata).
274
+ The value is updated with every (re)connection to the sync implementation.
275
+ This can be used to enrich evaluations with such data.
276
+ If the `in-process` mode is not used, and before the provider is ready, the `getSyncMetadata` returns an empty map.
277
+ -->
278
+ ### File mode
279
+
280
+ In-process resolvers can also work in an offline mode.
281
+ To enable this mode, you should provide a valid flag configuration file with the option `offlineFlagSourcePath`.
282
+
283
+ ```python
284
+ from openfeature import api
285
+ from openfeature.contrib.provider.flagd import FlagdProvider
286
+ from openfeature.contrib.provider.flagd.config import ResolverType
287
+
288
+ api.set_provider(FlagdProvider(
289
+ resolver_type=ResolverType.FILE,
290
+ offline_flag_source_path="my-flag.json",
291
+ ))
292
+ ```
293
+
294
+ Provider will attempt to detect file changes using polling.
295
+ Polling happens at 5 second intervals and this is currently unconfigurable.
296
+ This mode is useful for local development, tests and offline applications.
297
+
239
298
  ### Configuration options
240
299
 
241
300
  The default options can be defined in the FlagdProvider constructor.
242
301
 
243
- | Option name | Type & Values | Default |
244
- |----------------|---------------|-----------|
245
- | host | str | localhost |
246
- | port | int | 8013 |
247
- | schema | str | http |
248
- | timeout | int | 2 |
302
+ | Option name | Environment variable name | Type & Values | Default | Compatible resolver |
303
+ |--------------------------|--------------------------------|----------------------------|-------------------------------|---------------------|
304
+ | resolver_type | FLAGD_RESOLVER | enum - `rpc`, `in-process` | rpc | |
305
+ | host | FLAGD_HOST | str | localhost | rpc & in-process |
306
+ | port | FLAGD_PORT | int | 8013 (rpc), 8015 (in-process) | rpc & in-process |
307
+ | tls | FLAGD_TLS | bool | false | rpc & in-process |
308
+ | cert_path | FLAGD_SERVER_CERT_PATH | String | null | rpc & in-process |
309
+ | deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
310
+ | stream_deadline_ms | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
311
+ | keep_alive_time | FLAGD_KEEP_ALIVE_TIME_MS | int | 0 | rpc & in-process |
312
+ | selector | FLAGD_SOURCE_SELECTOR | str | null | in-process |
313
+ | cache_type | FLAGD_CACHE | enum - `lru`, `disabled` | lru | rpc |
314
+ | max_cache_size | FLAGD_MAX_CACHE_SIZE | int | 1000 | rpc |
315
+ | retry_backoff_ms | FLAGD_RETRY_BACKOFF_MS | int | 1000 | rpc |
316
+ | offline_flag_source_path | FLAGD_OFFLINE_FLAG_SOURCE_PATH | str | null | in-process |
317
+
318
+ <!-- not implemented
319
+ | target_uri | FLAGD_TARGET_URI | alternative to host/port, supporting custom name resolution | string | null | rpc & in-process |
320
+ | socket_path | FLAGD_SOCKET_PATH | alternative to host port, unix socket | String | null | rpc & in-process |
321
+ | context_enricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
322
+ | offline_pollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process |
323
+ -->
324
+
325
+ > [!NOTE]
326
+ > Some configurations are only applicable for RPC resolver.
327
+
328
+ <!--
329
+ ### Unix socket support
330
+ Unix socket communication with flagd is facilitated by usaging of the linux-native `epoll` library on `linux-x86_64`
331
+ only (ARM support is pending the release of `netty-transport-native-epoll` v5).
332
+ Unix sockets are not supported on other platforms or architectures.
333
+ -->
334
+
335
+ ### Reconnection
336
+
337
+ Reconnection is supported by the underlying gRPC connections.
338
+ If the connection to flagd is lost, it will reconnect automatically.
339
+ A failure to connect will result in an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect indefinitely.
340
+
341
+ ### Deadlines
342
+
343
+ Deadlines are used to define how long the provider waits to complete initialization or flag evaluations.
344
+ They behave differently based on the resolver type.
345
+
346
+ #### Deadlines with Remote resolver (RPC)
347
+
348
+ If the remote evaluation call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
349
+ and the evaluation will default.
350
+
351
+ ### TLS
352
+
353
+ TLS is available in situations where flagd is running on another host.
354
+
355
+
356
+ You may optionally supply an X.509 certificate in PEM format. Otherwise, the default certificate store will be used.
357
+
358
+ ```python
359
+ from openfeature import api
360
+ from openfeature.contrib.provider.flagd import FlagdProvider
361
+
362
+ api.set_provider(FlagdProvider(
363
+ tls=True, # use TLS
364
+ cert_path="etc/cert/ca.crt" # PEM cert
365
+ ))
366
+ ```
249
367
 
250
368
  ## License
251
369
 
@@ -0,0 +1,148 @@
1
+ # flagd Provider for OpenFeature
2
+
3
+ This provider is designed to use flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto), or locally evaluate flags defined in a flagd [flag definition](https://github.com/open-feature/schemas/blob/main/json/flagd-definitions.json) via the OpenFeature Python SDK.
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ pip install openfeature-provider-flagd
9
+ ```
10
+
11
+ ## Configuration and Usage
12
+
13
+ The flagd provider can operate in two modes: [RPC](#remote-resolver-rpc) (evaluation takes place in flagd, via gRPC calls) or [in-process](#in-process-resolver) (evaluation takes place in-process, with the provider getting a ruleset from a compliant sync-source).
14
+
15
+ ### Remote resolver (RPC)
16
+
17
+ This is the default mode of operation of the provider.
18
+ In this mode, `FlagdProvider` communicates with [flagd](https://github.com/open-feature/flagd) via the gRPC protocol.
19
+ Flag evaluations take place remotely at the connected flagd instance.
20
+
21
+ Instantiate a new FlagdProvider instance and configure the OpenFeature SDK to use it:
22
+
23
+ ```python
24
+ from openfeature import api
25
+ from openfeature.contrib.provider.flagd import FlagdProvider
26
+
27
+ api.set_provider(FlagdProvider())
28
+ ```
29
+
30
+ ### In-process resolver
31
+
32
+ This mode performs flag evaluations locally (in-process). Flag configurations for evaluation are obtained via gRPC protocol using [sync protobuf schema](https://buf.build/open-feature/flagd/file/main:sync/v1/sync_service.proto) service definition.
33
+
34
+ Consider the following example to create a `FlagdProvider` with in-process evaluations,
35
+
36
+ ```python
37
+ from openfeature import api
38
+ from openfeature.contrib.provider.flagd import FlagdProvider
39
+ from openfeature.contrib.provider.flagd.config import ResolverType
40
+
41
+ api.set_provider(FlagdProvider(
42
+ resolver_type=ResolverType.IN_PROCESS,
43
+ ))
44
+ ```
45
+
46
+ In the above example, in-process handlers attempt to connect to a sync service on address `localhost:8013` to obtain [flag definitions](https://github.com/open-feature/schemas/blob/main/json/flags.json).
47
+
48
+ <!--
49
+ #### Sync-metadata
50
+
51
+ To support the injection of contextual data configured in flagd for in-process evaluation, the provider exposes a `getSyncMetadata` accessor which provides the most recent value returned by the [GetMetadata RPC](https://buf.build/open-feature/flagd/docs/main:flagd.sync.v1#flagd.sync.v1.FlagSyncService.GetMetadata).
52
+ The value is updated with every (re)connection to the sync implementation.
53
+ This can be used to enrich evaluations with such data.
54
+ If the `in-process` mode is not used, and before the provider is ready, the `getSyncMetadata` returns an empty map.
55
+ -->
56
+ ### File mode
57
+
58
+ In-process resolvers can also work in an offline mode.
59
+ To enable this mode, you should provide a valid flag configuration file with the option `offlineFlagSourcePath`.
60
+
61
+ ```python
62
+ from openfeature import api
63
+ from openfeature.contrib.provider.flagd import FlagdProvider
64
+ from openfeature.contrib.provider.flagd.config import ResolverType
65
+
66
+ api.set_provider(FlagdProvider(
67
+ resolver_type=ResolverType.FILE,
68
+ offline_flag_source_path="my-flag.json",
69
+ ))
70
+ ```
71
+
72
+ Provider will attempt to detect file changes using polling.
73
+ Polling happens at 5 second intervals and this is currently unconfigurable.
74
+ This mode is useful for local development, tests and offline applications.
75
+
76
+ ### Configuration options
77
+
78
+ The default options can be defined in the FlagdProvider constructor.
79
+
80
+ | Option name | Environment variable name | Type & Values | Default | Compatible resolver |
81
+ |--------------------------|--------------------------------|----------------------------|-------------------------------|---------------------|
82
+ | resolver_type | FLAGD_RESOLVER | enum - `rpc`, `in-process` | rpc | |
83
+ | host | FLAGD_HOST | str | localhost | rpc & in-process |
84
+ | port | FLAGD_PORT | int | 8013 (rpc), 8015 (in-process) | rpc & in-process |
85
+ | tls | FLAGD_TLS | bool | false | rpc & in-process |
86
+ | cert_path | FLAGD_SERVER_CERT_PATH | String | null | rpc & in-process |
87
+ | deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
88
+ | stream_deadline_ms | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
89
+ | keep_alive_time | FLAGD_KEEP_ALIVE_TIME_MS | int | 0 | rpc & in-process |
90
+ | selector | FLAGD_SOURCE_SELECTOR | str | null | in-process |
91
+ | cache_type | FLAGD_CACHE | enum - `lru`, `disabled` | lru | rpc |
92
+ | max_cache_size | FLAGD_MAX_CACHE_SIZE | int | 1000 | rpc |
93
+ | retry_backoff_ms | FLAGD_RETRY_BACKOFF_MS | int | 1000 | rpc |
94
+ | offline_flag_source_path | FLAGD_OFFLINE_FLAG_SOURCE_PATH | str | null | in-process |
95
+
96
+ <!-- not implemented
97
+ | target_uri | FLAGD_TARGET_URI | alternative to host/port, supporting custom name resolution | string | null | rpc & in-process |
98
+ | socket_path | FLAGD_SOCKET_PATH | alternative to host port, unix socket | String | null | rpc & in-process |
99
+ | context_enricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
100
+ | offline_pollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process |
101
+ -->
102
+
103
+ > [!NOTE]
104
+ > Some configurations are only applicable for RPC resolver.
105
+
106
+ <!--
107
+ ### Unix socket support
108
+ Unix socket communication with flagd is facilitated by usaging of the linux-native `epoll` library on `linux-x86_64`
109
+ only (ARM support is pending the release of `netty-transport-native-epoll` v5).
110
+ Unix sockets are not supported on other platforms or architectures.
111
+ -->
112
+
113
+ ### Reconnection
114
+
115
+ Reconnection is supported by the underlying gRPC connections.
116
+ If the connection to flagd is lost, it will reconnect automatically.
117
+ A failure to connect will result in an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect indefinitely.
118
+
119
+ ### Deadlines
120
+
121
+ Deadlines are used to define how long the provider waits to complete initialization or flag evaluations.
122
+ They behave differently based on the resolver type.
123
+
124
+ #### Deadlines with Remote resolver (RPC)
125
+
126
+ If the remote evaluation call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
127
+ and the evaluation will default.
128
+
129
+ ### TLS
130
+
131
+ TLS is available in situations where flagd is running on another host.
132
+
133
+
134
+ You may optionally supply an X.509 certificate in PEM format. Otherwise, the default certificate store will be used.
135
+
136
+ ```python
137
+ from openfeature import api
138
+ from openfeature.contrib.provider.flagd import FlagdProvider
139
+
140
+ api.set_provider(FlagdProvider(
141
+ tls=True, # use TLS
142
+ cert_path="etc/cert/ca.crt" # PEM cert
143
+ ))
144
+ ```
145
+
146
+ ## License
147
+
148
+ Apache 2.0 - See [LICENSE](./LICENSE) for more information.
@@ -0,0 +1,136 @@
1
+ # pyproject.toml
2
+ [build-system]
3
+ requires = ["hatchling"]
4
+ build-backend = "hatchling.build"
5
+
6
+ [project]
7
+ name = "openfeature-provider-flagd"
8
+ version = "0.2.0"
9
+ description = "OpenFeature provider for the flagd flag evaluation engine"
10
+ readme = "README.md"
11
+ authors = [{ name = "OpenFeature", email = "openfeature-core@groups.io" }]
12
+ license = { file = "LICENSE" }
13
+ classifiers = [
14
+ "License :: OSI Approved :: Apache Software License",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ ]
18
+ keywords = []
19
+ dependencies = [
20
+ "openfeature-sdk>=0.6.0",
21
+ "grpcio>=1.68.1",
22
+ "protobuf>=4.29.2",
23
+ "mmh3>=4.1.0",
24
+ "panzi-json-logic>=1.0.1",
25
+ "semver>=3,<4",
26
+ "pyyaml>=6.0.1",
27
+ "cachebox"
28
+ ]
29
+ requires-python = ">=3.9"
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/open-feature/python-sdk-contrib"
33
+
34
+ [tool.hatch]
35
+
36
+ [tool.hatch.envs.hatch-test]
37
+ dependencies = [
38
+ "coverage[toml]>=6.5",
39
+ "pytest",
40
+ "pytest-bdd",
41
+ "testcontainers",
42
+ "asserts",
43
+ "grpcio-health-checking==1.70.0",
44
+ ]
45
+ pre-install-commands = [
46
+ "hatch build",
47
+ ]
48
+
49
+ [tool.hatch.envs.hatch-test.scripts]
50
+ run = "pytest {args:tests}"
51
+ run-cov = "coverage run -m pytest {args:tests}"
52
+ cov-combine = "coverage combine"
53
+ cov-report = [
54
+ "coverage xml",
55
+ "coverage html",
56
+ "coverage report",
57
+ ]
58
+ cov = [
59
+ "test-cov",
60
+ "cov-report",
61
+ ]
62
+
63
+
64
+ [tool.hatch.envs.mypy]
65
+ dependencies = [
66
+ "mypy[faster-cache]>=1.13.0",
67
+ "types-protobuf",
68
+ "types-pyyaml",
69
+ ]
70
+ pre-install-commands = [
71
+ "hatch build",
72
+ ]
73
+
74
+ [tool.hatch.envs.mypy.scripts]
75
+ run = "mypy"
76
+
77
+ [tool.hatch.build.hooks.protobuf]
78
+ generate_pyi = false
79
+ dependencies = [
80
+ "hatch-protobuf",
81
+ "mypy-protobuf~=3.0",
82
+ ]
83
+ proto_paths = [
84
+ ".",
85
+ ]
86
+ output_path = "src/"
87
+
88
+ [[tool.hatch.build.hooks.protobuf.generators]]
89
+ name = "mypy"
90
+ outputs = ["{proto_path}/{proto_name}_pb2.pyi"]
91
+
92
+ [[tool.hatch.build.hooks.protobuf.generators]]
93
+ name = "mypy_grpc"
94
+ outputs = ["{proto_path}/{proto_name}_pb2_grpc.pyi"]
95
+
96
+ [tool.hatch.build.targets.sdist]
97
+ exclude = [
98
+ ".gitignore",
99
+ "/openfeature",
100
+ ]
101
+
102
+ [tool.hatch.build.targets.wheel]
103
+ packages = ["src/openfeature"]
104
+
105
+ [tool.coverage.run]
106
+ omit = [
107
+ # exclude generated files
108
+ "src/openfeature/schemas/*",
109
+ "tests/**",
110
+ ]
111
+
112
+ [tool.mypy]
113
+ mypy_path = "src"
114
+ files = "src"
115
+
116
+ python_version = "3.9" # should be identical to the minimum supported version
117
+ namespace_packages = true
118
+ explicit_package_bases = true
119
+ local_partial_types = true
120
+ pretty = true
121
+
122
+ strict = true
123
+ disallow_any_generics = false
124
+
125
+ [[tool.mypy.overrides]]
126
+ module = [
127
+ "grpc.*",
128
+ "json_logic.*",
129
+ ]
130
+ ignore_missing_imports = true
131
+
132
+ [[tool.mypy.overrides]]
133
+ module = [
134
+ "openfeature.schemas.*"
135
+ ]
136
+ warn_unused_ignores = false
@@ -0,0 +1,22 @@
1
+ [pytest]
2
+ markers =
3
+ rpc: tests for rpc mode.
4
+ in-process: tests for in-process mode.
5
+ file: tests for file mode.
6
+ unavailable: tests for unavailable providers.
7
+ customCert: Supports custom certs.
8
+ unixsocket: Supports unixsockets.
9
+ targetURI: Supports targetURI.
10
+ grace: Supports grace attempts.
11
+ targeting: Supports targeting.
12
+ fractional: Supports fractional.
13
+ string: Supports string.
14
+ semver: Supports semver.
15
+ reconnect: Supports reconnect.
16
+ events: Supports events.
17
+ sync: Supports sync.
18
+ caching: Supports caching.
19
+ offline: Supports offline.
20
+ os.linux: linux mark.
21
+ stream: Supports streams.
22
+ bdd_features_base_dir = tests/features