From 48184027c3a1214a3205a257ed468262b962fa1a Mon Sep 17 00:00:00 2001 From: dsk-dev-ai Date: Fri, 11 Sep 2026 23:04:23 +0530 Subject: [PATCH] fix(pypi): bundle catalog data in wheel, resolve installed layout - find catalog/ by walking up from the package dir (works from repo and site-packages); fixes 'python -m synth discover' failing on install - wheel force-include of catalog/problems.json + discovery_targets.json; sdist ships catalog/ too - bump 1.0.1; README/docs version refs updated --- README.md | 6 +++--- docs/index.md | 2 +- pyproject.toml | 8 ++++++-- src/gui/core.py | 14 +++++++++++++- src/synth/corpus.py | 14 +++++++++++++- uv.lock | 2 +- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1865cbe..4ba46d8 100644 --- a/README.md +++ b/README.md @@ -185,11 +185,11 @@ Core logic lives in `gui/core.py` and is tested headlessly in CI (`-p gui` mypy Prebuilt on **GitHub Packages** (amd64 + arm64) — no install needed: ```sh -docker pull ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.0 -docker run --rm ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.0 --smoke +docker pull ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.1 +docker run --rm ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.1 --smoke ``` -Tags: `latest`, per-version (`v1.0.0`), and per-commit (`sha-`). The image runs +Tags: `latest`, per-version (`v1.0.1`), and per-commit (`sha-`). The image runs the local algorithm synthesizer by default; override with any `python -m` command. ## Documentation diff --git a/docs/index.md b/docs/index.md index a578ca1..20954f7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,7 +22,7 @@ Every tier ships as pure standard-library code, and the repo is **CI-green by default**: Python 3.10–3.13, Java 21, GCC C++17, stable Rust, and a discovery-smoke job. -!!! tip "New in v1.0.0" +!!! tip "New in v1.0.1" A [desktop GUI](gui.md) built purely on the standard library (`python -m gui`) — discover patterns, run the synthesizer, and drive the engine without touching the terminal. diff --git a/pyproject.toml b/pyproject.toml index ad87225..ef22a5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "algorithm-discovery-engine" -version = "1.0.0" +version = "1.0.1" description = "Multi-language algorithms & data structures solving engine (Java, C++, Rust, Python) with cross-language benchmarks and a local AI synthesizer that rediscovers algorithms from examples." readme = "README.md" requires-python = ">=3.10" @@ -51,6 +51,10 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["src/algo_discovery", "src/ads", "src/synth", "src/gui"] +[tool.hatch.build.targets.wheel.force-include] +"catalog/problems.json" = "catalog/problems.json" +"catalog/discovery_targets.json" = "catalog/discovery_targets.json" + [tool.uv] package = true @@ -83,7 +87,7 @@ explicit_package_bases = true mypy_path = "src" [tool.hatch.build.targets.sdist] -include = ["src", "tests", "README.md", "LICENSE"] +include = ["src", "tests", "catalog", "engine", "README.md", "LICENSE"] [[tool.mypy.overrides]] module = "tests.*" diff --git a/src/gui/core.py b/src/gui/core.py index 5f6306b..8b4530d 100644 --- a/src/gui/core.py +++ b/src/gui/core.py @@ -14,7 +14,19 @@ from algo_discovery import DiscoveryEngine from synth import discovery as synth_discovery -ROOT: Path = Path(__file__).resolve().parent.parent.parent + +def _find_catalog_root() -> Path: + """Locate the directory holding ``catalog/`` (repo or installed layout).""" + head = Path(__file__).resolve().parent + candidate = head + while candidate != candidate.parent: + if (candidate / "catalog" / "problems.json").exists(): + return candidate + candidate = candidate.parent + raise FileNotFoundError("could not locate catalog/problems.json") + + +ROOT: Path = _find_catalog_root() CATALOG_PATH: Path = ROOT / "catalog" / "problems.json" TARGETS_PATH: Path = ROOT / "catalog" / "discovery_targets.json" DISCOVERIES_DIR: Path = ROOT / "catalog" / "discoveries" diff --git a/src/synth/corpus.py b/src/synth/corpus.py index 258dd83..f3f5130 100644 --- a/src/synth/corpus.py +++ b/src/synth/corpus.py @@ -13,7 +13,19 @@ from pathlib import Path from typing import Any -ROOT = Path(__file__).resolve().parent.parent.parent + +def _find_catalog_root() -> Path: + """Locate the directory holding ``catalog/`` (repo or installed layout).""" + head = Path(__file__).resolve().parent + candidate = head + while candidate != candidate.parent: + if (candidate / "catalog" / "discovery_targets.json").exists(): + return candidate + candidate = candidate.parent + raise FileNotFoundError("could not locate catalog/discovery_targets.json") + + +ROOT = _find_catalog_root() PARSE_DELIM = "|" diff --git a/uv.lock b/uv.lock index 3911cff..6bcc97b 100644 --- a/uv.lock +++ b/uv.lock @@ -8,7 +8,7 @@ resolution-markers = [ [[package]] name = "algorithm-discovery-engine" -version = "1.0.0" +version = "1.0.1" source = { editable = "." } [package.dev-dependencies]