You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Walks four .parent levels: core/parser_adapter.py → core/ → openant-core/ → libs/ → repo root → config/languages.json. Works correctly in the current monorepo layout.
The gap
The file is outside the openant-core package. If openant-core is:
Vendored into another project at a different depth
…the four-.parent walk lands at the wrong directory and read_json(_LANGUAGES_CONFIG) raises FileNotFoundError.
Proposed approaches
Option A — Move the config inside openant-core, use importlib.resources (preferred)
Move config/languages.json to libs/openant-core/openant/config/languages.json. Update both consumers:
Python: from importlib.resources import files; data = json.loads(files('openant.config').joinpath('languages.json').read_text())
Go (apps/openant-cli/cmd/init.go::findLanguagesConfig): already walks from executable + cwd up to 6 levels — just update the relative path it's looking for.
Option B — Multiple search candidates with env override
Try importlib.resources first, fall back to repo-root path, then OPENANT_LANGUAGES_CONFIG env var.
Recommendation
Option A — follows Python packaging best practice. Config files that ship with the package live inside the package.
Why this is its own issue
Raised as a non-blocking Low in #40 round-1 review. #40 shipped the four-.parent walk knowing the limitation. Worth fixing eventually but doesn't block the current monorepo workflow.
References
libs/openant-core/core/parser_adapter.py:30 — the fragile path
apps/openant-cli/cmd/init.go::findLanguagesConfig — Go side, already more robust
Context
libs/openant-core/core/parser_adapter.py:30resolves the shared language-detection config like this:Walks four
.parentlevels:core/parser_adapter.py→core/→openant-core/→libs/→ repo root →config/languages.json. Works correctly in the current monorepo layout.The gap
The file is outside the openant-core package. If openant-core is:
pip install openant-coresomeday)…the four-
.parentwalk lands at the wrong directory andread_json(_LANGUAGES_CONFIG)raisesFileNotFoundError.Proposed approaches
Option A — Move the config inside openant-core, use
importlib.resources(preferred)Move
config/languages.jsontolibs/openant-core/openant/config/languages.json. Update both consumers:from importlib.resources import files; data = json.loads(files('openant.config').joinpath('languages.json').read_text())apps/openant-cli/cmd/init.go::findLanguagesConfig): already walks from executable + cwd up to 6 levels — just update the relative path it's looking for.Option B — Multiple search candidates with env override
Try
importlib.resourcesfirst, fall back to repo-root path, thenOPENANT_LANGUAGES_CONFIGenv var.Recommendation
Option A — follows Python packaging best practice. Config files that ship with the package live inside the package.
Why this is its own issue
Raised as a non-blocking Low in #40 round-1 review. #40 shipped the four-
.parentwalk knowing the limitation. Worth fixing eventually but doesn't block the current monorepo workflow.References
libs/openant-core/core/parser_adapter.py:30— the fragile pathapps/openant-cli/cmd/init.go::findLanguagesConfig— Go side, already more robustconfig/languages.json— the file (introduced in feat: auto-detect language in init #40)