Skip to content

fix: resolve spec paths relative to package install dir#66

Merged
lmeilibr merged 1 commit into
mainfrom
fix/spec-loader-relative-path
Apr 8, 2026
Merged

fix: resolve spec paths relative to package install dir#66
lmeilibr merged 1 commit into
mainfrom
fix/spec-loader-relative-path

Conversation

@lmeilibr

@lmeilibr lmeilibr commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bug: get_spec_dict in farialimer/utils/spec_loader.py used a relative path (farialimer/specs/{provider}) that only works when the current working directory contains the farialimer source tree. When farialimer is installed as a package and imported from another project, os.walk finds nothing and returns an empty dict, breaking all parsers and generators.
  • Fix: Resolve the specs directory relative to __file__ using os.path.dirname so the path is always correct regardless of the caller's working directory.

Test plan

  • All 241 existing tests pass with the change

🤖 Generated with Claude Code

The get_spec_dict function used a relative path (farialimer/specs/{provider})
which only works when the CWD contains the farialimer source tree. When
farialimer is installed as a package and imported from another project,
os.walk finds nothing and returns an empty dict, breaking all parsers
and generators.

Fix: resolve the specs directory relative to __file__ so it works
regardless of the caller's working directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmeilibr
lmeilibr merged commit 5b1b435 into main Apr 8, 2026
4 checks passed
@lmeilibr
lmeilibr deleted the fix/spec-loader-relative-path branch April 8, 2026 15:14
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