Skip to content

Commit 6929fbf

Browse files
authored
Merge pull request #51 from drandyhaas/claude/issue-49-j0hit7
Don't stage the CI binary-dir (artifacts/) into the plugin package
2 parents 95a5d91 + f752c29 commit 6929fbf

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

package_pcm.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"tests",
6868
"docs",
6969
"kicad_files", # sample boards: large and unnecessary at runtime
70+
"artifacts", # CI downloads release binaries here before packaging
7071
}
7172

7273
# CLAUDE.md and .claude/ (the routing skills) ship intentionally so they can be
@@ -98,13 +99,23 @@ def read_version():
9899
return (SCRIPT_DIR / "VERSION").read_text().strip()
99100

100101

101-
def stage_plugins(stage_root: Path):
102+
def stage_plugins(stage_root: Path, binary_dir: Path | None = None):
102103
"""Copy the repo working tree (minus ROOT_EXCLUDE / IGNORE_PATTERNS) into
103-
<stage_root>/plugins/."""
104+
<stage_root>/plugins/.
105+
106+
binary_dir, when it lives inside the repo (CI downloads release binaries to
107+
./artifacts before packaging), is skipped so it isn't swept into the plugin.
108+
"""
104109
plugins_dir = stage_root / "plugins"
105110
plugins_dir.mkdir(parents=True, exist_ok=True)
106111

107112
ignored_names = set(ROOT_EXCLUDE)
113+
if binary_dir is not None:
114+
try:
115+
ignored_names.add(binary_dir.resolve().relative_to(SCRIPT_DIR).parts[0])
116+
except (ValueError, IndexError):
117+
pass # binary_dir is outside the repo; nothing to skip
118+
108119
for entry in sorted(SCRIPT_DIR.iterdir()):
109120
if entry.name in ignored_names:
110121
continue
@@ -228,7 +239,7 @@ def main():
228239
print(f"Building PCM package: {zip_name}")
229240
with tempfile.TemporaryDirectory(prefix="kicadrt-pcm-") as tmp:
230241
stage_root = Path(tmp)
231-
plugins_dir = stage_plugins(stage_root)
242+
plugins_dir = stage_plugins(stage_root, binary_dir)
232243
install_binaries(plugins_dir, version, binary_dir)
233244
write_top_level(stage_root, version)
234245
install_size = make_zip(stage_root, out_zip)

0 commit comments

Comments
 (0)