tasktree 0.0.16__py3-none-any.whl → 0.0.17__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.
- tasktree/parser.py +40 -2
- {tasktree-0.0.16.dist-info → tasktree-0.0.17.dist-info}/METADATA +1 -1
- {tasktree-0.0.16.dist-info → tasktree-0.0.17.dist-info}/RECORD +5 -5
- {tasktree-0.0.16.dist-info → tasktree-0.0.17.dist-info}/WHEEL +0 -0
- {tasktree-0.0.16.dist-info → tasktree-0.0.17.dist-info}/entry_points.txt +0 -0
tasktree/parser.py
CHANGED
|
@@ -232,7 +232,7 @@ class Recipe:
|
|
|
232
232
|
# (CLI will provide its own "Task not found" error)
|
|
233
233
|
try:
|
|
234
234
|
reachable_tasks = collect_reachable_tasks(self.tasks, root_task)
|
|
235
|
-
variables_to_eval = collect_reachable_variables(self.tasks, reachable_tasks)
|
|
235
|
+
variables_to_eval = collect_reachable_variables(self.tasks, self.environments, reachable_tasks)
|
|
236
236
|
except ValueError:
|
|
237
237
|
# Root task not found - fall back to eager evaluation
|
|
238
238
|
# This allows the recipe to be parsed even with invalid task names
|
|
@@ -1311,15 +1311,17 @@ def collect_reachable_tasks(tasks: dict[str, Task], root_task: str) -> set[str]:
|
|
|
1311
1311
|
|
|
1312
1312
|
def collect_reachable_variables(
|
|
1313
1313
|
tasks: dict[str, Task],
|
|
1314
|
+
environments: dict[str, Environment],
|
|
1314
1315
|
reachable_task_names: set[str]
|
|
1315
1316
|
) -> set[str]:
|
|
1316
1317
|
"""Extract variable names used by reachable tasks.
|
|
1317
1318
|
|
|
1318
|
-
Searches for {{ var.* }} placeholders in task definitions to determine
|
|
1319
|
+
Searches for {{ var.* }} placeholders in task and environment definitions to determine
|
|
1319
1320
|
which variables are actually needed for execution.
|
|
1320
1321
|
|
|
1321
1322
|
Args:
|
|
1322
1323
|
tasks: Dictionary mapping task names to Task objects
|
|
1324
|
+
environments: Dictionary mapping environment names to Environment objects
|
|
1323
1325
|
reachable_task_names: Set of task names that will be executed
|
|
1324
1326
|
|
|
1325
1327
|
Returns:
|
|
@@ -1398,6 +1400,42 @@ def collect_reachable_variables(
|
|
|
1398
1400
|
for match in var_pattern.finditer(val):
|
|
1399
1401
|
variables.add(match.group(1))
|
|
1400
1402
|
|
|
1403
|
+
if task.env:
|
|
1404
|
+
if task.env in environments:
|
|
1405
|
+
env = environments[task.env]
|
|
1406
|
+
|
|
1407
|
+
if env.dockerfile and env.dockerfile != "":
|
|
1408
|
+
for match in var_pattern.finditer(env.dockerfile):
|
|
1409
|
+
variables.add(match.group(1))
|
|
1410
|
+
|
|
1411
|
+
if env.context != "":
|
|
1412
|
+
for match in var_pattern.finditer(env.context):
|
|
1413
|
+
variables.add(match.group(1))
|
|
1414
|
+
|
|
1415
|
+
if 0 != len(env.volumes):
|
|
1416
|
+
for v in env.volumes:
|
|
1417
|
+
for match in var_pattern.finditer(v):
|
|
1418
|
+
variables.add(match.group(1))
|
|
1419
|
+
|
|
1420
|
+
if 0 != len(env.ports):
|
|
1421
|
+
for p in env.ports:
|
|
1422
|
+
for match in var_pattern.finditer(p):
|
|
1423
|
+
variables.add(match.group(1))
|
|
1424
|
+
|
|
1425
|
+
if 0 != len(env.env_vars):
|
|
1426
|
+
for k, v in env.env_vars.items():
|
|
1427
|
+
for match in var_pattern.finditer(v):
|
|
1428
|
+
variables.add(match.group(1))
|
|
1429
|
+
|
|
1430
|
+
if env.working_dir != "":
|
|
1431
|
+
for match in var_pattern.finditer(env.working_dir):
|
|
1432
|
+
variables.add(match.group(1))
|
|
1433
|
+
|
|
1434
|
+
if 0 != len(env.extra_args):
|
|
1435
|
+
for e in env.extra_args:
|
|
1436
|
+
for match in var_pattern.finditer(e):
|
|
1437
|
+
variables.add(match.group(1))
|
|
1438
|
+
|
|
1401
1439
|
return variables
|
|
1402
1440
|
|
|
1403
1441
|
|
|
@@ -4,11 +4,11 @@ tasktree/docker.py,sha256=qvja8G63uAcC73YMVY739egda1_CcBtoqzm0qIJU_Q8,14443
|
|
|
4
4
|
tasktree/executor.py,sha256=QQcABThmof0MLTtwpJKpyqh80hr3YRIqqs3NZ-Ry-Bk,44873
|
|
5
5
|
tasktree/graph.py,sha256=yITp71RfhJ7sdC-2zRf89SHYZqQyF3XVAnaqX-XnMdE,15821
|
|
6
6
|
tasktree/hasher.py,sha256=0GrnCfwAXnwq_kpnHFFb12B5_2VFNXx6Ng7hTdcCyXo,4415
|
|
7
|
-
tasktree/parser.py,sha256=
|
|
7
|
+
tasktree/parser.py,sha256=5c3I2AUDJInGs6KLEIrxXOHnFo5_Ey4VbrzparUloQs,88755
|
|
8
8
|
tasktree/state.py,sha256=Cktl4D8iDZVd55aO2LqVyPrc-BnljkesxxkcMcdcfOY,3541
|
|
9
9
|
tasktree/substitution.py,sha256=qG7SyEHn1PAKteWA0AgA1dUNbJfwQTupCLRq9FvOBD0,10724
|
|
10
10
|
tasktree/types.py,sha256=R_YAyO5bMLB6XZnkMRT7VAtlkA_Xx6xu0aIpzQjrBXs,4357
|
|
11
|
-
tasktree-0.0.
|
|
12
|
-
tasktree-0.0.
|
|
13
|
-
tasktree-0.0.
|
|
14
|
-
tasktree-0.0.
|
|
11
|
+
tasktree-0.0.17.dist-info/METADATA,sha256=jtZiWlJCrszYT4FluXb7VTcZY_WEhtclu3Iqzglov9c,37234
|
|
12
|
+
tasktree-0.0.17.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
tasktree-0.0.17.dist-info/entry_points.txt,sha256=lQINlvRYnimvteBbnhH84A9clTg8NnpEjCWqWkqg8KE,40
|
|
14
|
+
tasktree-0.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|