From 7a0213d4f6355fa18388dfa08345934393e8c74c Mon Sep 17 00:00:00 2001 From: Brian Strauch Date: Wed, 29 Jul 2026 19:01:38 -0700 Subject: [PATCH] Discover sample packages instead of listing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hatchling's `packages` setting takes literal paths and does not accept patterns, so the wheel target listed every sample by hand. That list drifted: an entry naming a directory that does not exist is ignored without a warning, so `nexus` (added in #174, where the directory was actually `hello_nexus`) never matched anything, and 14 sample directories added since the uv migration were never shipped — including `google_adk_agents` and `openai_agents`. The sdist shipped no samples at all. Switch to setuptools, whose `packages.find` discovers them declaratively, so adding a sample requires no build config change. Namespace discovery is needed because some samples have subdirectories without an `__init__.py`. Verified: the wheel and sdist each contain exactly the 652 tracked sample .py files (the wheel previously had 405 from 33 hand-listed entries; the sdist had none), with no venv, cache, or lambda_worker content; a wheel install and an editable install both import samples the old list omitted; the AI sample tests pass against the reinstalled editable project. Co-Authored-By: Claude Opus 5 (1M context) --- .gitignore | 1 + pyproject.toml | 55 ++++---------------------------------------------- 2 files changed, 5 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 9b0b43524..759f4f23a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ __pycache__ .mypy_cache/ **/client.key **/client.pem +*.egg-info/ diff --git a/pyproject.toml b/pyproject.toml index e8f3ebd87..510438e07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,59 +84,12 @@ constraint-dependencies = [ "yarl!=1.24.0", ] -[tool.hatch.metadata] -allow-direct-references = true - -[tool.hatch.build.targets.sdist] -include = ["./**/*.py"] -exclude = ["lambda_worker/**"] - -[tool.hatch.build.targets.wheel] -include = ["./**/*.py"] -exclude = ["lambda_worker/**"] -packages = [ - "activity_worker", - "bedrock", - "cloud_export_to_parquet", - "context_propagation", - "custom_converter", - "custom_decorator", - "custom_metric", - "dsl", - "encryption", - "external_storage", - "external_storage_redis", - "gevent_async", - "hello", - "langgraph_plugin", - "langsmith_tracing", - "message_passing", - "nexus", - "open_telemetry", - "patching", - "polling", - "prometheus", - "pydantic_converter", - "pydantic_converter_v1", - "pyproject.toml", - "replay", - "schedules", - "sentry", - "sleep_for_days", - "strands_plugin", - "tests", - "trio_async", - "updatable_timer", - "worker_specific_task_queues", - "worker_versioning", -] - -[tool.hatch.build.targets.wheel.sources] -"./**/*.py" = "**/*.py" +[tool.setuptools.packages.find] +exclude = ["lambda_worker*"] [build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" [tool.poe.tasks] format = [