gofeatureflag-python-provider 1.0.1__tar.gz → 1.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.
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/.gitignore +3 -2
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/CHANGELOG.md +39 -14
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/PKG-INFO +2 -2
- gofeatureflag_python_provider-1.2.0/gofeatureflag_python_provider/__init__.py +1 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/evaluator/inprocess_evaluator.py +1 -4
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/options.py +1 -1
- gofeatureflag_python_provider-1.2.0/gofeatureflag_python_provider/wasm/_wasi_version.txt +1 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/wasm/evaluate_wasm.py +16 -8
- gofeatureflag_python_provider-1.2.0/gofeatureflag_python_provider/wasm/gofeatureflag-evaluation_0.2.3.wasi +0 -0
- gofeatureflag_python_provider-1.2.0/hatch_build.py +55 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/pyproject.toml +17 -3
- gofeatureflag_python_provider-1.0.1/gofeatureflag_python_provider/__init__.py +0 -1
- gofeatureflag_python_provider-1.0.1/gofeatureflag_python_provider/wasm/_wasi_version.txt +0 -1
- gofeatureflag_python_provider-1.0.1/gofeatureflag_python_provider/wasm/gofeatureflag-evaluation_0.2.0.wasi +0 -0
- gofeatureflag_python_provider-1.0.1/hatch_build.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/AGENTS.md +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/CLAUDE.md +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/README.md +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/clean.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/evaluator/__init__.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/evaluator/abstract_evaluator.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/evaluator/remote_evaluator.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/exceptions.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/hooks/__init__.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/hooks/data_collector.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/hooks/enrich_evaluation_context.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/metadata.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/provider.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/request_data_collector.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/request_flag_evaluation.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/response_flag_evaluation.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/services/__init__.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/services/api.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/services/event_publisher.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/services/models.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/wasm/__init__.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/gofeatureflag_python_provider/wasm/models.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/.gitignore +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/__init__.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/config.goff.yaml +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/conftest.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/docker-compose.yml +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/config/valid-all-types-config-change.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/config/valid-all-types.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/config/valid-flag-config.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/config/valid-scheduled-rollout.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/bool_targeting_match.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/bool_targeting_match_no_error_field.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/disabled_bool.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/disabled_float.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/disabled_int.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/disabled_object.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/disabled_string.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/double_key.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/flag_not_found.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/integer_key.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/invalid_json_body.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/list_key.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/object_key.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/string_key.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/mock_responses/ofrep/unknown_reason.json +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_data_collector_hook.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_enrich_evaluation_context_hook.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_evaluate_wasm.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_event_publisher.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_gofeatureflag_provider.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_gofeatureflag_provider_inprocess.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_inprocess_evaluator.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_provider_graceful_exit.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_remote_evaluator_ofrep.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_services_api.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/test_websocket_cache_invalidation.py +0 -0
- {gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/uv.lock +0 -0
|
@@ -157,5 +157,6 @@ cython_debug/
|
|
|
157
157
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
158
158
|
.idea/
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
# WASI evaluation binaries are copied in from the wasm-releases submodule at
|
|
161
|
+
# build time (see hatch_build.py); the pinned version lives in _wasi_version.txt.
|
|
162
|
+
gofeatureflag_python_provider/wasm/gofeatureflag-evaluation_*.wasi
|
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.2.0](https://github.com/thomaspoignant/go-feature-flag/compare/openfeature/providers/python-provider/v1.1.0...openfeature/providers/python-provider/v1.2.0) (2026-07-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🚀 New Features
|
|
7
|
+
|
|
8
|
+
* **python-provider:** automate WASM/WASI version bump ([#5541](https://github.com/thomaspoignant/go-feature-flag/issues/5541)) ([6ddc99d](https://github.com/thomaspoignant/go-feature-flag/commit/6ddc99dd8cdee5232d7cedfd0bd3399c00ba2746))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### 🐛 Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **python-provider:** use logger.exception in refresh error handler ([#5522](https://github.com/thomaspoignant/go-feature-flag/issues/5522)) ([8bf2c4d](https://github.com/thomaspoignant/go-feature-flag/commit/8bf2c4d45c32119f5f84780e473b1710a8e5340e))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### 🔧 Chores
|
|
17
|
+
|
|
18
|
+
* Bump github.com/aws/aws-sdk-go-v2 from 1.41.10 to 1.41.11 ([#5409](https://github.com/thomaspoignant/go-feature-flag/issues/5409)) ([1badd80](https://github.com/thomaspoignant/go-feature-flag/commit/1badd804bb4232b034ccc59d15aee1cdee02e34d))
|
|
19
|
+
* Bump github.com/aws/aws-sdk-go-v2/service/s3 ([#5360](https://github.com/thomaspoignant/go-feature-flag/issues/5360)) ([9752a72](https://github.com/thomaspoignant/go-feature-flag/commit/9752a726b9e252e6262bfcf75066b0e32e4ec0ed))
|
|
20
|
+
* Bump github.com/aws/aws-sdk-go-v2/service/s3 ([#5410](https://github.com/thomaspoignant/go-feature-flag/issues/5410)) ([e9bf102](https://github.com/thomaspoignant/go-feature-flag/commit/e9bf102189c0708b72ee0487b05af8f32148681f))
|
|
21
|
+
* Bump github.com/aws/aws-sdk-go-v2/service/s3 ([#5490](https://github.com/thomaspoignant/go-feature-flag/issues/5490)) ([52994bd](https://github.com/thomaspoignant/go-feature-flag/commit/52994bdc6c85926a90eeb3dbc5d96e83c59a0476))
|
|
22
|
+
* Bump github.com/testcontainers/testcontainers-go ([#5511](https://github.com/thomaspoignant/go-feature-flag/issues/5511)) ([a772730](https://github.com/thomaspoignant/go-feature-flag/commit/a7727302bcf6f1dacc67c9014a15a9f4397c4ef5))
|
|
23
|
+
* Update openfeature-sdk requirement ([#5427](https://github.com/thomaspoignant/go-feature-flag/issues/5427)) ([11be657](https://github.com/thomaspoignant/go-feature-flag/commit/11be6572746ed85474624a377523274188f52ea1))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### 📚 Documentation
|
|
27
|
+
|
|
28
|
+
* Cleanup CHANGELOGS ([#5333](https://github.com/thomaspoignant/go-feature-flag/issues/5333)) ([7d6c5a3](https://github.com/thomaspoignant/go-feature-flag/commit/7d6c5a3341c1a0e028163c0fd8e2ad99b27d67ef))
|
|
29
|
+
|
|
30
|
+
## [1.1.0](https://github.com/thomaspoignant/go-feature-flag/compare/openfeature/providers/python-provider/v1.0.1...openfeature/providers/python-provider/v1.1.0) (2026-05-26)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### 🚀 New Features
|
|
34
|
+
|
|
35
|
+
* Bump WASM module to 0.2.2 ([#5323](https://github.com/thomaspoignant/go-feature-flag/issues/5323)) ([cfcfc3c](https://github.com/thomaspoignant/go-feature-flag/commit/cfcfc3c586f5bb9e6673fc499745d2bca1fdbc4b))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### 🔧 Chores
|
|
39
|
+
|
|
40
|
+
* Bump golang.org/x/net from 0.53.0 to 0.54.0 ([#5296](https://github.com/thomaspoignant/go-feature-flag/issues/5296)) ([b31655a](https://github.com/thomaspoignant/go-feature-flag/commit/b31655ac1ab8e12d6f9284b2f725d1cd74b80c3b))
|
|
41
|
+
|
|
3
42
|
## [1.0.1](https://github.com/thomaspoignant/go-feature-flag/compare/openfeature/providers/python-provider/v1.0.0...openfeature/providers/python-provider/v1.0.1) (2026-05-16)
|
|
4
43
|
|
|
5
44
|
|
|
@@ -57,17 +96,3 @@
|
|
|
57
96
|
* Bump websocket-client in /openfeature/providers/python-provider ([#4053](https://github.com/thomaspoignant/go-feature-flag/issues/4053)) ([4147232](https://github.com/thomaspoignant/go-feature-flag/commit/4147232126e8f6af5a03a90001d07177ba1e60a8))
|
|
58
97
|
* **main:** release openfeature/providers/python-provider 0.5.0 ([#4065](https://github.com/thomaspoignant/go-feature-flag/issues/4065)) ([fb0d9ba](https://github.com/thomaspoignant/go-feature-flag/commit/fb0d9babaeae8fc4721c6bcd9a566d8c6e5502a9))
|
|
59
98
|
* Release python as v0.5.0 ([#4142](https://github.com/thomaspoignant/go-feature-flag/issues/4142)) ([0c1508a](https://github.com/thomaspoignant/go-feature-flag/commit/0c1508a7bc466be35d18f3026668f0896f8fa55e))
|
|
60
|
-
|
|
61
|
-
## [0.5.0](https://github.com/thomaspoignant/go-feature-flag/compare/openfeature/providers/python-provider/v0.4.4...openfeature/providers/python-provider/v0.5.0) (2025-10-26)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### 🚀 New Features
|
|
65
|
-
|
|
66
|
-
* Python Provider Graceful Exit ([#4106](https://github.com/thomaspoignant/go-feature-flag/issues/4106)) ([b48cc0c](https://github.com/thomaspoignant/go-feature-flag/commit/b48cc0c0d3874e002eea174192251e0564540512))
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### 🔧 Chores
|
|
70
|
-
|
|
71
|
-
* Bump pydantic in /openfeature/providers/python-provider ([#4050](https://github.com/thomaspoignant/go-feature-flag/issues/4050)) ([d4ea37f](https://github.com/thomaspoignant/go-feature-flag/commit/d4ea37fa7d3d91742acd75e246563699bb71b287))
|
|
72
|
-
* Bump pydantic in /openfeature/providers/python-provider ([#4120](https://github.com/thomaspoignant/go-feature-flag/issues/4120)) ([beda91c](https://github.com/thomaspoignant/go-feature-flag/commit/beda91cbbc0369c38c71178b92ab13f1103e83a6))
|
|
73
|
-
* Bump websocket-client in /openfeature/providers/python-provider ([#4053](https://github.com/thomaspoignant/go-feature-flag/issues/4053)) ([4147232](https://github.com/thomaspoignant/go-feature-flag/commit/4147232126e8f6af5a03a90001d07177ba1e60a8))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gofeatureflag-python-provider
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: GO Feature Flag provider for OpenFeature
|
|
5
5
|
Project-URL: Bug Tracker, https://github.com/thomaspoignant/go-feature-flag/issues
|
|
6
6
|
Project-URL: Source Code, https://github.com/thomaspoignant/go-feature-flag/tree/main/openfeature/providers/python-provider
|
|
@@ -12,7 +12,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
13
|
Requires-Python: >=3.10
|
|
14
14
|
Requires-Dist: openfeature-provider-ofrep>=0.2.0
|
|
15
|
-
Requires-Dist: openfeature-sdk<0.
|
|
15
|
+
Requires-Dist: openfeature-sdk<0.11.0,>=0.8.4
|
|
16
16
|
Requires-Dist: pydantic>=2.5.2
|
|
17
17
|
Requires-Dist: urllib3>=2.1.0
|
|
18
18
|
Requires-Dist: wasmtime>=41.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.0"
|
|
@@ -93,10 +93,7 @@ class InProcessEvaluator(AbstractEvaluator):
|
|
|
93
93
|
try:
|
|
94
94
|
response = self._api.retrieve_flag_configuration(etag=etag)
|
|
95
95
|
except Exception:
|
|
96
|
-
logger.
|
|
97
|
-
"Failed to refresh flag configuration",
|
|
98
|
-
exc_info=True,
|
|
99
|
-
)
|
|
96
|
+
logger.exception("Failed to refresh flag configuration")
|
|
100
97
|
return
|
|
101
98
|
with self._lock:
|
|
102
99
|
if response.flags:
|
|
@@ -80,7 +80,7 @@ class GoFeatureFlagOptions(BaseModel):
|
|
|
80
80
|
|
|
81
81
|
# wasm_file_path (optional) is the path to the GO Feature Flag evaluation WASI binary.
|
|
82
82
|
# Used only when evaluation_type is INPROCESS.
|
|
83
|
-
# If not set, the bundled
|
|
83
|
+
# If not set, the bundled WASI binary is used (version pinned in wasm/_wasi_version.txt).
|
|
84
84
|
wasm_file_path: typing.Optional[str] = None
|
|
85
85
|
|
|
86
86
|
# wasm_pool_size (optional) number of WASM Store instances for concurrent in-process evaluation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.3
|
|
@@ -24,15 +24,23 @@ from gofeatureflag_python_provider.wasm.models import WasmEvaluationResponse, Wa
|
|
|
24
24
|
|
|
25
25
|
logger = logging.getLogger(__name__)
|
|
26
26
|
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
Path("wasm-releases") / "evaluation" / "gofeatureflag-evaluation_0.2.0.wasi"
|
|
30
|
-
)
|
|
27
|
+
# Directory holding this module and the bundled WASI binary.
|
|
28
|
+
_WASM_DIR = Path(__file__).parent
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
def
|
|
34
|
-
"""
|
|
35
|
-
|
|
31
|
+
def _read_wasm_version() -> str:
|
|
32
|
+
"""
|
|
33
|
+
Read the pinned WASI version from the co-located ``_wasi_version.txt``.
|
|
34
|
+
|
|
35
|
+
This file is the single source of truth for the WASI version shipped with
|
|
36
|
+
the provider; the bump automation only updates this file.
|
|
37
|
+
"""
|
|
38
|
+
return (_WASM_DIR / "_wasi_version.txt").read_text(encoding="utf-8").strip()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _default_wasi_path() -> Path:
|
|
42
|
+
"""Return the path to the bundled WASI binary for the pinned version."""
|
|
43
|
+
return _WASM_DIR / f"gofeatureflag-evaluation_{_read_wasm_version()}.wasi"
|
|
36
44
|
|
|
37
45
|
|
|
38
46
|
class WasmNotLoadedError(RuntimeError):
|
|
@@ -115,7 +123,7 @@ class EvaluateWasm:
|
|
|
115
123
|
if wasm_path:
|
|
116
124
|
self._wasm_path = Path(wasm_path)
|
|
117
125
|
else:
|
|
118
|
-
self._wasm_path =
|
|
126
|
+
self._wasm_path = _default_wasi_path()
|
|
119
127
|
self._pool_size = 1 if pool_size is None or pool_size < 1 else pool_size
|
|
120
128
|
self._engine: Optional[wasmtime.Engine] = None
|
|
121
129
|
self._module: Optional[wasmtime.Module] = None
|
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hatchling build hook for the GO Feature Flag Python provider.
|
|
3
|
+
|
|
4
|
+
The provider ships a WASI evaluation binary (``gofeatureflag-evaluation_<version>.wasi``)
|
|
5
|
+
for in-process flag evaluation. The binaries live in the ``wasm-releases`` git submodule
|
|
6
|
+
(excluded from the distribution) and are git-ignored inside the package, so this hook
|
|
7
|
+
copies the pinned-version binary into ``gofeatureflag_python_provider/wasm/`` before the
|
|
8
|
+
wheel/sdist is built.
|
|
9
|
+
|
|
10
|
+
The pinned version is the single source of truth stored in
|
|
11
|
+
``gofeatureflag_python_provider/wasm/_wasi_version.txt``.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import shutil
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CustomBuildHook(BuildHookInterface):
|
|
21
|
+
"""Copy the pinned WASI binary from the wasm-releases submodule into the package."""
|
|
22
|
+
|
|
23
|
+
def initialize(self, version: str, build_data: dict) -> None:
|
|
24
|
+
root = Path(self.root)
|
|
25
|
+
wasm_dir = root / "gofeatureflag_python_provider" / "wasm"
|
|
26
|
+
wasm_version = (
|
|
27
|
+
(wasm_dir / "_wasi_version.txt").read_text(encoding="utf-8").strip()
|
|
28
|
+
)
|
|
29
|
+
if not wasm_version:
|
|
30
|
+
raise ValueError(
|
|
31
|
+
f"Empty WASI version in {wasm_dir / '_wasi_version.txt'}; "
|
|
32
|
+
"it must contain the pinned version (e.g. 0.2.3)."
|
|
33
|
+
)
|
|
34
|
+
filename = f"gofeatureflag-evaluation_{wasm_version}.wasi"
|
|
35
|
+
|
|
36
|
+
# Remove any stale binaries for other versions so only the pinned one is
|
|
37
|
+
# packaged (the artifacts glob would otherwise ship every *.wasi present).
|
|
38
|
+
for stale in wasm_dir.glob("gofeatureflag-evaluation_*.wasi"):
|
|
39
|
+
if stale.name != filename:
|
|
40
|
+
stale.unlink()
|
|
41
|
+
|
|
42
|
+
dest = wasm_dir / filename
|
|
43
|
+
if dest.exists():
|
|
44
|
+
# Already present (e.g. copied by a previous build) - nothing to do.
|
|
45
|
+
return
|
|
46
|
+
|
|
47
|
+
source = root / "wasm-releases" / "evaluation" / filename
|
|
48
|
+
if not source.exists():
|
|
49
|
+
raise FileNotFoundError(
|
|
50
|
+
f"WASI binary {filename!r} not found at {source}. "
|
|
51
|
+
"Initialize the submodule first: "
|
|
52
|
+
"`git submodule update --init openfeature/providers/python-provider/wasm-releases`."
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
shutil.copyfile(source, dest)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "gofeatureflag-python-provider"
|
|
3
|
-
version = "1.0
|
|
4
|
-
wasm_version = "0.2.0"
|
|
3
|
+
version = "1.2.0"
|
|
5
4
|
description = "GO Feature Flag provider for OpenFeature"
|
|
6
5
|
license = "Apache-2.0"
|
|
7
6
|
authors = [{ name = "Thomas Poignant" }]
|
|
@@ -16,7 +15,7 @@ classifiers = [
|
|
|
16
15
|
]
|
|
17
16
|
requires-python = ">=3.10"
|
|
18
17
|
dependencies = [
|
|
19
|
-
"openfeature-sdk>=0.8.4,<0.
|
|
18
|
+
"openfeature-sdk>=0.8.4,<0.11.0",
|
|
20
19
|
"openfeature-provider-ofrep>=0.2.0",
|
|
21
20
|
"pydantic>=2.5.2",
|
|
22
21
|
"urllib3>=2.1.0",
|
|
@@ -41,16 +40,31 @@ dev = [
|
|
|
41
40
|
requires = ["hatchling"]
|
|
42
41
|
build-backend = "hatchling.build"
|
|
43
42
|
|
|
43
|
+
# Custom build hook: copies the pinned WASI binary from the wasm-releases
|
|
44
|
+
# submodule into the package before building (see hatch_build.py).
|
|
45
|
+
[tool.hatch.build.hooks.custom]
|
|
46
|
+
path = "hatch_build.py"
|
|
47
|
+
|
|
44
48
|
[tool.hatch.build.targets.wheel]
|
|
45
49
|
include = [
|
|
46
50
|
"gofeatureflag_python_provider/**",
|
|
47
51
|
]
|
|
48
52
|
|
|
53
|
+
# The WASI binary is git-ignored (copied in by the build hook), so it must be
|
|
54
|
+
# listed as an artifact to be included in the distribution.
|
|
55
|
+
artifacts = [
|
|
56
|
+
"gofeatureflag_python_provider/wasm/*.wasi",
|
|
57
|
+
]
|
|
58
|
+
|
|
49
59
|
exclude = [
|
|
50
60
|
"wasm-releases/**"
|
|
51
61
|
]
|
|
52
62
|
|
|
53
63
|
[tool.hatch.build.targets.sdist]
|
|
64
|
+
artifacts = [
|
|
65
|
+
"gofeatureflag_python_provider/wasm/*.wasi",
|
|
66
|
+
]
|
|
67
|
+
|
|
54
68
|
exclude = [
|
|
55
69
|
"wasm-releases/**"
|
|
56
70
|
]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.2.0
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/.gitignore
RENAMED
|
File without changes
|
{gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/__init__.py
RENAMED
|
File without changes
|
{gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/config.goff.yaml
RENAMED
|
File without changes
|
{gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/conftest.py
RENAMED
|
File without changes
|
{gofeatureflag_python_provider-1.0.1 → gofeatureflag_python_provider-1.2.0}/tests/docker-compose.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|