Skip to content

Commit f7f62fa

Browse files
committed
fix: assurer que build.include est préservé lors de la normalisation et inclus dans les snapshots (lock files)
1 parent 3c2faa4 commit f7f62fa

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

Core/Configs/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"output": "dist/",
106106
"data": [],
107107
"exclude": [],
108+
"include": [],
108109
},
109110
}
110111

@@ -283,6 +284,7 @@ def normalize_ark_config(config: dict[str, Any]) -> dict[str, Any]:
283284
if isinstance(item, dict)
284285
],
285286
"exclude": _normalize_build_exclude(build.get("exclude")),
287+
"include": _normalize_build_exclude(build.get("include")),
286288
}
287289
icon_value = build.get("icon")
288290
if isinstance(icon_value, str) and icon_value.strip():
@@ -365,6 +367,10 @@ def validate_ark_config(
365367
if not isinstance(build_exclude_patterns, list):
366368
errors.append("build.exclude must be a list")
367369

370+
build_include_patterns = build.get("include")
371+
if not isinstance(build_include_patterns, list):
372+
errors.append("build.include must be a list")
373+
368374
return ArkConfigValidationResult(
369375
config=normalized, warnings=warnings, errors=errors
370376
)

Core/Locking/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def build_lock_payload(
200200
config = normalize_ark_config(config)
201201
build = config.get("build") or {}
202202
exclude_patterns = list(build.get("exclude") or [])
203+
include_packages = list(build.get("include") or [])
203204
project = config.get("project") or {}
204205
ensure_workspace_layout(workspace)
205206
lock_dir = workspace / ".ark" / "lock"
@@ -221,6 +222,7 @@ def build_lock_payload(
221222
"output": build.get("output"),
222223
"data": list(build.get("data") or []),
223224
"exclude": exclude_patterns,
225+
"include": include_packages,
224226
**({"icon": build.get("icon")} if build.get("icon") else {}),
225227
},
226228
"engine": {

tests/test_business_logic.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,21 @@ def test_get_git_commit_hash(tmp_path):
6565

6666

6767
def test_build_lock_payload_with_git(tmp_path):
68-
"""Test that build_lock_payload includes git commit."""
68+
"""Test that build_lock_payload includes git commit and include list."""
6969
config = {
7070
"project": {"name": "Test", "version": "1.0.0", "entry": "main.py"},
71-
"build": {"engine": "nuitka"},
71+
"build": {
72+
"engine": "nuitka",
73+
"include": ["requests", "rich"]
74+
},
7275
}
7376
with patch("Core.Locking.get_git_commit_hash") as mock_git:
7477
mock_git.return_value = "git_hash_123"
7578
payload = build_lock_payload(tmp_path, config, engine_id="nuitka")
7679

7780
assert payload["project"]["git_commit"] == "git_hash_123"
7881
assert payload["engine"]["name"] == "nuitka"
82+
assert payload["build"]["include"] == ["requests", "rich"]
7983

8084

8185
def test_check_internet_connection_success():

0 commit comments

Comments
 (0)