karrio-server 2025.5rc35__py3-none-any.whl → 2025.5rc36__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
karrio/server/VERSION CHANGED
@@ -1 +1 @@
1
- 2025.5rc35
1
+ 2025.5rc36
@@ -1,4 +1,4 @@
1
- """ Dynamic configuration editable on runtime powered by django-constance."""
1
+ """Dynamic configuration editable on runtime powered by django-constance."""
2
2
 
3
3
  from decouple import config
4
4
  import karrio.references as ref
@@ -22,6 +22,7 @@ GOOGLE_CLOUD_API_KEY = config("GOOGLE_CLOUD_API_KEY", default="")
22
22
  CANADAPOST_ADDRESS_COMPLETE_API_KEY = config(
23
23
  "CANADAPOST_ADDRESS_COMPLETE_API_KEY", default=""
24
24
  )
25
+
25
26
  # data retention env in days
26
27
  ORDER_DATA_RETENTION = config("ORDER_DATA_RETENTION", default=183, cast=int)
27
28
  TRACKER_DATA_RETENTION = config("TRACKER_DATA_RETENTION", default=183, cast=int)
@@ -29,7 +30,9 @@ SHIPMENT_DATA_RETENTION = config("SHIPMENT_DATA_RETENTION", default=183, cast=in
29
30
  API_LOGS_DATA_RETENTION = config("API_LOGS_DATA_RETENTION", default=92, cast=int)
30
31
 
31
32
  # registry config
32
- ENABLE_ALL_PLUGINS_BY_DEFAULT = config("ENABLE_ALL_PLUGINS_BY_DEFAULT", default=True if base.DEBUG else False, cast=bool)
33
+ ENABLE_ALL_PLUGINS_BY_DEFAULT = config(
34
+ "ENABLE_ALL_PLUGINS_BY_DEFAULT", default=True if base.DEBUG else False, cast=bool
35
+ )
33
36
 
34
37
  # Create feature flags config only for modules that exist
35
38
  FEATURE_FLAGS_CONFIG = {
@@ -161,8 +164,21 @@ PLUGIN_REGISTRY = {
161
164
  config(f"{ext.upper()}_ENABLED", default=True, cast=bool),
162
165
  f"{metadata.get('label')} plugin",
163
166
  bool,
164
- ) for ext, metadata in ref.PLUGIN_METADATA.items()
165
- }
167
+ )
168
+ for ext, metadata in ref.PLUGIN_METADATA.items()
169
+ },
170
+ }
171
+
172
+ # Collect plugin system configs from ref.SYSTEM_CONFIGS
173
+ # Format: Dict[str, Tuple[default_value, description, type]]
174
+ PLUGIN_SYSTEM_CONFIG = {
175
+ key: (config(key, default=default_value, cast=value_type), description, value_type)
176
+ for key, (default_value, description, value_type) in ref.SYSTEM_CONFIGS.items()
177
+ }
178
+ PLUGIN_SYSTEM_CONFIG_FIELDSETS = {
179
+ f"{metadata.get('label')} Config": tuple(metadata.get("system_config", {}).keys())
180
+ for _, metadata in ref.PLUGIN_METADATA.items()
181
+ if metadata.get("system_config")
166
182
  }
167
183
 
168
184
 
@@ -218,6 +234,7 @@ CONSTANCE_CONFIG = {
218
234
  ),
219
235
  **{k: v for k, v in FEATURE_FLAGS_CONFIG.items() if v is not None},
220
236
  **PLUGIN_REGISTRY,
237
+ **PLUGIN_SYSTEM_CONFIG,
221
238
  }
222
239
 
223
240
  CONSTANCE_CONFIG_FIELDSETS = {
@@ -241,5 +258,12 @@ CONSTANCE_CONFIG_FIELDSETS = {
241
258
  ),
242
259
  "Feature Flags": tuple(FEATURE_FLAGS_FIELDSET),
243
260
  "Registry Config": ("ENABLE_ALL_PLUGINS_BY_DEFAULT",),
244
- "Registry Plugins": tuple([k for k in PLUGIN_REGISTRY.keys() if not k in ("ENABLE_ALL_PLUGINS_BY_DEFAULT",)]),
261
+ "Registry Plugins": tuple(
262
+ [
263
+ k
264
+ for k in PLUGIN_REGISTRY.keys()
265
+ if not k in ("ENABLE_ALL_PLUGINS_BY_DEFAULT",)
266
+ ]
267
+ ),
268
+ **PLUGIN_SYSTEM_CONFIG_FIELDSETS,
245
269
  }