satisfactoscript 0.5.2__tar.gz → 0.5.4__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.
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/PKG-INFO +1 -1
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/pyproject.toml +1 -1
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/core/core.py +37 -28
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/PKG-INFO +1 -1
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/README.md +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/setup.cfg +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/__init__.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/agentic/__init__.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/agentic/agent.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/core/__init__.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/core/config.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/core/loaders.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/core/registry.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/semantic/__init__.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript/semantic/semantic.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/SOURCES.txt +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/dependency_links.txt +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/requires.txt +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/top_level.txt +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/tests/test_config.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/tests/test_core.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/tests/test_dummy.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/tests/test_loaders.py +0 -0
- {satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/tests/test_registry.py +0 -0
|
@@ -159,15 +159,14 @@ class SatisfactoEngine:
|
|
|
159
159
|
# ======================================================================
|
|
160
160
|
# 0. CHARGEMENT DES VARIABLES D'ENVIRONNEMENT (.env)
|
|
161
161
|
# ======================================================================
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
env_path = os.path.join(project_root, ".env")
|
|
162
|
+
# Dynamically find the .env file starting from the current working directory
|
|
163
|
+
env_path = self._find_file_upwards(".env")
|
|
165
164
|
|
|
166
|
-
if
|
|
165
|
+
if env_path:
|
|
167
166
|
load_dotenv(env_path)
|
|
168
|
-
print(" 🔒 [Init] Sécurité : Variables d'environnement chargées depuis
|
|
167
|
+
print(f" 🔒 [Init] Sécurité : Variables d'environnement chargées depuis {env_path}")
|
|
169
168
|
else:
|
|
170
|
-
print(" ⚠️ [Init] Aucun fichier .env trouvé
|
|
169
|
+
print(" ⚠️ [Init] Aucun fichier .env trouvé dans le répertoire courant ou ses parents.")
|
|
171
170
|
|
|
172
171
|
# ======================================================================
|
|
173
172
|
# 1. AUTO-DÉTECTION DE SPARK (Compatible Web & PyCharm/Local)
|
|
@@ -193,7 +192,12 @@ class SatisfactoEngine:
|
|
|
193
192
|
# This relies on the environment having valid Databricks configuration
|
|
194
193
|
# e.g., DATABRICKS_HOST, DATABRICKS_TOKEN, DATABRICKS_CLUSTER_ID
|
|
195
194
|
# or a valid ~/.databrickscfg file.
|
|
196
|
-
|
|
195
|
+
# We pass a specific cluster_id if it exists in env, else it relies on profile
|
|
196
|
+
conf = Config()
|
|
197
|
+
if os.getenv("DATABRICKS_CLUSTER_ID"):
|
|
198
|
+
conf.cluster_id = os.getenv("DATABRICKS_CLUSTER_ID")
|
|
199
|
+
|
|
200
|
+
self.spark = DatabricksSession.builder.sdkConfig(conf).getOrCreate()
|
|
197
201
|
print(" [Init] 🚀 Remote DatabricksSession (Databricks Connect) initialized.")
|
|
198
202
|
except Exception as e:
|
|
199
203
|
print(f" [Init] ⚠️ Databricks Connect detection failed: {e}. Falling back to standard Spark.")
|
|
@@ -212,28 +216,14 @@ class SatisfactoEngine:
|
|
|
212
216
|
if config_path:
|
|
213
217
|
self._load_config_from_yaml(config_path)
|
|
214
218
|
else:
|
|
215
|
-
# Recherche automatique basée sur l'emplacement
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
candidates = [
|
|
222
|
-
os.path.join(project_root, "config.yaml"), # ../config.yaml (Standard)
|
|
223
|
-
os.path.join(os.getcwd(), "config.yaml"), # ./config.yaml
|
|
224
|
-
os.path.join(os.getcwd(), "../..", "config.yaml") # ../config.yaml
|
|
225
|
-
]
|
|
226
|
-
|
|
227
|
-
found = False
|
|
228
|
-
for path in candidates:
|
|
229
|
-
if os.path.exists(path):
|
|
230
|
-
self._load_config_from_yaml(path)
|
|
231
|
-
found = True
|
|
232
|
-
break
|
|
233
|
-
|
|
234
|
-
if not found:
|
|
219
|
+
# Recherche automatique basée sur l'emplacement d'exécution
|
|
220
|
+
found_config_path = self._find_file_upwards("config.yaml")
|
|
221
|
+
|
|
222
|
+
if found_config_path:
|
|
223
|
+
self._load_config_from_yaml(found_config_path)
|
|
224
|
+
else:
|
|
235
225
|
raise FileNotFoundError(
|
|
236
|
-
|
|
226
|
+
"CRITICAL: 'config.yaml' not found in current directory or any parent directory. "
|
|
237
227
|
"Please check file location or pass 'config_path' explicitly."
|
|
238
228
|
)
|
|
239
229
|
|
|
@@ -259,6 +249,25 @@ class SatisfactoEngine:
|
|
|
259
249
|
|
|
260
250
|
print(f"✅ Framework Ready. Env: {self.env} | DB: {self.db} | Suffix: '{self.schema_suffix}'")
|
|
261
251
|
|
|
252
|
+
def _find_file_upwards(self, filename):
|
|
253
|
+
"""
|
|
254
|
+
Searches for a file starting from current working directory and moving up.
|
|
255
|
+
Returns absolute path if found, else None.
|
|
256
|
+
"""
|
|
257
|
+
current_dir = os.getcwd()
|
|
258
|
+
|
|
259
|
+
# Loop until we hit the root of the filesystem
|
|
260
|
+
while True:
|
|
261
|
+
check_path = os.path.join(current_dir, filename)
|
|
262
|
+
if os.path.exists(check_path):
|
|
263
|
+
return check_path
|
|
264
|
+
|
|
265
|
+
parent_dir = os.path.dirname(current_dir)
|
|
266
|
+
if parent_dir == current_dir:
|
|
267
|
+
# We hit the filesystem root (e.g. /) without finding the file
|
|
268
|
+
return None
|
|
269
|
+
current_dir = parent_dir
|
|
270
|
+
|
|
262
271
|
def _load_config_from_yaml(self, config_path):
|
|
263
272
|
"""
|
|
264
273
|
Loads configuration from YAML and determines the active environment.
|
|
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
|
{satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/requires.txt
RENAMED
|
File without changes
|
{satisfactoscript-0.5.2 → satisfactoscript-0.5.4}/src/satisfactoscript.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|