Skip to content

Commit 47877df

Browse files
adeebshihadehclaude
andcommitted
release/_shim_setup: support flat-list packages
acados switched from `packages.find.include` to a literal `packages = [ "acados", "casadi" ]` list (so setuptools doesn't try to glob non- existent dirs at config time). Update both release.sh's shim builder and the per-shim setup.py to recognise either form. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f07f784 commit 47877df

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

_shim_setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@
2525
VERSION = _cfg["project"]["version"]
2626
MODULE = _cfg["project"]["name"].replace("-", "_")
2727

28-
# all top-level packages bundled in this wheel (e.g. acados + casadi)
29-
_INCLUDE = _cfg.get("tool", {}).get("setuptools", {}).get("packages", {}).get("find", {}).get("include", [f"{MODULE}*"])
28+
# all top-level packages bundled in this wheel (e.g. acados + casadi).
29+
# `packages` may be a flat list or a dict with find.include patterns.
30+
_pkgs = _cfg.get("tool", {}).get("setuptools", {}).get("packages", [f"{MODULE}*"])
31+
if isinstance(_pkgs, list):
32+
_INCLUDE = _pkgs
33+
elif isinstance(_pkgs, dict):
34+
_INCLUDE = _pkgs.get("find", {}).get("include", [f"{MODULE}*"])
35+
else:
36+
_INCLUDE = [f"{MODULE}*"]
3037
TOP_PACKAGES = sorted({p.rstrip("*").rstrip("/") for p in _INCLUDE if p.rstrip("*").rstrip("/")})
3138

3239
PLATFORM_MAP = {

release.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,15 @@ for toml in sorted(pathlib.Path(".").glob("*/pyproject.toml")):
7171
def _ignore_binaries(_dir, names):
7272
return [n for n in names if n.endswith((".so", ".dylib", ".a")) or ".so." in n or n == "__pycache__"]
7373
74-
pkgs_val = data.get("tool", {}).get("setuptools", {}).get("packages", {})
75-
include_patterns = pkgs_val.get("find", {}).get("include", []) if isinstance(pkgs_val, dict) else []
74+
# `packages` is either a flat list (["acados", "casadi"]) or a dict with
75+
# `find.include` patterns (["acados*", "casadi*"]) — handle both
76+
pkgs_val = data.get("tool", {}).get("setuptools", {}).get("packages", [])
77+
if isinstance(pkgs_val, list):
78+
include_patterns = list(pkgs_val)
79+
elif isinstance(pkgs_val, dict):
80+
include_patterns = pkgs_val.get("find", {}).get("include", [])
81+
else:
82+
include_patterns = []
7683
extra_packages = []
7784
for pattern in include_patterns:
7885
p = pattern.rstrip("*")

0 commit comments

Comments
 (0)