Skip to content

Commit 652c75c

Browse files
committed
Remove WSL runtime support
1 parent 27acbd5 commit 652c75c

4 files changed

Lines changed: 8 additions & 42 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ open directly in a browser.
3939
5. `uv pip install -r requirements.txt`
4040
6. Run `python -m src.gui`, open the Configuration tab, set `input_dir`, and Save (writes `config.yaml`)
4141
7. `python -m src.main analyze --config config.yaml`
42-
- Outputs land in `input_dir\\analysis` (`analysis.json`, `report.html`, `report.css`, `report.js`), with Windows paths for opening from the host.
42+
- Outputs land in `input_dir\\analysis` (`analysis.json`, `report.html`, `report.css`, `report.js`).
4343

44-
### Linux / WSL (Ubuntu)
44+
### WSL2 (dev only, Windows run-time)
45+
46+
Use WSL2 for development tasks (linting, formatting, tests). Run the app itself from Windows.
4547

4648
1. `sudo apt update && sudo apt install python3.12 python3.12-venv build-essential python3.12-dev`
4749
2. `python3.12 -m venv .venv-3.12 && source .venv-3.12/bin/activate`
4850
3. Install uv: `curl -LsSf https://astral.sh/uv/install.sh | sh` then `source ~/.profile`
4951
4. `uv pip install -r requirements.txt`
50-
5. Run `python -m src.gui`, open the Configuration tab, set `input_dir` (use `/mnt/c/...` for Windows storage), and Save (writes `config.yaml`)
51-
6. `python -m src.main analyze --config config.yaml`
52-
- Outputs land in `input_dir/analysis`; paths in the report are converted to Windows form for host opening.
52+
5. Dev checks: `python -m compileall src` and `black src`
5353

5454
## Commands
5555

@@ -78,7 +78,7 @@ By default, outputs are stored under `input_dir`:
7878
- Defaults live in the app/GUI; use the Configuration tab to save `config.yaml`.
7979
- `preview` block controls preview size/format; `analysis` block tunes thresholds.
8080
- Analysis outputs are written under `input_dir/analysis`; previews under `input_dir/previews` and keep/discard moves under `input_dir/output`.
81-
- Under WSL, set `input_dir` to the host path (`C:\...`); the analyzer writes Windows-style paths into outputs so you can open `report.html` from the host.
81+
- Set `input_dir` to a Windows path (for example, `D:\photos\shoot1`).
8282

8383
## Face detection (optional)
8484

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# TODO
22

3-
- Handle decisions.json paths across Windows/WSL (e.g., translate Windows paths via wslpath or configurable path_map).

src/analyzer.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,21 +1000,6 @@ def _append_comparison_reason(
10001000
return duplicate_indexes
10011001

10021002

1003-
def _to_windows_path(path_value: str) -> str:
1004-
"""Convert WSL-style /mnt/<drive>/ paths to Windows paths for host consumption."""
1005-
if not isinstance(path_value, str):
1006-
return path_value
1007-
if len(path_value) >= 3 and path_value[1:3] == ":\\":
1008-
return path_value
1009-
parts = path_value.split("/")
1010-
is_wsl_root = len(parts) > 3 and parts[0] == "" and parts[1] == "mnt"
1011-
if is_wsl_root and len(parts[2]) == 1:
1012-
drive = f"{parts[2].upper()}:"
1013-
rest = [part for part in parts[3:] if part]
1014-
return str(pathlib.PureWindowsPath(drive, *rest))
1015-
return path_value
1016-
1017-
10181003
def _apply_quality_decisions(
10191004
results: List[AnalysisResult],
10201005
analysis_cfg: AnalysisConfig,
@@ -1058,27 +1043,13 @@ def _apply_quality_decisions(
10581043
results[fallback]["reasons"].append("kept to avoid discarding all duplicates")
10591044

10601045

1061-
def _convert_paths_for_host(results: List[AnalysisResult]) -> List[AnalysisResult]:
1062-
"""Return a copy of results with paths converted to Windows-style when applicable."""
1063-
converted: List[AnalysisResult] = []
1064-
for entry in results:
1065-
item = dict(entry)
1066-
item["path"] = _to_windows_path(item["path"])
1067-
item["preview"] = _to_windows_path(item["preview"])
1068-
if "duplicate_of" in item:
1069-
item["duplicate_of"] = _to_windows_path(item["duplicate_of"])
1070-
converted.append(cast(AnalysisResult, item))
1071-
return converted
1072-
1073-
10741046
def write_outputs(results: List[AnalysisResult], analysis_cfg: AnalysisConfig) -> None:
10751047
"""Persist analysis results to JSON and render the HTML report."""
1076-
results_for_host = _convert_paths_for_host(results)
10771048
output_json = pathlib.Path(
10781049
analysis_cfg.get("results_path", DEFAULT_CONFIG["analysis"]["results_path"])
10791050
)
1080-
output_json.write_text(json.dumps(results_for_host, indent=2), encoding="utf-8")
1051+
output_json.write_text(json.dumps(results, indent=2), encoding="utf-8")
10811052
report_path = pathlib.Path(
10821053
analysis_cfg.get("report_path", DEFAULT_CONFIG["analysis"]["report_path"])
10831054
)
1084-
write_html_report(results_for_host, report_path, {"analysis": analysis_cfg})
1055+
write_html_report(results, report_path, {"analysis": analysis_cfg})

src/decisions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ class DecisionsSummary:
4444
def _normalize_decision_path(path_value: str) -> pathlib.Path:
4545
"""Normalize a decision path string to a local filesystem Path."""
4646
raw = str(path_value).strip()
47-
if os.name != "nt" and _WINDOWS_DRIVE.match(raw):
48-
drive = raw[0].lower()
49-
rest = raw[2:].lstrip("\\/").replace("\\", "/")
50-
return pathlib.Path("/mnt") / drive / rest
5147
return pathlib.Path(raw).expanduser()
5248

5349

0 commit comments

Comments
 (0)