Skip to content

Commit 92bec01

Browse files
committed
Renommage de la commande CLI en 'pycompiler-ark' et mise à jour de la terminologie vers 'PyCompiler ARK'
1 parent 1c5249a commit 92bec01

7 files changed

Lines changed: 314 additions & 26 deletions

File tree

Ui/Cli/app.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _build_impl(
8686
) -> int:
8787
if lock_file and engine_override:
8888
raise CliSpecError(
89-
"--engine cannot be used with --lock\nIf you need a different engine, create a new lock with: ark build --engine <engine_id>"
89+
"--engine cannot be used with --lock\nIf you need a different engine, create a new lock with: pycompiler-ark build --engine <engine_id>"
9090
)
9191

9292
if not as_json and verbose:
@@ -214,8 +214,8 @@ def tr(self, fr, en):
214214
# Rebuild from lock
215215
if lock_file == "__default__":
216216
raise CliSpecError(
217-
"Usage: ark build --lock <FILE_OR_LATEST>\n"
218-
"Exemple: ark build --lock latest"
217+
"Usage: pycompiler-ark build --lock <FILE_OR_LATEST>\n"
218+
"Exemple: pycompiler-ark build --lock latest"
219219
)
220220

221221
if lock_file == "latest":
@@ -335,9 +335,9 @@ def build_cli():
335335
raise RuntimeError("Click is not available")
336336

337337
@click.group(context_settings={"help_option_names": ["-h", "--help"]})
338-
@click.version_option(version=_resolve_version(), prog_name="ark")
338+
@click.version_option(version=_resolve_version(), prog_name="pycompiler-ark")
339339
def cli():
340-
"""ARK command line interface."""
340+
"""PyCompiler ARK command line interface."""
341341

