Skip to content

fix resolving project-absolute paths - #44

Merged
rcannood merged 2 commits into
mainfrom
fix-resolve-project-absolute-merge
Aug 13, 2026
Merged

fix resolving project-absolute paths#44
rcannood merged 2 commits into
mainfrom
fix-resolve-project-absolute-merge

Conversation

@rcannood

@rcannood rcannood commented Aug 13, 2026

Copy link
Copy Markdown
Member

resolve_path() was dropping the project root for any path starting with a /, so a config with e.g. __merge__: /src/api/file_dataset.yaml -- which is how Viash spells "relative to the _viash.yaml" -- failed to read:

FileNotFoundError: [Errno 2] No such file or directory: '/src/api/file_dataset.yaml'

The cause is that os.path.join() resets whenever a segment is absolute, so os.path.join("/repo", "/src/api/file_dataset.yaml") returns /src/api/file_dataset.yaml and the project root is never applied. The R twin uses paste0() and has always been correct, so only the Python side was affected.

Changes:

  • resolve_path: strip the leading slash before joining, and raise a helpful error when a project-absolute path is resolved without a project root (previously a bare TypeError out of os.path.join())
  • Add unit tests for both branches
  • The example project only used file-relative merges, which is why the render tests passed while every real task repo broke. One of them is now project-absolute -- with the fix reverted, the readme rendering suite goes to 3 failures + 9 errors.

Spotted in openproblems-bio/task_batch_integration#99.

* `resolve_path`: strip the leading slash before joining, os.path.join()
  silently drops project_path otherwise
* `resolve_path`: raise a helpful error when there is no project root
* use a project-absolute `__merge__` in the example project, so the readme
  rendering tests cover it
@rcannood
rcannood merged commit d4e3ae0 into main Aug 13, 2026
6 checks passed
@rcannood
rcannood deleted the fix-resolve-project-absolute-merge branch August 13, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant