Skip to content

Commit 3d49ad7

Browse files
committed
refactor: renommage de sepc_helpers.py to helpers.py et restrition de la logiuqe cli obsolete de bcasl et suppr des ref à onlymod
1 parent a08b6d1 commit 3d49ad7

9 files changed

Lines changed: 10 additions & 502 deletions

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ Build Python apps with a predictable workflow, a configurable pre-compile pipeli
2020
- **Auto-detection for tricky dependencies**: engine-specific auto-args based on requirements or import scanning.
2121
- **Workspace-first UI**: filter files, manage exclusions, and follow progress and logs in one place.
2222
- **Venv-aware execution**: engines can use the project virtual environment automatically.
23-
- **Structured CLI**: explicit `gui`, `engine`, `workspace`, `doctor`, and `scaffold` commands, with JSON output on key headless paths.
24-
- **Standalone tools**: dedicated BCASL and Engines managers, plus CLI entry points and dry-run support.
23+
- **Structured CLI**:
2524
- **Extensible SDKs**: create new engines and BCASL plugins with the provided SDKs.
2625
- **Theme-aware dynamic colors and SVG icons**: 100% dynamic UI integration using QPalette and themed SVGs.
2726
- **Customizable**: theming and translations out of the box.
@@ -129,17 +128,9 @@ python pycompiler_ark.py init --entry main.py --json
129128

130129
## How it works
131130

132-
- [Changelog](CHANGELOG.md)
133-
- [Release process](docs/release_process.md)
134-
- [Release notes v1.0.0](docs/releases/v1.0.0.md)
135-
- [Architecture overview](docs/architecture.md)
136131
- [Contributing guide](docs/contributing.md)
137-
- [CI/CD with ARK CLI](docs/ci_cd_ark_cli.md)
138-
- [Dependency analyzer](docs/dependency_analyzer.md)
139132
- [How to create an engine](docs/how_to_create_an_engine.md)
140133
- [How to create a BC plugin](docs/how_to_create_a_bc_plugin.md)
141-
- [Dedicated interactive CLI (`--cli`)](docs/dedicated_cli.md)
142-
- [IDE-like main GUI (`gui main --ide`)](docs/ide_like_gui.md)
143134

144135
---
145136

@@ -160,7 +151,6 @@ python pycompiler_ark.py init --entry main.py --json
160151
- `Plugins/` — BCASL plugins.
161152
- `Plugins_SDK/` — plugin SDK.
162153
- `bcasl/` — BCASL core.
163-
- `OnlyMod/` — standalone tools (BCASL and Engines).
164154
- `Ui/Forms/` — Qt Designer UI forms.
165155
- `Ui/Forms/classic_main_window.ui` — default main layout
166156
- `Ui/Forms/ide_main_window.ui` — IDE-like layout

Ui/Cli/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .runtime import install_runtime, should_enable_qt
99

10-
from .spec_helpers import (
10+
from .helpers import (
1111
CliSpecError,
1212
build_context_object_from_ark_config,
1313
build_context_object_from_lock,
Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
import subprocess
45
import venv
56
from dataclasses import dataclass
@@ -295,94 +296,8 @@ def scaffold_plugin_payload(name: str, root_dir: str | None = None) -> dict[str,
295296

296297

297298
def run_bcasl_headless(args: list[str]) -> int:
298-
if not args or args[0] in ("help", "-h", "--help"):
299-
print("Usage: ark run bcasl [--timeout SECONDS] [--list-plugins]")
300-
return 0
301-
302-
sub = str(args[0]).lower()
303-
if sub == "list":
304-
payload = list_plugins_payload()
305-
plugins = list(payload.get("plugins", []))
306-
print(f"Available BCASL plugins ({len(plugins)}):")
307-
for plugin in plugins:
308-
print(f" - {plugin['id']} ({plugin['name']}) v{plugin['version']}")
309-
return 0
310-
311-
if sub != "run":
312-
print(f"Unknown BCASL subcommand: {sub}")
313-
return 2
314-
315-
workspace: str | None = None
316-
timeout = 0.0
317-
i = 1
318-
while i < len(args):
319-
tok = args[i]
320-
if tok in ("-w", "--workspace"):
321-
if i + 1 >= len(args):
322-
print("Missing workspace path after --workspace")
323-
return 2
324-
workspace = str(Path(args[i + 1]).expanduser())
325-
i += 2
326-
continue
327-
if tok == "--timeout":
328-
if i + 1 >= len(args):
329-
print("Missing value after --timeout")
330-
return 2
331-
try:
332-
timeout = float(args[i + 1])
333-
except ValueError:
334-
print("Timeout must be a number.")
335-
return 2
336-
i += 2
337-
continue
338-
if workspace is None and not tok.startswith("-"):
339-
workspace = str(Path(tok).expanduser())
340-
i += 1
341-
continue
342-
print(f"Unknown option for bcasl run: {tok}")
343-
return 2
344-
345-
if not workspace:
346-
print("Usage: bcasl run <workspace> [--timeout SECONDS]")
347-
return 2
348-
349-
ws_path = Path(workspace)
350-
if not ws_path.exists() or not ws_path.is_dir():
351-
print(f"Invalid workspace: {workspace}")
352-
return 1
353-
354-
try:
355-
from OnlyMod.BcaslOnlyMod.app import BcaslOnlyModApp
356-
except Exception as exc:
357-
print(f"Unable to load BCASL module: {exc}")
358-
return 1
359-
360-
try:
361-
app = BcaslOnlyModApp(
362-
workspace_dir=str(ws_path),
363-
language="en",
364-
theme="dark",
365-
headless=True,
366-
)
367-
except Exception as exc:
368-
print(f"Failed to initialize BCASL mode: {exc}")
369-
return 1
370-
371-
report = app.run_plugins(
372-
workspace_dir=str(ws_path),
373-
timeout=timeout,
374-
log_callback=lambda msg: print(f"[BCASL] {msg}"),
375-
)
376-
if report is None:
377-
print("BCASL execution failed to start.")
378-
return 1
379-
if report.ok:
380-
print("BCASL run completed successfully.")
381-
return 0
382-
failed = sum(1 for item in report if not item.success)
383-
print(f"BCASL run finished with failures: {failed} plugin(s) failed.")
384-
return 1
385-
299+
# À Connecter à BCASL depuis bcasl/
300+
return print("Pas encore implémenter en Cli")
386301

387302
def launch_gui(*, legacy: bool = False) -> int:
388303
return launch_main_application(

docs/architecture.md

Lines changed: 0 additions & 123 deletions
This file was deleted.

docs/ark_main_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file customizes how a workspace is scanned and built. It lives at the
44
workspace root and is created automatically when the workspace is first set
55
in the GUI (if missing).
66

7-
The configuration is loaded by `Core/ArkConfig/` and merged with
7+
The configuration is loaded by `Core/Configs/` and merged with
88
defaults.
99

1010
## Location

docs/contributing.md

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +0,0 @@
1-
# Contributing Guide
2-
3-
This guide is meant to be directly usable by contributors working on PyCompiler ARK.
4-
5-
## Setup
6-
7-
```bash
8-
git clone https://github.com/raidos23/PyCompiler_ARK.git
9-
cd PyCompiler_ARK
10-
python -m venv .venv
11-
source .venv/bin/activate
12-
pip install -r requirements.txt
13-
```
14-
15-
On Windows:
16-
17-
```bash
18-
.venv\Scripts\activate
19-
pip install -r requirements.txt
20-
```
21-
22-
## Recommended workflow
23-
24-
1. Create a branch from the active development branch.
25-
2. Make a focused change set.
26-
3. Run lint, tests, and smoke checks locally when relevant.
27-
4. Update documentation when behavior changes.
28-
5. Commit with a clear message describing the user-visible impact.
29-
30-
## Local checks
31-
32-
Baseline checks:
33-
34-
```bash
35-
ruff check .
36-
black --check .
37-
pytest -q tests
38-
python -m py_compile pycompiler_ark.py
39-
```
40-
41-
Useful smoke commands:
42-
43-
```bash
44-
python -m pycompiler_ark --help
45-
python -m pycompiler_ark --version
46-
python -m pycompiler_ark --info
47-
python -m pycompiler_ark engine list --json
48-
python -m pycompiler_ark workspace inspect . --json
49-
python -m pycompiler_ark doctor --json
50-
python -m pycompiler_ark check /path/to/workspace --json
51-
python -m pycompiler_ark --cli
52-
```
53-
54-
For reliable prechecks, point `check --strict` at a workspace that already
55-
defines an entrypoint in `ark.yml`.
56-
57-
Release-oriented checks should follow the CLI examples in this guide and the README.
58-
For publishing steps, follow [`docs/release_process.md`](./release_process.md).
59-
60-
## Where to make changes
61-
62-
- CLI behavior: `Ui/Cli/`
63-
- headless discovery and payload helpers: `Ui/Cli/discovery.py`
64-
- classic GUI wiring: `Core/UiConnection.py`
65-
- IDE-like GUI wiring: `Core/IdeLikeGui/`
66-
- compilation logic: `Core/Compiler/`
67-
- environment and dependency logic: `Core/Venv_Manager/`, `Core/deps_analyser/`
68-
- built-in engines: `ENGINES/`
69-
- BCASL plugins and runtime: `Plugins/`, `bcasl/`, `Plugins_SDK/`
70-
- documentation: `docs/`
71-
72-
## Contribution rules of thumb
73-
74-
- Prefer extending existing shared helpers over copying logic.
75-
- Keep UI-specific code thin.
76-
- Keep engine-specific behavior inside engines.
77-
- Treat i18n as shared architecture, not as per-widget local logic.
78-
- Add or update tests when changing heuristics, parsing, or orchestration behavior.
79-
- If you change CLI flags, commands, or docs-linked behavior, update the README.
80-
- If you change the command hierarchy (`gui`, `engine`, `workspace`, `init`, `config-auto`, `check`, `scaffold`) or JSON outputs, update the CLI docs.
81-
- Keep CI-facing exit codes stable, or document the change explicitly in the README.
82-
- For CI/CD behavior, keep [`docs/ci_cd_ark_cli.md`](./ci_cd_ark_cli.md) as the single source of truth and align other docs/examples to it.
83-
- For GUI behavior that impacts CI expectations (entrypoint, workspace persistence, engine config), explicitly state whether behavior is temporary session state or persisted workspace state.
84-
- If you change IDE/classic behavior, update the IDE docs when appropriate.
85-
- If you change translated GUI behavior, follow [`docs/dev_docs/i18n_ark.md`](./dev_docs/i18n_ark.md) and keep classic/IDE wiring aligned.
86-
87-
## i18n architecture rule
88-
89-
ARK has a specific i18n architecture and contributors should follow it instead of
90-
adding local ad-hoc translation code.
91-
92-
- Add keys in `languages/*.json`.
93-
- Map widgets first, then wire shared GUI translations in `Core/i18n.py`.
94-
- Reuse classic GUI translation flow when exposing the same feature in IDE-like GUI.
95-
- For IDE proxy controls such as the `(...)` menu, prefer reusing existing translated classic controls or the active `self._tr` table instead of hardcoding new strings.
96-
- Test language switching live, without restarting the app.
97-
- Use [`docs/dev_docs/i18n_ark.md`](./dev_docs/i18n_ark.md) as the reference integration guide.
98-
99-
## Documentation expectations
100-
101-
Contributors should update documentation when they modify:
102-
103-
- public CLI behavior
104-
- workflow or release steps
105-
- architecture-relevant module boundaries
106-
- dependency analyzer heuristics
107-
- IDE/classic parity behavior
108-
109-
## Good first doc touchpoints
110-
111-
- [Release process](./release_process.md)
112-
- [Architecture overview](./architecture.md)
113-
- [Dependency analyzer](./dependency_analyzer.md)
114-
- [Dedicated CLI](./dedicated_cli.md)
115-
- [ARK i18n architecture](./dev_docs/i18n_ark.md)

0 commit comments

Comments
 (0)