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

Refactor config loader #203

Merged
merged 8 commits into from
Feb 23, 2024
Merged

Refactor config loader #203

merged 8 commits into from
Feb 23, 2024

Conversation

CunliangGeng
Copy link
Member

@CunliangGeng CunliangGeng commented Jan 29, 2024

This PR changed the way to load config file (nplinker.toml) by replacing the legacy code with the package of configuration management Dynaconf.

By using Dynaconf, the loaded config (which is a variable) is importable and thus can be accessed across different functions/classes/modules without passing it as a parameter (Detail see example Using Python Only).

Major changes:

  • Deleted all legacy code for loading config (class Args and Config) and related dependencies
  • Added dynaconf as config manager for loading config file
    • Added validation rules for nplinker settings
    • Added default config file nplinker_default.toml with a part of nplinker settings (not complete yet)
  • Added unit tests for new config loader
  • Updated the use of new config loader in the codebase (not complete yet)

Note:
The template of config file nplinker.toml needs to be updated in the following PRs. So in this PR I didn't set default values for all current configurations that will be changed later, nor did I update all their use in the codebase.

Copy link
Member Author

CunliangGeng commented Jan 29, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

To include the default config file when building nplinker package
Copy link
Contributor

@gcroci2 gcroci2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since some parts are not completed yet with this PR, I can't say much, but nice the Dynaconf tool! Seems quite handy.

@CunliangGeng CunliangGeng merged commit a0b5883 into dev Feb 23, 2024
3 of 4 checks passed
@CunliangGeng CunliangGeng deleted the refactor_config_loader branch February 23, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants