specfuse 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specfuse
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Specfuse umbrella CLI — bridges the pip-installed driver and the Claude Code plugin (init / upgrade).
5
5
  Author: Specfuse contributors
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "specfuse"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "Specfuse umbrella CLI — bridges the pip-installed driver and the Claude Code plugin (init / upgrade)."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -33,6 +33,14 @@ dev = ["coverage>=7.0", "ruff>=0.6"]
33
33
 
34
34
  [project.scripts]
35
35
  specfuse = "specfuse.cli:main"
36
+ # Re-export the driver's console scripts so `pipx install specfuse` exposes all
37
+ # three on PATH. pipx only surfaces the installed package's OWN entry points,
38
+ # not its dependencies' — without these, `specfuse-loop`/`specfuse-lint` (from
39
+ # the specfuse-loop dep) would be hidden and users would have to install the
40
+ # driver separately or pass --include-deps. The targets resolve against the
41
+ # specfuse.loop modules the pinned specfuse-loop>=0.3.2 dependency provides.
42
+ specfuse-loop = "specfuse.loop.loop:main"
43
+ specfuse-lint = "specfuse.loop.lint_plan:main"
36
44
 
37
45
  [project.urls]
38
46
  Homepage = "https://github.com/specfuse/specfuse"
@@ -31,7 +31,7 @@ from pathlib import Path
31
31
 
32
32
  from specfuse.loop import scaffold
33
33
 
34
- __version__ = "0.2.2"
34
+ __version__ = "0.2.4"
35
35
 
36
36
  MARKETPLACE = "specfuse/specfuse"
37
37
  PLUGIN = "specfuse@specfuse"
@@ -113,7 +113,12 @@ def cmd_upgrade(args: argparse.Namespace, *, runner=None) -> int:
113
113
  tmp_target.mkdir()
114
114
  src = target / ".specfuse"
115
115
  if src.exists():
116
- shutil.copytree(src, tmp_target / ".specfuse")
116
+ # symlinks=True copies links as links (don't follow); without it,
117
+ # a legacy init.sh scaffold's dangling .specfuse/skills/* symlinks
118
+ # make copytree raise on the missing targets. ignore_dangling_symlinks
119
+ # is belt-and-suspenders for the same case.
120
+ shutil.copytree(src, tmp_target / ".specfuse",
121
+ symlinks=True, ignore_dangling_symlinks=True)
117
122
  try:
118
123
  written = scaffold.upgrade_specfuse(tmp_target, ci_check=ci_check)
119
124
  except scaffold.ScaffoldDowngradeError as exc:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specfuse
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Specfuse umbrella CLI — bridges the pip-installed driver and the Claude Code plugin (init / upgrade).
5
5
  Author: Specfuse contributors
6
6
  License: Apache-2.0
@@ -9,4 +9,5 @@ specfuse.egg-info/dependency_links.txt
9
9
  specfuse.egg-info/entry_points.txt
10
10
  specfuse.egg-info/requires.txt
11
11
  specfuse.egg-info/top_level.txt
12
- tests/test_cli.py
12
+ tests/test_cli.py
13
+ tests/test_entry_points.py
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ specfuse = specfuse.cli:main
3
+ specfuse-lint = specfuse.loop.lint_plan:main
4
+ specfuse-loop = specfuse.loop.loop:main
@@ -138,6 +138,23 @@ class TestUpgrade(unittest.TestCase):
138
138
  self.assertEqual(runner.calls, [], "dry-run must not pip-upgrade")
139
139
  self.assertIn("dry-run", out.getvalue())
140
140
 
141
+ def test_upgrade_dry_run_tolerates_dangling_symlinks(self):
142
+ """A legacy init.sh scaffold leaves dangling .specfuse/skills/* symlinks.
143
+ The dry-run copies .specfuse/ to a temp dir; copytree must not choke on
144
+ them (regression: shutil.Error 'No such file or directory')."""
145
+ with tempfile.TemporaryDirectory() as d:
146
+ self._init(d)
147
+ skills = Path(d) / ".specfuse" / "skills"
148
+ skills.mkdir(parents=True, exist_ok=True)
149
+ # Point at a target that does not exist → dangling symlink.
150
+ (skills / "roadmap-add").symlink_to("../../nonexistent/roadmap-add")
151
+ runner = _ok_runner(0)
152
+ out = io.StringIO()
153
+ with redirect_stdout(out):
154
+ rc = cli.cmd_upgrade(_args(target=d, dry_run=True), runner=runner)
155
+ self.assertEqual(rc, 0, "dry-run must survive dangling legacy symlinks")
156
+ self.assertIn("dry-run", out.getvalue())
157
+
141
158
 
142
159
  class TestParser(unittest.TestCase):
143
160
 
@@ -0,0 +1,50 @@
1
+ #
2
+ # Copyright 2026 Specfuse contributors
3
+ # Licensed under the Apache License, Version 2.0. See LICENSE.
4
+ #
5
+ """The umbrella must expose all three console scripts.
6
+
7
+ pipx only surfaces the installed package's OWN entry points, not its
8
+ dependencies'. So `pip install specfuse` must declare specfuse-loop and
9
+ specfuse-lint itself (re-exporting the driver's mains) or a `pipx install
10
+ specfuse` leaves them off PATH and the driver/lint commands appear missing.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import re
16
+ import unittest
17
+ from pathlib import Path
18
+
19
+ PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
20
+
21
+ _EXPECTED = {
22
+ "specfuse": "specfuse.cli:main",
23
+ "specfuse-loop": "specfuse.loop.loop:main",
24
+ "specfuse-lint": "specfuse.loop.lint_plan:main",
25
+ }
26
+
27
+
28
+ def _scripts() -> dict[str, str]:
29
+ text = PYPROJECT.read_text(encoding="utf-8")
30
+ block = text.split("[project.scripts]", 1)[1]
31
+ # stop at the next [section]
32
+ block = re.split(r"^\[", block, maxsplit=1, flags=re.MULTILINE)[0]
33
+ out = {}
34
+ for m in re.finditer(r'(?m)^([A-Za-z0-9_-]+)\s*=\s*"([^"]+)"', block):
35
+ out[m.group(1)] = m.group(2)
36
+ return out
37
+
38
+
39
+ class TestEntryPoints(unittest.TestCase):
40
+
41
+ def test_all_three_console_scripts_declared(self):
42
+ scripts = _scripts()
43
+ for name, target in _EXPECTED.items():
44
+ self.assertIn(name, scripts,
45
+ f"{name} must be declared so pipx exposes it on PATH")
46
+ self.assertEqual(scripts[name], target)
47
+
48
+
49
+ if __name__ == "__main__":
50
+ unittest.main()
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- specfuse = specfuse.cli:main
File without changes
File without changes
File without changes
File without changes