Skip to content

Commit 3c2faa4

Browse files
committed
docs: aligner la configuration build v1.5.0
1 parent 3a7772b commit 3c2faa4

6 files changed

Lines changed: 65 additions & 16 deletions

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Build Python apps with a predictable workflow, a configurable pre-compile pipeli
1919
- **BuildContext-driven builds**: engines receive a normalized project context, abstracting away the source of configuration (YAML vs. Lock files).
2020
- **Multi-engine support**: switch between PyInstaller, Nuitka, and cx_Freeze seamlessly.
2121
- **Extensible SDKs**: create new engines and BCASL plugins using simplified, consolidated APIs.
22-
- **Auto-detection for tricky dependencies**: engine-specific auto-args based on requirements or import scanning.
22+
- **Zero-Config auto-mapping for 80+ libraries**: automatic import detection covers major AI, modern web, data science, and automation stacks, with engine-specific arguments applied without manual tuning.
23+
- **Simplified build inclusions**: `build.include` forces package bundling and ARK translates it automatically per engine.
2324
- **Workspace-first UI**: filter files, manage exclusions, and follow progress and logs in one place.
2425
- **Venv-aware execution**: engines can use the project virtual environment automatically.
2526
- **Theme-aware dynamic UI**: 100% dynamic integration using QPalette and themed SVGs.
@@ -136,7 +137,7 @@ python3 pycompiler_ark.py init --entry main.py --json
136137

137138
## Configuration
138139

139-
- **`ark.yml`**: Project metadata, build entrypoint, build/workspace exclusions, and global BCASL activation.
140+
- **`ark.yml`**: Project metadata, build entrypoint, build include/exclude rules, and global BCASL activation.
140141
- **`bcasl.yml`**: Detailed BCASL pipeline configuration, plugin settings, and execution order.
141142

142143
---

docs/ark_main_config.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ build:
2222
engine: pyinstaller
2323
output: dist/
2424
icon: assets/icon.ico
25+
include:
26+
- "ma_bibliotheque"
2527
exclude:
2628
- "tkinter"
2729
- "unittest"
@@ -64,12 +66,37 @@ Determines which **Python packages/modules** are ignored by the compiler.
6466
- **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`.
6567

6668
⚠️ **CRITICAL WARNING: Name Collisions**
67-
Patterns in `build.exclude` are passed to engines (like Nuitka or PyInstaller) as **logical module exclusions**.
69+
Entries in `build.exclude` are passed to engines (like Nuitka or PyInstaller) as **logical package exclusions**.
6870

6971
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'"*.
7072
If your project or any dependency uses `import venv` (the standard library), your application **will crash** because the library was removed from the bundle.
7173

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`.
74+
**Rule of thumb**: Only use `build.exclude` for real Python packages you want to remove (e.g., `tkinter`, `unittest`, or a specific large sub-package). For everything else, use `workspace.exclude`.
75+
76+
## Build Inclusions vs Build Exclusions
77+
78+
ARK v1.5.0 introduces a dedicated `build.include` section to force package inclusion during compilation.
79+
80+
```yaml
81+
build:
82+
include:
83+
- "ma_bibliotheque"
84+
- "langchain"
85+
exclude:
86+
- "unittest"
87+
```
88+
89+
- `build.include` forces Python packages to be bundled even when automatic detection is not enough.
90+
- `build.exclude` ignores Python packages that should not be bundled.
91+
- `build.include` is the complement of `build.exclude`, not a UI filter and not a generic file/folder rule.
92+
93+
ARK translates `build.include` automatically according to the selected engine:
94+
95+
- Nuitka: `--include-package`
96+
- PyInstaller: `--collect-all`
97+
- cx_Freeze: `--includes`
98+
99+
This keeps the configuration zero-config for the user while preserving engine-specific control under the hood.
73100

74101
## Build Entrypoint
75102

