Skip to content
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

Loading too much during imports #44

Open
dougransom opened this issue Dec 31, 2022 · 1 comment
Open

Loading too much during imports #44

dougransom opened this issue Dec 31, 2022 · 1 comment
Assignees

Comments

@dougransom
Copy link
Member

There are places where config files are ready during import. this is from natlinkstatus.py

_config_locations = loader.config_locations() Logger.debug(f"{__file__} Configugure {_config_locations}") Config = config.NatlinkConfig.from_first_found_file(_config_locations) Logger.debug(f"{__file__} Config {Config}") natlinkmain = loader.NatlinkMain(Logger, Config)

It makes it somewhat difficult to write code (especially tests) which might specify a config file and use the code. They don't have a chance to specify the config file because they need to import natlinkcore files for the python to compile.

I would think we should try and find a way to load the config files later, after the import.

@dougransom
Copy link
Member Author

I made the changes here dougransom@d9ef89c.
@quintijn can you take a quick look make sure they seem ok please?

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

No branches or pull requests

2 participants