Source: scikit-build-core Followup-For: Bug #1068661 I think dh_python3 is not adding the dependency automatically since it's listed in pyproject.toml under pyproject (optional dependency). Hence it'd need to be added manually.
pathspec is listed there too so I figure it would probably want to be added as well (python3-pathspec) If you want to respect the "optional" nature of the dependency then use Recommends: rather than Depends:. But I'd say it's simpler (more robust) to just use Depends: for the packaging.