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

(409) Transition Protean Config to .toml file #427

Merged
merged 9 commits into from
May 28, 2024
Merged

Conversation

subhashb
Copy link
Contributor

This PR transitions Protean's configuration management to using .toml files.

Changes:

  • Config can be stored in three files: .domain.toml, domain.toml, and pyproject.toml
  • Protean will search for config files in the same folder as the domain instantiation file and 2 folders up
  • Simplify adapter values and lowercase all config attributes
  • Allow environment variables to be specified in the config
  • Allow defaults to be specified when environment variables are not configured
  • Protean will not traverse subdirectories containing any of the config files and assumes they run as services on their own
  • Update project template structure to reflect .toml config

Fixes #409

subhashb added 9 commits May 24, 2024 10:43
This initial commit introduces the functionality to use TOML config
files, and moves away from the old `Config` class.

Fixes #409
Instead of providing the full path of the provider class, this commit allows
specifying unique strings for each provider.

This commit also introduces `load_toml` parameter to `domain.__init__` so
that a toml file is not always necessary. Config can be loaded from any
arbitrary dictionary.
If a subdirectory contains a toml file (domain.toml, .domain.toml, or
pyproject.toml), it means that the subdirectory is a full-fledged service
of its own, and should not be traversed.
The domain object can be instantiated within the src folder, but the .toml
file can be present in the project root. This commit adds the capability
to scan for config files up to 2 levels up from the file in which the
domain object is instantiated.
Protean related settings will be nested under [tool.protean.*] sections.
This commit also fixes issues with `new` shell command with accepting
data on the CLI.
@subhashb subhashb self-assigned this May 28, 2024
@subhashb subhashb merged commit 5c73456 into main May 28, 2024
4 checks passed
@subhashb subhashb deleted the 409-config-with-toml branch May 28, 2024 13:58
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.

Simplify config management with .toml configuration file
1 participant