Commit Graph

444 Commits

Author SHA1 Message Date
Andrew Helsby 04a4323310
feat: specification-0.5.0 (#44)
* feature/spec-0.3.0: Update docs on merging contexts to reflect spec

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

* feature/spec-0.5.0: Ensure error message is optional and error code required when an error has been found
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* feature/spec-0.5.0: Remove returns in exception docstrings
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-11 11:06:22 +00: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
Robert Grassian 06d0494331
fix: eval context fixes and new error types (#43)
* eval context fixes and new error types

Signed-off-by: Robert Grassian <robert.grassian@split.io>

* cleanup

Signed-off-by: Robert Grassian <robert.grassian@split.io>

* remove eval context setter

Signed-off-by: Robert Grassian <robert.grassian@split.io>

Signed-off-by: Robert Grassian <robert.grassian@split.io>
2022-11-08 16:35:56 +00:00
Snyk bot 1e82122978
fix: requirements-dev.txt to reduce vulnerabilities (#37)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2022-11-03 19:50:56 -04: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
renovate[bot] 820419a86e
chore(deps): update actions/cache action to v3 (#34)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-02 12:47:25 +04:00
renovate[bot] ad45ff754e
chore(deps): update actions/checkout action to v3 (#35)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-02 12:47:00 +04:00
renovate[bot] 2ea6366556
chore(deps): add renovate.json (#29)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-02 12:21:34 +04:00
Michael Beemer c2d214a809
docs: add badge showing supported Python version range 2022-10-29 12:42:55 -04:00
Tom Carrio f845d9e418 docs: add badge showing supported Python version range
Signed-off-by: Tom Carrio <tom@carrio.dev>
2022-10-29 02:01:54 -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 7ef8667f12
Pypi publish (#22)
* pypi-packaging: install python build
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Rename open feature python package
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Add code coverage to pipeline
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Update actions to match other sdks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Update readme with relevant badges
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Update readme with relevant badges
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Fix merge pipeline to add all linting and tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Use python 3.10 in release step
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

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

* pypi-packaging: Use python 3.10 in requirements.txt
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-13 15:39:47 +04:00
Michael Beemer 1727554df0
Merge pull request #14 from mschoenlaub/spec-0.4.0
Remove EvaluationOptions from  method signatures
2022-10-07 12:23:38 -04:00
Manuel Schönlaub 059ef20d8d Remove superflous docstring
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-10-07 10:08:26 -06:00
Manuel Schönlaub 25119766f9 Reintroduce flag_evaluation_options in client
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-10-07 09:53:04 -06:00
Andrew Helsby 0f004afbe0
pypi-packaging: install python build (#20)
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-07 16:46:33 +04:00
Michael Beemer c4381cae09
Merge pull request #15 from agardnerIT/fix/apache-license
fix license to allow pypi upload
2022-10-03 13:11:05 -04:00
Michael Beemer b72e45e177
Merge pull request #16 from agardnerIT/fix/readme_default_values
add default_value(s) to readme
2022-10-03 13:09:54 -04:00
agardnerit 0ccedd8030 add default_value(s) to readme
Signed-off-by: agardnerit <adam@agardner.net>
2022-10-02 12:27:26 +10:00
agardnerit e5df0a8856 fix license to allow pypi upload
Signed-off-by: agardnerit <adam@agardner.net>
2022-10-02 11:54:40 +10:00
Manuel Schönlaub 0ace3cd001 Remove EvaluationOptions from method signatures
Signed-off-by: Manuel Schönlaub <manuel.schoenlaub@gmail.com>
2022-09-30 14:48:11 -06:00
Andrew Helsby f3dcad2e81
Pypi packaging (#12)
* hooks: Implementation of hooks for python Open Feature

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

* hooks: Fix tests broken as a result of providing hook support

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

* hooks: Add api level evaluation context support

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

* hooks: Change typing on iterables to be compatible with python 3.8

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: docstring change requested in review

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

* hooks: add docstrings and comments to

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

* hooks: Use correct exception in error hooks in the client

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

* hooks: Set empty evaluation context in no op provider to None

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

* pypi-packaging: package the main branch and deploy on pypi

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

* pypi-packaging: package the main branch and deploy on pypi

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

* pypi-packaging: use set package directory in pypi distribution

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-09-12 16:32:08 +04:00
Andrew Helsby bd77ff8646
Pypi packaging (#11)
* hooks: Implementation of hooks for python Open Feature

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

* hooks: Fix tests broken as a result of providing hook support

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

* hooks: Add api level evaluation context support

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

* hooks: Change typing on iterables to be compatible with python 3.8

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: docstring change requested in review

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

* hooks: add docstrings and comments to

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

* hooks: Use correct exception in error hooks in the client

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

* hooks: Set empty evaluation context in no op provider to None

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

* pypi-packaging: package the main branch and deploy on pypi

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-09-12 16:20:52 +04:00
Andrew Helsby bc58cd8932
hooks: Implementation of hooks for python OpenFeature (#6)
* hooks: Implementation of hooks for python Open Feature

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

* hooks: Fix tests broken as a result of providing hook support

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

* hooks: Add api level evaluation context support

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

* hooks: Change typing on iterables to be compatible with python 3.8

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: Add docstring for evaluate_flag_details method

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

* hooks: docstring change requested in review

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

* hooks: add docstrings and comments to

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

* hooks: Use correct exception in error hooks in the client

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

* hooks: Set empty evaluation context in no op provider to None

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

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-09-02 12:23:15 +04:00
Andrew Helsby 6b05df774e
evaluation-context: Add evaluation context to open feature (#5)
* evaluation-context: Add evaluation context to open feature

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

* evaluation-context: Fix evaluation context tests

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

* evaluation-context: Reduce code on context merge

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

* evaluation-context: Add docstring for create_provider_evaluation

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

* evaluation-context: Add tests for merging evaluation context

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

* evaluation-context: Fix evaluation context for python 3.8

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-08-03 12:02:43 +01: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 0b306816e9
Merge pull request #1 from open-feature/python-sdk
python-sdk: Work in progress initial commit of a python sdk
2022-06-22 10:36:50 +01: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 2d5d01d788 python-sdk: Remove global from top level provider, fix default flag evaluation on client 2022-06-16 17:43:36 +04:00
Andrew Helsby b7b675aca6 python-sdk: Move exceptions to a single file 2022-06-16 14:47:30 +04:00
Andrew Helsby bee4d214aa python-sdk: Remove dependency on provider 2022-06-09 16:59:20 +04:00
Andrew Helsby 5e640a8e81 python-sdk: Fix issues raised in code review 2022-06-09 16:57:33 +04:00
Andrew Helsby 41da39974b Merge branch 'main' into python-sdk
# Conflicts:
#	readme.md
2022-05-30 15:29:56 +04:00
Andrew Helsby 0480749590 python-sdk: Fix broken provider unit tests 2022-05-30 15:25:42 +04:00
Andrew Helsby cd19e7b4ea python-sdk: Fix issues raised in code review to match a more pythonic style 2022-05-30 15:22:33 +04:00
Andrew Helsby d15c141cd0 python-sdk: Fix issues raised in code review to match a more pythonic style 2022-05-30 15:13:10 +04:00
Oleg Nenashev 9d149b902a
Add a warning message that the repo is not ready 2022-05-24 20:04:27 +02:00
Andrew Helsby 029801f8df python-sdk: Add formatters to pre commit 2022-05-17 17:20:19 +04:00
Andrew Helsby 940846c6d3 python-sdk: Update flagsmith implementation 2022-05-17 14:37:46 +04:00
Andrew Helsby 5779497b87 python-sdk: Update client and flag type enum 2022-05-17 13:24:16 +04:00
Andrew Helsby 8010bef48f python-sdk: Work in progress initial commit of a python sdk 2022-05-12 16:11:40 +04:00
Andrew Helsby 818fea69ae Initial commit of readme and gitignore 2022-05-12 15:59:39 +04:00