gdwr / classy-config Goto Github PK
View Code? Open in Web Editor NEWSay bye-bye to your config.py
Home Page: https://gdwr.github.io/classy-config/
License: MIT License
Say bye-bye to your config.py
Home Page: https://gdwr.github.io/classy-config/
License: MIT License
This should only read the config file once, the current implementation does it for each setting loaded.
classy-config/classy_config/classy_config.py
Lines 23 to 29 in 66b94fd
Add docstrings, and auto documentation generation from them.
We want a way to access config/settings that are stored in the environment.
Seen some issues with using environemnet variable loader, as they are all uppercase.
We should just make ConfigValue
"variable_path" case insensitive.
I want to ensure that if a config value is changed in a function scope, for whatever reason, this doesn't effect the config value within other scopes.
Describe how making your settings gathered via the params means you can easily override them for tests.
Add a feature list to the README.md
i.e.
Features;
.json
.toml
.env
Currently linting using poetry run flake8
results in a fairly long list of lint errors. This makes it difficult to check linting prior to pushing changes and waiting for the CI to return lint errors. It is likely that a config is needed to ignore these files since they are passing linting in the Action.
.\examples\custom_loader\main.py:6:1: D103 Missing docstring in public function
.\examples\simple\main.py:3:1: I101 Imported names are in the wrong order. Should be ConfigValue, register_config
.\examples\simple\main.py:3:1: I202 Additional newline in a group of imports. 'from classy_config import register_config, ConfigValue' is identified as Third Party and 'import
pygame' is identified as Third Party.
.\examples\simple\main.py:18:1: D101 Missing docstring in public class
.\examples\simple\main.py:22:9: ANN001 Missing type annotation for function argument 'size'
.\examples\simple\main.py:22:14: B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
.\examples\simple\main.py:23:9: ANN001 Missing type annotation for function argument 'x_speed'
.\examples\simple\main.py:23:17: B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
.\examples\simple\main.py:24:9: ANN001 Missing type annotation for function argument 'y_speed'
.\examples\simple\main.py:24:17: B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
.\examples\simple\main.py:38:1: D102 Missing docstring in public method
.\examples\simple\main.py:38:21: ANN201 Missing return type annotation for public function
I want to be able to specify a YAML file.
This feature will be followed up by allowing custom tags, that can be specified for this parser.
ClassyConfig should be threadsafe, creating tests for this would be beneficial for ensuring future changes doesn't change this.
3.6 lacks typing.get_origin
, the package typing-inspect
in place of this.
It returns the Type object in version 3.6 and in 3.7+ returns the typing object, making it unable to be instanitated.
self = typing.List, args = ([1, 2, 3, 4],), kwargs = {}
def __call__(self, *args, **kwargs):
if not self._inst:
> raise TypeError(f"Type {self._name} cannot be instantiated; "
f"use {self.__origin__.__name__}() instead")
E TypeError: Type List cannot be instantiated; use list() instead
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.