@@ -95,12 +122,13 @@ The fields in `ark.yml` are mapped directly to the `BuildContext` data structure
95122
| :--- | :--- |
96123
| `project.name` | `project_name` |
97124
| `project.entry` | `entry_point` |
125+
| `build.include` | `include_packages` |
98126
| `build.exclude` | `exclude_patterns` |
99127
| `build.output` | `output_dir` |
100128
| `build.data` | `data_mappings` |
101129
| `build.icon` | `icon` |
102130

103-
> **Note**: `workspace.exclude` is used only for the GUI workspace view filter. `build.exclude` determines which files are ignored during compilation and BCASL phases.
131+
> **Note**: `workspace.exclude` is used only for the GUI workspace view filter. `build.exclude` determines which Python packages are ignored during compilation and BCASL phases, while `build.include` forces package bundling when needed.
104132

105133
## Plugins Configuration
106134

@@ -116,3 +144,6 @@ If `bcasl_enabled` is set to `false`, the entire pipeline is skipped during comp
116144
## Advanced Config Editor (GUI)
117145

118146
The main GUI has a **Configurations avancées** button that opens a dedicated editor for `ark.yml` managed by PyCompiler ARK.
147+
148+
- A dedicated **Inclusions Build** field is now available for `build.include`.
149+
- The **Exclusions Build** label now explicitly means "Python packages to ignore" to avoid ambiguity with workspace filters.

docs/dev_docs/PyCompiler_ARK_BuildContext_v1.0.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class BuildContext:
3838
project_name: str # Name of the project (used for executable naming)
3939
entry_point: str # Main script path (relative to workspace root)
4040
output_dir: str # Directory where artifacts should be placed
41-
exclude_patterns: list # List of glob patterns for files to ignore
41+
exclude_patterns: list # List of Python packages to ignore
42+
include_packages: list # List of Python packages to force into the bundle
4243
data_mappings: list # List of source/destination/type dicts for raw assets
4344
icon: str | None # Optional path to an icon file
4445

@@ -57,7 +58,8 @@ Each dictionary in `data_mappings` follows this structure:
5758
| `project_name` | `project.name` | `project.name` |
5859
| `entry_point` | `project.entry` | `project.entry` |
5960
| `output_dir` | `build.output` | `build.output` |
60-
| `exclude_patterns` | `build.exclude` | `build.exclude` (or `workspace.exclude_patterns` fallback) |
61+
| `include_packages` | `build.include` | `build.include` |
62+
| `exclude_patterns` | `build.exclude` | `build.exclude` |
6163
| `data_mappings` | `build.data` | `build.data` |
6264
| `icon` | `build.icon` | `build.icon` |
6365