342342
@cli.command("init")
343343
@click.option("--entry", required=True, type=str)
@@ -349,7 +349,7 @@ def cli():
349349
def init_cmd(
350350
entry, icon, with_venv, install_requirements, generate_requirements, as_json
351351
):
352-
"""Initialize the current directory as an ARK workspace."""
352+
"""Initialize the current directory as a PyCompiler ARK workspace."""
353353
try:
354354
payload = init_workspace(
355355
cwd=Path.cwd(),
@@ -423,24 +423,24 @@ def run_bcasl_cmd(list_plugins, verbose):
423423
@cli.command("gui")
424424
@click.option("--legacy", is_flag=True)
425425
def gui_cmd(legacy):
426-
"""Launch the ARK GUI."""
426+
"""Launch the PyCompiler ARK GUI."""
427427
if legacy:
428428
click.echo(
429-
"LIMITATION: The classic GUI does not support full UI feature integration.\nFor full functionality, use 'ark gui'."
429+
"LIMITATION: The classic GUI does not support full UI feature integration.\nFor full functionality, use 'pycompiler-ark gui'."
430430
)
431431
raise click.exceptions.Exit(launch_gui(legacy=legacy))
432432

433433
@cli.group("set")
434434
def set_group():
435-
"""Set user-level ARK paths."""
435+
"""Set user-level PyCompiler ARK paths."""
436436

437437
@cli.group("get")
438438
def get_group():
439-
"""Get user-level ARK paths."""
439+
"""Get user-level PyCompiler ARK paths."""
440440

441441
@cli.group("unset")
442442
def unset_group():
443-
"""Unset user-level ARK paths."""
443+
"""Unset user-level PyCompiler ARK paths."""
444444

445445
for key in (
446446
"user-engine-dir",
@@ -567,7 +567,7 @@ def main(argv: list[str] | None = None) -> int:
567567
install_runtime(_resolve_version(), enable_qt=should_enable_qt(args))
568568
try:
569569
cli = build_cli()
570-
result = cli.main(args=args, prog_name="ark", standalone_mode=False)
570+
result = cli.main(args=args, prog_name="pycompiler-ark", standalone_mode=False)
571571
return int(result) if isinstance(result, int) else 0
572572
except SystemExit as exc:
573573
return int(exc.code) if isinstance(exc.code, int) else 0

Ui/Cli/helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class CliSpecError(RuntimeError):
208208

209209

210210
@dataclass(slots=True)
211-
class ArkValidationResult:
211+
class PyCompilerArkValidationResult:
212212
config: dict[str, Any]
213213
warnings: list[str]
214214

@@ -219,7 +219,7 @@ class ArkValidationResult:
219219

220220

221221
def config_home() -> Path:
222-
"""Return the ARK user config root (delegates to Core.Configs)."""
222+
"""Return the PyCompiler ARK user config root (delegates to Core.Configs)."""
223223
return _config_home()
224224

225225

@@ -304,7 +304,7 @@ def init_workspace(
304304
if install_requirements:
305305
if not requirements_path.exists():
306306
raise CliSpecError(
307-
"requirements.txt not found. Run 'ark init --generate-requirements' first."
307+
"requirements.txt not found. Run 'pycompiler-ark init --generate-requirements' first."
308308
)
309309
if not venv_path.exists():
310310
builder = venv.EnvBuilder(with_pip=True)
@@ -337,7 +337,7 @@ def load_ark_config(workspace: Path) -> dict[str, Any]:
337337
raise CliSpecError(str(exc)) from exc
338338

339339

340-
def validate_ark_config(workspace: Path, config: dict[str, Any]) -> ArkValidationResult:
340+
def validate_ark_config(workspace: Path, config: dict[str, Any]) -> PyCompilerArkValidationResult:
341341
result: ArkConfigValidationResult = _validate_ark_config(workspace, config)
342342
errors = list(result.errors)
343343
warnings = list(result.warnings)
@@ -355,7 +355,7 @@ def validate_ark_config(workspace: Path, config: dict[str, Any]) -> ArkValidatio
355355
joined = "\n".join(f"- {item}" for item in errors)
356356
raise CliSpecError(f"Invalid ark.yml\n{joined}")
357357

358-
return ArkValidationResult(config=result.config, warnings=warnings)
358+
return PyCompilerArkValidationResult(config=result.config, warnings=warnings)
359359

360360

361361
def engine_version(engine_id: str) -> str:

Ui/Cli/runtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def should_enable_qt(argv: list[str] | None) -> bool:
253253

254254

255255
def is_cli_mode() -> bool:
256-
"""True when ARK runs as a terminal CLI (no Qt UI for plugins/dialogs)."""
256+
"""True when PyCompiler ARK runs as a terminal CLI (no Qt UI for plugins/dialogs)."""
257257
try:
258258
v = os.environ.get("PYCOMPILER_CLI")
259259
if v is None:
@@ -275,7 +275,7 @@ def is_noninteractive() -> bool:
275275

276276

277277
def use_rich_dialogs() -> bool:
278-
"""Use Rich console dialogs instead of Qt message boxes."""
278+
"""Use Rich console dialogs instead of Qt message boxes (for PyCompiler ARK)."""
279279
return is_cli_mode() or is_noninteractive()
280280

281281

docs/ark_main_config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This file defines the project settings used to build the normalized **BuildContext**. It lives at the workspace root and is created automatically when the workspace is first configured in the GUI, if missing.
44

5-
The configuration is loaded by `Core/Configs/` and is the primary source of truth for project metadata.
5+
The configuration is loaded by `Core/Configs/` and is the primary source of truth for PyCompiler ARK project metadata.
66

77
## Minimal Example
88

@@ -75,4 +75,4 @@ If `bcasl_enabled` is set to `false`, the entire pipeline is skipped during comp
7575

7676
## Advanced Config Editor (GUI)
7777

78-
The main GUI has a **Configurations avancées** button that opens a dedicated editor for `ark.yml`, `bcasl.yml`, and other configuration files.
78+
The main GUI has a **Configurations avancées** button that opens a dedicated editor for `ark.yml`, `bcasl.yml`, and other configuration files managed by PyCompiler ARK.

docs/contributing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# **Contributing to PyCompiler ARK**
22

3-
Thank you for your interest in contributing to ARK! This workshop is designed to be extensible through its multi-engine and pre-compile plugin systems.
3+
Thank you for your interest in contributing to PyCompiler ARK! This workshop is designed to be extensible through its multi-engine and pre-compile plugin systems.
44

55
## **Where to Start?**
66

7-
If you are a developer looking to extend ARK's functionality, please refer to the following guides:
7+
If you are a developer looking to extend PyCompiler ARK's functionality, please refer to the following guides:
88

99
- **Creating a Compilation Engine**: [docs/how_to_create_an_engine.md](how_to_create_an_engine.md)
1010
Learn how to package and register a new compiler (e.g., Py2Exe, Docker).
@@ -13,11 +13,11 @@ If you are a developer looking to extend ARK's functionality, please refer to th
1313

1414
## **Technical Specifications**
1515

16-
For a deeper dive into ARK's internal architecture, review our core specifications:
16+
For a deeper dive into PyCompiler ARK's internal architecture, review our core specifications:
1717

1818
- **BuildContext Spec**: [docs/dev_docs/ARK_BuildContext_v1.0.md](dev_docs/ARK_BuildContext_v1.0.md)
19-
- **CLI Spec**: [docs/dev_docs/ARK_Cli_v1.2.md](dev_docs/ARK_Cli_v1.2.md)
20-
- **Locking Spec**: [docs/dev_docs/ARK_Locking_v1.2.md](dev_docs/ARK_Locking_v1.2.md)
19+
- **CLI Spec**: [docs/dev_docs/PyCompiler_ARK_Cli_v1.2.md](dev_docs/PyCompiler_ARK_Cli_v1.2.md)
20+
- **Locking Spec**: [docs/dev_docs/PyCompiler_ARK_Locking_v1.2.md](dev_docs/PyCompiler_ARK_Locking_v1.2.md)
2121

2222
## **Development Workflow**
2323

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# **PyCompiler ARK CLI Specification v1.2**
2+
3+
This document defines the final, streamlined specification for the PyCompiler ARK Command Line Interface.
4+
5+
---
6+
7+
### **1. Philosophy**
8+
9+
The CLI is designed to be simple, predictable, and headless-friendly.
10+
11+
- **Unified Binary**: Use `pycompiler-ark` (or `python pycompiler_ark.py`).
12+
- **Explicit Commands**: No hidden magic; every action requires an explicit command.
13+
- **CLI-First**: All features accessible via GUI are also available via CLI.
14+
- **Reproducibility**: Guaranteed via functional locking comparison.
15+
16+
---
17+
18+
### **2. Final Commands**
19+
20+
```bash
21+
# Workspace (User)
22+
pycompiler-ark init --entry <path> [--icon <path>] [--with-venv] [--install-requirements] [--generate-requirements]
23+
pycompiler-ark build
24+
pycompiler-ark build --engine <id>
25+
pycompiler-ark build --lock [file]
26+
27+
# Execution
28+
pycompiler-ark run bcasl
29+
30+
# GUI
31+
pycompiler-ark gui
32+
pycompiler-ark gui --legacy
33+
34+
# Configuration (Developer)
35+
pycompiler-ark set user-engine-dir <path>
36+
pycompiler-ark set user-plugin-dir <path>
37+
pycompiler-ark set dev-engine-dir <path>
38+
pycompiler-ark set dev-plugin-dir <path>
39+
40+
pycompiler-ark get user-engine-dir
41+
pycompiler-ark get user-plugin-dir
42+
pycompiler-ark get dev-engine-dir
43+
pycompiler-ark get dev-plugin-dir
44+
45+
pycompiler-ark unset user-engine-dir
46+
pycompiler-ark unset user-plugin-dir
47+
pycompiler-ark unset dev-engine-dir
48+
pycompiler-ark unset dev-plugin-dir
49+
50+
# Discovery
51+
pycompiler-ark list engines
52+
pycompiler-ark list plugins
53+
54+
# Scaffolding
55+
pycompiler-ark scaffold engine <name> [--path <dir>]
56+
pycompiler-ark scaffold plugin-bcasl <name> [--path <dir>]
57+
```
58+
59+
---
60+
61+
### **3. GUI Status**
62+
63+
| GUI Mode | Command | Status |
64+
| :--- | :--- | :--- |
65+
| **IDE-like GUI** | `pycompiler-ark gui` | **Active** (Modern, full feature set) |
66+
| **Classic GUI** | `pycompiler-ark gui --legacy` | **Frozen** (Legacy maintenance only) |
67+
68+
---
69+
70+
### **4. Engine and Plugin Discovery**
71+
72+
PyCompiler ARK loads components from multiple locations in order of priority:
73+
74+
| Tier | Role | Default Location |
75+
| :--- | :--- | :--- |
76+
| **Dev** | Development | Optional (set via `pycompiler-ark set dev-*`) |
77+
| **User** | User-installed | `~/ark_user/` (created automatically) |
78+
| **Core** | Built-in engines | `ENGINES/` folder in installation root |
79+
80+
**Priority**: `Dev > User > Core`
81+
82+
---
83+
84+
### **5. Configuration (~/.arkconf/)**
85+
86+
Global user settings are stored in text files under `~/.arkconf/`:
87+
88+
- `pref.json`: Global GUI and runtime preferences.
89+
- `user_engine_dir`: Path to user-installed engines.
90+
- `user_plugin_dir`: Path to user-installed BCASL plugins.
91+
- `dev_engine_dir`: Path to active engine development.
92+
- `dev_plugin_dir`: Path to active plugin development.
93+
94+
---
95+
96+
### **6. Workspace Structure (.ark/)**
97+
98+
A initialized workspace contains a hidden `.ark/` directory:
99+
100+
- `lock/`: Immutable build snapshots and `latest.lock.yml`.
101+
- `cache/`: Internal build cache and rebuild comparison data.
102+
- `build/`: Temporary engine build artifacts.
103+
- `logs/`: Compilation and pipeline execution logs.
104+
105+
---
106+
107+
### **7. Configuration (ark.yml)**
108+
109+
The project configuration file:
110+
111+
```yaml
112+
project:
113+
name: my_app
114+
version: 1.0.0
115+
entry: src/main.py
116+
117+
workspace:
118+
exclude:
119+
- "**/__pycache__/**"
120+
121+
build:
122+
engine: nuitka
123+
output: dist/
124+
exclude:
125+
- "tests/**/*"
126+
data:
127+
- source: plugins/
128+
destination: plugins/
129+
icon: assets/icon.ico
130+
131+
plugins:
132+
bcasl_enabled: true
133+
```
134+
135+
---
136+
137+
### **8. Detailed Command Behavior**
138+
139+
#### **`pycompiler-ark init --entry <path>`**
140+
141+
Initializes the current directory as a PyCompiler ARK workspace.
142+
143+
- **Requirement**: The directory must already exist.
144+
- **Validation**: `--entry` must point to a file, not a directory.
145+
146+
#### **`pycompiler-ark build`**
147+
148+
- **Default**: Validates `ark.yml` and builds using the configured engine.
149+
- **Engine Override**: `--engine <id>` uses a temporary engine without modifying `ark.yml`.
150+
- **Reproducible Rebuild**: `--lock [file]` rebuilds strictly from a lock file (default: `.ark/lock/latest.lock.yml`).
151+
- **Git State**: Automatically verifies if the current branch and commit match the lock. Offers automatic checkout on Linux.
152+
- **Integrity Check**: PyCompiler ARK generates a shadow lock from the rebuild environment and performs a **Functional Equivalence** comparison. Detailed diffs are displayed in case of mismatch.
153+
- **Constraint**: `--engine` and `--lock` cannot be used together.
154+
155+
---
156+
157+
### **9. Summary Rules**
158+
159+
- **CLI1**: No interactive questions; behavior is strictly deterministic.
160+
- **CLI2**: `pycompiler-ark init` only operates on the current working directory.
161+
- **CLI3**: All build artifacts and metadata stay inside the workspace `.ark/` folder.
162+
- **CLI4**: Engines and plugins follow a clear `dev > user > core` priority.
163+
164+
---
165+
*End of Specification v1.2*

0 commit comments

Comments
 (0)