Skip to content

Commit

Permalink
fix: typing for dict, close #64 (#65)
Browse files Browse the repository at this point in the history
* chore: update deps

* fix: typing for dict, close #64

* fix: tests
  • Loading branch information
zifeo authored Dec 5, 2022
1 parent 858d929 commit 172f895
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 59 deletions.
34 changes: 17 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/sqlalchemyorg/zimports/
rev: v0.6.0
hooks:
- id: zimports
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.35.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/sqlalchemyorg/zimports/
rev: v0.6.0
hooks:
- id: zimports
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.37.1
hooks:
- id: commitizen
stages: [commit-msg]
6 changes: 4 additions & 2 deletions dataconf/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import contextlib
import os
from typing import Any
from typing import Dict
from typing import List
from typing import Type
from urllib.parse import urlparse
Expand Down Expand Up @@ -47,7 +49,7 @@ def env(self, prefix: str, **kwargs) -> "Multi":
data = env_vars_parse(prefix, os.environ)
return self.dict(data, **kwargs)

def dict(self, obj: str, **kwargs) -> "Multi":
def dict(self, obj: Dict[str, Any], **kwargs) -> "Multi":
conf = ConfigFactory.from_dict(obj)
return Multi(self.confs + [conf], self.strict, **kwargs)

Expand Down Expand Up @@ -97,7 +99,7 @@ def env(prefix: str, clazz: Type, **kwargs):
return multi.env(prefix, **kwargs).on(clazz)


def dict(obj: str, clazz: Type, **kwargs):
def dict(obj: Dict[str, Any], clazz: Type, **kwargs):
return multi.dict(obj, **kwargs).on(clazz)


Expand Down
85 changes: 46 additions & 39 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ PyYAML = "^6.0"
[tool.poetry.dev-dependencies]
pytest = "^7.2.0"
pre-commit = "^2.20.0"
commitizen = "^2.37.0"
commitizen = "^2.37.1"
pytest-httpserver = "^1.0.6"

[tool.commitizen]
Expand Down

0 comments on commit 172f895

Please sign in to comment.