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
The current implementation of packages involves direct retrieval of configuration variables using os.environ.get. This approach, while functional, limits the flexibility and testability of the packages. The proposal is to refactor these packages so that functions requiring configuration data receive them as parameters, instead of directly accessing environment variables.
Objectives:
Enhanced Flexibility: By passing configuration variables as parameters, we allow users to provide these values in ways that best suit their environment and use case, be it through environment variables, configuration files, or other means.
Improved Testability: Functions that explicitly accept configuration parameters are easier to test, as they do not rely on the external environment's state. This makes writing unit tests more straightforward and reliable.
Clear Dependencies: Having functions request necessary configuration as parameters makes the code more self-explanatory and clear about its dependencies.
Proposed Changes:
Refactor functions to accept configuration variables as parameters.
Update documentation to reflect these changes and guide users on how to pass these parameters.
Implement default values or error handling for cases where critical configuration data is not provided.
Write unit tests to cover different scenarios, including those with varying configuration inputs.
Action Items:
Identify all instances where os.environ.get is used for configuration in the packages.
Redesign these functions to accept configuration data as parameters.
Update and test each function to ensure it operates correctly with the new parameter-based configuration.
Revise the package documentation to clearly explain the new method of passing configuration data.
Create and run unit tests to validate functionality and handle edge cases.
The text was updated successfully, but these errors were encountered:
Could be, yes. This is just to add the config vars as arguments to the functions. The user of these packages could then use Obol for his needs in his project.
The current implementation of packages involves direct retrieval of configuration variables using
os.environ.get
. This approach, while functional, limits the flexibility and testability of the packages. The proposal is to refactor these packages so that functions requiring configuration data receive them as parameters, instead of directly accessing environment variables.Objectives:
Enhanced Flexibility: By passing configuration variables as parameters, we allow users to provide these values in ways that best suit their environment and use case, be it through environment variables, configuration files, or other means.
Improved Testability: Functions that explicitly accept configuration parameters are easier to test, as they do not rely on the external environment's state. This makes writing unit tests more straightforward and reliable.
Clear Dependencies: Having functions request necessary configuration as parameters makes the code more self-explanatory and clear about its dependencies.
Proposed Changes:
Action Items:
os.environ.get
is used for configuration in the packages.The text was updated successfully, but these errors were encountered: