clear-skies 2.0.9__py3-none-any.whl → 2.0.10__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.
Potentially problematic release.
This version of clear-skies might be problematic. Click here for more details.
- {clear_skies-2.0.9.dist-info → clear_skies-2.0.10.dist-info}/METADATA +1 -1
- {clear_skies-2.0.9.dist-info → clear_skies-2.0.10.dist-info}/RECORD +6 -6
- clearskies/di/di.py +20 -6
- clearskies/secrets/secrets.py +2 -1
- {clear_skies-2.0.9.dist-info → clear_skies-2.0.10.dist-info}/WHEEL +0 -0
- {clear_skies-2.0.9.dist-info → clear_skies-2.0.10.dist-info}/licenses/LICENSE +0 -0
|
@@ -162,7 +162,7 @@ clearskies/contexts/wsgi_ref.py,sha256=Z4oBIYeSsLp93dR1eBsZTaevzVYB0QrR-ugp1CQVl
|
|
|
162
162
|
clearskies/di/__init__.py,sha256=Ab8GNv9ZksnCABq8n2gCcyLEAXD-5-kX4O8PweTJIFs,474
|
|
163
163
|
clearskies/di/additional_config.py,sha256=65INxw8aqTZQsyaKPj-aQmd6FBe4_4DwibXGgWYBy14,5139
|
|
164
164
|
clearskies/di/additional_config_auto_import.py,sha256=XYw0Kcnp6hp-ee-c0YjiATwJvRb2E82xk9PuoX9dGRY,758
|
|
165
|
-
clearskies/di/di.py,sha256=
|
|
165
|
+
clearskies/di/di.py,sha256=KEIzsaM0TF1N2UcwDFhsxtYjaCSte2e0koUxuHd2rME,46044
|
|
166
166
|
clearskies/di/injectable.py,sha256=TTgqhx494470I61-88BUQmHmevfat-wXVseKl8pQOEk,852
|
|
167
167
|
clearskies/di/injectable_properties.py,sha256=yJP0J7l7tjG2soyXtrfDgktE7M8tQHaP-55Cmtq0b7M,6466
|
|
168
168
|
clearskies/di/inject/__init__.py,sha256=plEkWId-VyhvqX5KM2HhdCqi7_ZJzPmFz69cPAo812Y,643
|
|
@@ -221,7 +221,7 @@ clearskies/query/query.py,sha256=0XR3fNhOpDNJY0US2oseAS3p3Y0jxxVs86P6vWEvUcA,606
|
|
|
221
221
|
clearskies/query/sort.py,sha256=c-EtIkjg3kLjwSTdXD7sfyx-mNUhAepUV-2izprh3iY,754
|
|
222
222
|
clearskies/secrets/__init__.py,sha256=G-A8YhCMlS_OdboSeKzCZp6iwfqwU4BPEnB5HvD88wY,142
|
|
223
223
|
clearskies/secrets/akeyless.py,sha256=4SwnVNzMAijZtzR0Q25dizEw-q7nbS4G5s0CoGyc-G0,7219
|
|
224
|
-
clearskies/secrets/secrets.py,sha256=
|
|
224
|
+
clearskies/secrets/secrets.py,sha256=9sYrI0PmxXAzyDCfylOmb8svXqPc9IefaWKaBPHrjxE,1815
|
|
225
225
|
clearskies/secrets/additional_configs/__init__.py,sha256=cFCrbtKF5nuR061S2y1iKZp349x-y8Srdwe3VZbfSFU,1119
|
|
226
226
|
clearskies/secrets/additional_configs/mysql_connection_dynamic_producer.py,sha256=CnIiXLVQdUnUey3dbCTXuNNP7Mmw1gjjNjZiBtfgGto,2757
|
|
227
227
|
clearskies/secrets/additional_configs/mysql_connection_dynamic_producer_via_ssh_cert_bastion.py,sha256=N8ruxrTNhvYlp3cYXq6V78KPPr4n40LM7QoXHvD8IZg,6235
|
|
@@ -250,7 +250,7 @@ clearskies/validators/minimum_value.py,sha256=NDLcG6xCemlv3kfr-RiUaM3x2INS1GJGMB
|
|
|
250
250
|
clearskies/validators/required.py,sha256=GWxyexwj-K6DunZWNEnZxW6tQGAFd4oOCvQrW1s1K9k,1308
|
|
251
251
|
clearskies/validators/timedelta.py,sha256=DJ0pTm-SSUtjZ7phGoD6vjb086vXPzvLLijkU-jQlOs,1892
|
|
252
252
|
clearskies/validators/unique.py,sha256=GFEQOMYRIO9pSGHHj6zf1GdnJ0UM7Dm4ZO4uGn19BZo,991
|
|
253
|
-
clear_skies-2.0.
|
|
254
|
-
clear_skies-2.0.
|
|
255
|
-
clear_skies-2.0.
|
|
256
|
-
clear_skies-2.0.
|
|
253
|
+
clear_skies-2.0.10.dist-info/METADATA,sha256=tuBiBiOYS2L-LJgp6Ud75P-_BM4JGbNk5hGO_rxojAs,2114
|
|
254
|
+
clear_skies-2.0.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
255
|
+
clear_skies-2.0.10.dist-info/licenses/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
|
|
256
|
+
clear_skies-2.0.10.dist-info/RECORD,,
|
clearskies/di/di.py
CHANGED
|
@@ -535,8 +535,7 @@ class Di:
|
|
|
535
535
|
override = self._class_overrides_by_class[object_to_override.__class__]
|
|
536
536
|
if inspect.isclass(override):
|
|
537
537
|
return self.build_class(override)
|
|
538
|
-
|
|
539
|
-
override.injectable_properties(self)
|
|
538
|
+
self.inject_properties(override.__class__)
|
|
540
539
|
return override
|
|
541
540
|
|
|
542
541
|
def add_override(self, name: str, replacement_class: type) -> None:
|
|
@@ -670,8 +669,7 @@ class Di:
|
|
|
670
669
|
# ignore the first argument because that is just `self`
|
|
671
670
|
build_arguments = init_args.args[1:]
|
|
672
671
|
if not build_arguments:
|
|
673
|
-
|
|
674
|
-
class_to_build.injectable_properties(self)
|
|
672
|
+
self.inject_properties(class_to_build)
|
|
675
673
|
built_value = class_to_build()
|
|
676
674
|
if cache:
|
|
677
675
|
self._prepared[class_to_build] = built_value # type: ignore
|
|
@@ -703,9 +701,8 @@ class Di:
|
|
|
703
701
|
|
|
704
702
|
del self._building[class_id]
|
|
705
703
|
|
|
704
|
+
self.inject_properties(class_to_build)
|
|
706
705
|
built_value = class_to_build(*args)
|
|
707
|
-
if hasattr(built_value, "injectable_properties"):
|
|
708
|
-
built_value.injectable_properties(self)
|
|
709
706
|
if cache:
|
|
710
707
|
self._prepared[class_to_build] = built_value # type: ignore
|
|
711
708
|
return built_value
|
|
@@ -844,6 +841,23 @@ class Di:
|
|
|
844
841
|
return False
|
|
845
842
|
return True
|
|
846
843
|
|
|
844
|
+
def inject_properties(self, cls):
|
|
845
|
+
if hasattr(cls, "injectable_properties"):
|
|
846
|
+
cls.injectable_properties(self)
|
|
847
|
+
return
|
|
848
|
+
|
|
849
|
+
if not hasattr(cls, "__injectable_properties_sanity_check"):
|
|
850
|
+
return
|
|
851
|
+
|
|
852
|
+
for attribute_name in dir(cls):
|
|
853
|
+
attribute = getattr(cls, attribute_name)
|
|
854
|
+
if hasattr(attribute, "initiated_guard") and hasattr(attribute, "set_di"):
|
|
855
|
+
raise ValueError(
|
|
856
|
+
f"Class '{cls.__name__}' has an injectable property attached, but does not include clearskies.di.injectable_properties.InjectableProperties in it's parent classes. You must include this as a parent class."
|
|
857
|
+
)
|
|
858
|
+
cls.__injectable_properties_sanity_check = True
|
|
859
|
+
return
|
|
860
|
+
|
|
847
861
|
def provide_di(self):
|
|
848
862
|
return self
|
|
849
863
|
|
clearskies/secrets/secrets.py
CHANGED
|
@@ -4,9 +4,10 @@ from abc import ABC
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
import clearskies.configurable
|
|
7
|
+
from clearskies.di.injectable_properties import InjectableProperties
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
class Secrets(ABC, clearskies.configurable.Configurable):
|
|
10
|
+
class Secrets(ABC, clearskies.configurable.Configurable, InjectableProperties):
|
|
10
11
|
def create(self, path: str, value: str) -> bool:
|
|
11
12
|
raise NotImplementedError(
|
|
12
13
|
"It looks like you tried to use the secret system in clearskies, but didn't specify a secret manager."
|
|
File without changes
|
|
File without changes
|