Skip to content

Commit 905cd04

Browse files
committed
Documentation: clarification sur build.exclude (packages uniquement) et typage des data
1 parent 964c2b3 commit 905cd04

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

docs/ark_main_config.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,61 @@ workspace:
1616
exclude:
1717
- ".git/**"
1818
- "venv/**"
19+
- "**/__pycache__/**"
1920

2021
build:
2122
engine: pyinstaller
2223
output: dist/
2324
icon: assets/icon.ico
2425
exclude:
25-
- "tests/**"
26+
- "tkinter"
27+
- "unittest"
2628
data:
2729
- source: assets/
2830
destination: assets/
31+
type: dir
32+
- source: config.json
33+
destination: config.json
34+
type: file
2935

3036
plugins:
3137
bcasl_enabled: true
3238
```
3339
40+
## Build Data Mappings
41+
42+
The `build.data` section defines external files and directories to be bundled with the executable. Each entry must specify:
43+
44+
- `source`: The relative path to the asset.
45+
- `destination`: The relative path where the asset will be placed in the final bundle.
46+
- `type`: Explicitly categorize the asset:
47+
- `dir`: For entire directories.
48+
- `file`: For single files.
49+
50+
> **Note**: For backward compatibility, `type` defaults to `dir` if omitted, but explicit typing is highly recommended.
51+
52+
## Build Exclusions vs Workspace Exclusions
53+
54+
It is critical to distinguish between these two exclusion sections. Using them interchangeably is a common source of build failures.
55+
56+
### 1. `workspace.exclude` (UI Filter)
57+
Used exclusively for the **GUI workspace view filter**.
58+
- **Purpose**: Hide files and folders from the file list in the user interface.
59+
- **Usage**: Perfect for `.git/`, `venv/`, `__pycache__/`, or other technical folders you don't want to see in the GUI.
60+
61+
### 2. `build.exclude` (Python Packages)
62+
Determines which **Python packages/modules** are ignored by the compiler.
63+
- **Purpose**: Prevent specific Python libraries from being bundled.
64+
- **Restriction**: This is **NOT** a general folder excluder. It should **NEVER** contain technical patterns like `*.pyc`, `__pycache__`, or `.git`. These are handled automatically by the Core or should be hidden via `workspace.exclude`.
65+
66+
⚠️ **CRITICAL WARNING: Name Collisions**
67+
Patterns in `build.exclude` are passed to engines (like Nuitka or PyInstaller) as **logical module exclusions**.
68+
69+
If you have a local folder named `venv` (your virtual environment) and you add `venv` to `build.exclude` thinking you are excluding a directory, you are actually telling the compiler: *"Do not bundle the Python package named 'venv'"*.
70+
If your project or any dependency uses `import venv` (the standard library), your application **will crash** because the library was removed from the bundle.
71+
72+
**Rule of thumb**: Only use `build.exclude` for real Python modules you want to remove (e.g., `tkinter`, `unittest`, or a specific large sub-package). For everything else, use `workspace.exclude`.
73+
3474
## Build Entrypoint
3575

3676
`project.entry` defines the primary script to compile. It must be a path relative to the workspace root.

docs/dev_docs/PyCompiler_ARK_Locking_v1.2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ project:
4848

4949
workspace:
5050
exclude_patterns: # Copied from build.exclude (legacy support)
51-
- tests/**/*
52-
- "**/__pycache__/**"
51+
- tkinter
52+
- unittest
5353

5454
build:
5555
output: dist/ # Copied from build.output
5656
exclude: # Copied from build.exclude
57-
- tests/**/*
58-
- "**/__pycache__/**"
57+
- tkinter
58+
- unittest
5959
data: # Copied from build.data
6060
- source: assets/
6161
destination: assets/

0 commit comments

Comments
 (0)