@@ -70,9 +72,10 @@ An engine implementation MUST adhere to the following rules when processing a `B
7072
1. **Name Application**: Use `project_name` for the final executable (e.g., `MyApp.exe` or `MyApp`).
7173
2. **Entry Point**: Treat `entry_point` as the primary script to compile/bundle.
7274
3. **Output Path**: Place all generated artifacts and temporary files inside `output_dir`.
73-
4. **Exclusions**: Respect `exclude_patterns` by preventing those modules/files from being bundled.
74-
5. **Assets**: Copy all items defined in `data_mappings` from their source to the appropriate relative destination within the bundle.
75-
6. **Icon**: Apply the file specified in `icon` to the executable metadata/resource if supported by the target OS.
75+
4. **Inclusions**: Respect `include_packages` by forcing those packages to be bundled, even when the engine would not infer them automatically.
76+
5. **Exclusions**: Respect `exclude_patterns` by preventing the listed Python packages from being bundled.
77+
6. **Assets**: Copy all items defined in `data_mappings` from their source to the appropriate relative destination within the bundle.
78+
7. **Icon**: Apply the file specified in `icon` to the executable metadata/resource if supported by the target OS.
7679

7780
---
7881

@@ -89,11 +92,14 @@ class MyEngine(CompilerEngine):
8992
def build_command(self, context: BuildContext) -> list[str]:
9093
# Start with base command
9194
cmd = ["nuitka", context.entry_point]
95+
96+
# Force package inclusions
97+
for package in context.include_packages:
98+
cmd.append(f"--include-package={package}")
9299

93100
# Convert exclusions
94-
for pattern in context.exclude_patterns:
95-
module = pattern.replace("/**/*", "").replace("**/*", "")
96-
cmd.append(f"--nofollow-import-to={module}")
101+
for package in context.exclude_patterns:
102+
cmd.append(f"--nofollow-import-to={package}")
97103

98104
# Add data files
99105
for mapping in context.data_mappings:

docs/dev_docs/PyCompiler_ARK_Locking_v1.2.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ project:
4747
git_branch: main # Current git branch name
4848

4949
workspace:
50-
exclude_patterns: # Copied from build.exclude (legacy support)
50+
exclude_patterns: # Workspace filter snapshot
5151
- tkinter
5252
- unittest
5353

5454
build:
5555
output: dist/ # Copied from build.output
56-
exclude: # Copied from build.exclude
56+
include: # Copied from build.include
57+
- langchain
58+
exclude: # Python packages to ignore, copied from build.exclude
5759
- tkinter
5860
- unittest
5961
data: # Copied from build.data
@@ -104,7 +106,7 @@ A build is considered equivalent if the following sections match exactly:
104106
1. **Engine**: name, version, and full configuration (`engine.config`).
105107
2. **Dependencies**: all package versions must match.
106108
3. **Project**: name, version, entry point, and Git commit.
107-
4. **Build**: output path, data mappings, exclusion patterns, and icon.
109+
4. **Build**: output path, data mappings, inclusion packages, package exclusions, and icon.
108110
5. **Platform**: OS, architecture, and Python version.
109111

110112
**Ignored fields**: `build_id`, `git_branch`, `resolved_command`, and other volatile metadata.

docs/how_to_create_a_bc_plugin.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Key properties and methods.
141141
- `name`: Workspace folder name.
142142
- `config`: Full `bcasl.yml` configuration dictionary.
143143
- `build_context`: `BuildContext` with compilation settings, when available.
144+
- `build_context.include_packages`: Packages that ARK has been told to force into the bundle via `build.include`.
144145
- `file_patterns`: Configured include patterns.
145146
- `exclude_patterns`: Configured exclude patterns.
146147
- `iter_files(include, exclude)`: Optimized iterator that respects exclusions by default.

docs/how_to_create_an_engine.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ The auto-builder is integrated into the core compilation pipeline. It can read
356356
folder, or the `PYCOMPILER_MAPPING` environment variable to generate options
357357
from detected modules.
358358

359+
ARK v1.5.0 expands this layer into a Zero-Config auto-mapping system covering
360+
80+ widely used libraries across AI, modern web, data science, and automation.
361+
When ARK detects an import, it applies the engine-specific flags automatically,
362+
so engine authors only need to fill the gaps that are not covered by the core
363+
mapping catalog.
364+
359365
You no longer need to call `compute_auto_for_engine` manually in your `build_command`. The core runner will:
360366

361367
1. Prefer `requirements.txt` or `requirements.in` when present.
@@ -384,6 +390,8 @@ Key points.
384390
- Top-level keys are package names.
385391
- Engine values accept `str`, `list[str]`, or `dict` with `args` or `flags`.
386392
- `"{import_name}"` is replaced by the matched import name.
393+
- Use `build.include` when a package must be bundled even if the core mapping
394+
or import scanner does not trigger it automatically.
387395
- For advanced logic, expose `AUTO_BUILDER`, `get_auto_builder()`, or
388396
`register_auto_builder()` in `engines/<engine_id>/auto_plugins.py`.
389397

0 commit comments

Comments
 (0)