fluxloop 0.1.1__py3-none-any.whl → 0.1.2__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 fluxloop might be problematic. Click here for more details.
- fluxloop/__init__.py +1 -1
- fluxloop/config.py +22 -2
- {fluxloop-0.1.1.dist-info → fluxloop-0.1.2.dist-info}/METADATA +1 -1
- {fluxloop-0.1.1.dist-info → fluxloop-0.1.2.dist-info}/RECORD +6 -6
- {fluxloop-0.1.1.dist-info → fluxloop-0.1.2.dist-info}/WHEEL +0 -0
- {fluxloop-0.1.1.dist-info → fluxloop-0.1.2.dist-info}/top_level.txt +0 -0
fluxloop/__init__.py
CHANGED
|
@@ -21,7 +21,7 @@ from .client import FluxLoopClient
|
|
|
21
21
|
from .config import configure, get_config, reset_config, load_env
|
|
22
22
|
from .recording import disable_recording, enable_recording, record_call_args, set_recording_options
|
|
23
23
|
|
|
24
|
-
__version__ = "0.1.
|
|
24
|
+
__version__ = "0.1.2"
|
|
25
25
|
|
|
26
26
|
__all__ = [
|
|
27
27
|
# Decorators
|
fluxloop/config.py
CHANGED
|
@@ -14,12 +14,19 @@ from pydantic import BaseModel, Field, field_validator
|
|
|
14
14
|
from .recording import disable_recording, enable_recording
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def load_env(
|
|
17
|
+
def load_env(
|
|
18
|
+
dotenv_path: Optional[str] = None,
|
|
19
|
+
*,
|
|
20
|
+
override: bool = True,
|
|
21
|
+
refresh_config: bool = True,
|
|
22
|
+
) -> bool:
|
|
18
23
|
"""Load environment variables for FluxLoop.
|
|
19
24
|
|
|
20
25
|
Args:
|
|
21
26
|
dotenv_path: Optional path to a specific `.env` file or containing directory.
|
|
22
27
|
override: Whether to override existing environment variables.
|
|
28
|
+
refresh_config: When True (default), rebuild the in-memory SDK config using the
|
|
29
|
+
newly loaded environment variables (if the config has already been created).
|
|
23
30
|
|
|
24
31
|
Returns:
|
|
25
32
|
True if the env file was found and loaded, False otherwise.
|
|
@@ -32,7 +39,12 @@ def load_env(dotenv_path: Optional[str] = None, *, override: bool = False) -> bo
|
|
|
32
39
|
if candidate.is_dir():
|
|
33
40
|
candidate = candidate / ".env"
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
loaded = load_dotenv(dotenv_path=str(candidate), override=override)
|
|
43
|
+
|
|
44
|
+
if refresh_config and globals().get("_config") is not None:
|
|
45
|
+
_refresh_config_from_env()
|
|
46
|
+
|
|
47
|
+
return loaded
|
|
36
48
|
|
|
37
49
|
|
|
38
50
|
def _resolve_recording_path(path: Optional[str]) -> Path:
|
|
@@ -165,6 +177,14 @@ _config = SDKConfig()
|
|
|
165
177
|
_apply_recording_config(_config)
|
|
166
178
|
|
|
167
179
|
|
|
180
|
+
def _refresh_config_from_env() -> None:
|
|
181
|
+
"""Rebuild the global SDK configuration from current environment variables."""
|
|
182
|
+
|
|
183
|
+
global _config
|
|
184
|
+
_config = SDKConfig()
|
|
185
|
+
_apply_recording_config(_config)
|
|
186
|
+
|
|
187
|
+
|
|
168
188
|
def configure(**kwargs) -> SDKConfig:
|
|
169
189
|
"""
|
|
170
190
|
Configure the SDK.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fluxloop/__init__.py,sha256=
|
|
1
|
+
fluxloop/__init__.py,sha256=RxodliXE5hqJ51AxIAYZVxm1XSjuBr28jKJPK8yCcS8,1274
|
|
2
2
|
fluxloop/buffer.py,sha256=pbviGFU0P_HlBYOlZccVuaj7OcQ5-M0L8d7r_vF1hQg,5940
|
|
3
3
|
fluxloop/client.py,sha256=4WCi1de8MJW-5La-ZalVYEaN7-gUFHlr6mByi1bBoc0,5487
|
|
4
|
-
fluxloop/config.py,sha256=
|
|
4
|
+
fluxloop/config.py,sha256=5mlcLiDKZ5XGV5Lt58RGEWvmSGX4BBO7lRZl0gMrC6E,6954
|
|
5
5
|
fluxloop/context.py,sha256=09VTTSnn72E0wRf55PX5j355ngKE2GXaqCYpgBVgxMM,6458
|
|
6
6
|
fluxloop/decorators.py,sha256=nfKIQpLwfMhr7A1TjtL-vppPWroPs98LsFB_1-ADfFM,15519
|
|
7
7
|
fluxloop/models.py,sha256=5AQ2jqArRGwQB91GOBVrBRb1h5gJBghl5G81EClOUp8,2399
|
|
@@ -11,7 +11,7 @@ fluxloop/storage.py,sha256=siwlbGdUpFAzdI6MMnODtkuxJyftQG9D4Phs2s5quMs,1732
|
|
|
11
11
|
fluxloop/schemas/__init__.py,sha256=przYFHTxNK7juJbqWZ2YVuCdBiMk3PB1H7T4xg3l62g,911
|
|
12
12
|
fluxloop/schemas/config.py,sha256=n__U5aduQ5dIEs4cJNGSrD1jdpd-RAb03HhdOM7KlTk,11852
|
|
13
13
|
fluxloop/schemas/trace.py,sha256=tkeYQon9pCTZLp1Ad3e-KM86xLaofIqxjHJ7l-mX0Bk,6270
|
|
14
|
-
fluxloop-0.1.
|
|
15
|
-
fluxloop-0.1.
|
|
16
|
-
fluxloop-0.1.
|
|
17
|
-
fluxloop-0.1.
|
|
14
|
+
fluxloop-0.1.2.dist-info/METADATA,sha256=KAX7Cn1gcT34Tm8C7P99gzUlG5SACDbJ-TbwN8HViyo,2320
|
|
15
|
+
fluxloop-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
fluxloop-0.1.2.dist-info/top_level.txt,sha256=-whiUKvhn6Y7-TLfqrY7fZ1Cudjk8PnrKe7h7m8cuL4,9
|
|
17
|
+
fluxloop-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|