Commit Graph

20 Commits

Author SHA1 Message Date
Anton Grübel e61b69bb50
refactor: replace exception raising with error flag resolution (#474)
* replace exception raising with error flag resolution

Signed-off-by: gruebel <anton.gruebel@gmail.com>

* revert spec to commit 0cd553d

Signed-off-by: gruebel <anton.gruebel@gmail.com>

---------

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2025-04-08 19:54:41 +02:00
Leo 86e7c07112
feat: Add async functionality to providers (#413)
Signed-off-by: leohoare <leo@insight.co>
2025-02-06 12:30:54 -05:00
Anton Grübel a853b85514
chore: remove excluded ruff rules and fix issues (#254)
remove excluded ruff rules and fix issues

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-01-06 14:25:44 -03:00
Michael Beemer 0c314ab77c
fix!: raise error if the flag wasn't found using the in-memory provider (#228)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2023-11-01 14:56:48 -04:00
Federico Bond 4314ef7003
chore: simplify build and dependencies configuration (#208)
* chore: simplify build and dependencies configuration

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: remove unused .env.template

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: remove duplicate hook_support.py module

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: update pre-commit config and fix format issues

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: update github workflows

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: update dependencies

Signed-off-by: Federico Bond <federicobond@gmail.com>

* chore: replace virtualenv with built-in venv everywhere

Signed-off-by: Federico Bond <federicobond@gmail.com>

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-10-18 00:41:54 -03:00
Federico Bond 51f0d260f0
refactor!: rename top-level package to openfeature (#192)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-09-20 13:22:31 -03:00
Federico Bond 793ced1917
refactor!: simplify namespaces to make public API more pythonic (#172)
* refactor!: simplify namespaces to make public API more pythonic

Signed-off-by: Federico Bond <federicobond@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2023-09-08 10:31:25 -04:00
Federico Bond 5e7bf1f8ad
feat: implement InMemoryProvider (#157)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-07-25 14:50:46 -04:00
Thomas Poignant 85db1e0a74
fix: Get Object should return both list and dict (#64)
* Get Object should return both list and dict

Signed-off-by: Thomas Poignant <thomas.poignant@gofeatureflag.org>
2022-12-19 13:14:41 -05:00
Andrew Helsby 311b8eef53
feat: spec-0.2.0 (#38)
* fix/unit-tests: Add float and int flag methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Add the ability for a provider to have hooks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Flag evaluation options added for hook merging
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Move numeric type methods to a private method within the client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Add tests for new numeric methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Overwrite init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Overwrite init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Remove init on FlagEvaluationOptions
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Ensure before_hooks are evaluated in the opposite order
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Remove number flag evaluation in favour of strongly typed counterparts
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Check flag type after provider response
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Remove unnecessary static method
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>

* feature/spec-0.2.0: Update docstring parameter name
Signed-off-by: Matthew Elwell <matthew.elwell@flagsmith.com>

* feature/spec-0.2.0: Fix typing of int and float methods
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/spec-0.2.0: Change provider methods to resolves rather than gets
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com>
2022-11-09 15:05:35 +00:00
Andrew Helsby df0c033083
fix: Unit tests (#28)
* fix/unit-tests: Improve unit test coverage to ensure spec is followed
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Add test coverage around hooks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize test_should_use_no_op_provider_if_none_provided
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Add fixture to clear global provider after each tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Mock hooks in tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Update docstring on clear_provider method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: remove setup method in client tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Remove invalid flag type check in private method _create_provider_evaluation and move to public method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-11-02 16:24:16 +04:00
Andrew Helsby b39cced329
feat: Add metadata to providers (#26)
* provider-metadata: Add metadata to providers
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/provider-metadata: Test extending metadata class
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* feature/provider-metadata: Change no op metadata
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-10-18 16:34:06 +04:00
Andrew Helsby b44224be0d
fix: Move flag evaluation details to a dataclass (#27)
* fix/flag-error-message: Move flag evaluation details to a dataclass and add error message to the class
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/flag-error-message: Rename flag_key in FlagEvaluationDetails to match spec
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/flag-error-message: Rename flag_key in provider.py to match spec
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/flag-error-message: Rename flag_key in open_feature_client.py
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/flag-error-message: Rename flag_key in open_feature_client.py
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/flag-error-message: handle error_message doesn't exist exception
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-10-18 15:23:24 +04:00
Andrew Helsby d2b484343d
Restructure modules (#3)
restructure-modules: Rename src module to open_feature

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-06-30 21:35:41 +04:00
Andrew Helsby abe82c0484 python-sdk: Use a singleton for the api, move number enums to strings, modify flake8 config 2022-06-21 15:14:04 +01:00
Andrew Helsby af90605aa4 python-sdk: Fix issues raised in code review 2022-06-20 18:28:09 +01:00
Andrew Helsby 5e640a8e81 python-sdk: Fix issues raised in code review 2022-06-09 16:57:33 +04:00
Andrew Helsby 0480749590 python-sdk: Fix broken provider unit tests 2022-05-30 15:25:42 +04:00
Andrew Helsby 940846c6d3 python-sdk: Update flagsmith implementation 2022-05-17 14:37:46 +04:00
Andrew Helsby 8010bef48f python-sdk: Work in progress initial commit of a python sdk 2022-05-12 16:11:40 +04:00