Coder Social home page Coder Social logo

classy-config's People

Contributors

dependabot[bot] avatar fisher60 avatar gdwr avatar github-actions[bot] avatar minalike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

fisher60 minalike

classy-config's Issues

Read config file once

This should only read the config file once, the current implementation does it for each setting loaded.

def _get_raw_config_file(self) -> dict:
with open(self.config_file, "r") as f:
return json.load(f)
@property
def raw_config(self) -> dict:
return self._get_raw_config_file()

Config values should be CAsEinSenItIVE

Seen some issues with using environemnet variable loader, as they are all uppercase.

We should just make ConfigValue "variable_path" case insensitive.

Add feature list to README.md

Add a feature list to the README.md

i.e.

Features;

  • Supports multiple config types
    • .json
    • .toml
    • .env
  • Supports Static Analyisis
  • Pydantic
  • ...

Fix lint errors occurring on every lint run

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

Support for YAML

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.

Add tests for Thread Safety

ClassyConfig should be threadsafe, creating tests for this would be beneficial for ensuring future changes doesn't change this.

Support Python 3.6 - 3.9

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.