Skip to content

Defer .cbi/config loading until required #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

Pennycook
Copy link
Contributor

Loading the configuration file when the module is imported can lead to a situation where an exception is thrown before logging is configured.

Related issues

N/A

Proposed changes

  • Do not load .cbi/config when the config module is imported.
  • Check to see if _compilers needs to be populated the first time we create an ArgumentParser.

The configuration file probably should be loaded when codebasin is imported, but it's currently not an easy fix due to some circular imports. The fix I'm proposing here is sufficient for 2.0.0, I think, but we should identify a better long-term fix as part of #172.

Loading the configuration file when the module is imported can lead to a
situation where an exception is thrown before logging is configured.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the bug Something isn't working label Apr 7, 2025
@Pennycook Pennycook added this to the 2.0.0 milestone Apr 7, 2025
@Pennycook Pennycook requested a review from laserkelvin April 7, 2025 15:07
@Pennycook Pennycook merged commit e4b1d6c into intel:main Apr 8, 2025
4 checks passed
@Pennycook Pennycook deleted the bugfix/config-exceptions branch April 8, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants