Skip to content

Commit 58a4893

Browse files
committed
Update todo and format
1 parent 0fdc832 commit 58a4893

File tree

8 files changed

+13
-17
lines changed

8 files changed

+13
-17
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# E123,E133: ignored by default by pep8, so we ignore them here
66
# E203: space before comma, not pep8 compliant
77
# E241,E242: spacing after a comma - not used
8-
# F401: module imported but unused
8+
# E701,E704: multiple statements on one line - handled by black
99
# F812: list comprehension redefines name
1010
# W503: line break before operator - ignored as W504 is in pep8
1111
# * Documentation (https://pep257.readthedocs.io/en/latest/error_codes.html)
@@ -15,7 +15,7 @@
1515
# D205: 1 blank line required between summary line and description
1616
# D210: no whitespaces allowed surrounding docstring text - not used
1717
# D400: first line should end with a period
18-
ignore = C901,E123,E133,E203,F812,W503,D102,D205,D400
18+
ignore = C901,E123,E133,E203,E701,E704,F812,W503,D102,D205,D400
1919
max-line-length = 100
2020
exclude = .venv,venv,.git
2121
max-complexity = 10

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ __pycache__
1111
dist
1212
.ipynb_checkpoints
1313
*.egg-info
14-
.mypy_cache
15-
.pytest_cache
14+
/*_cache

alphaconf/inject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def getter(
5252
ktype = next(type_from_annotation(ptype), None)
5353
if param is not None and param.default is not param.empty:
5454
xparam = param
55-
return (
56-
lambda: xparam.default
55+
return lambda: (
56+
xparam.default
5757
if (value := alphaconf.get(key, ktype, default=None)) is None
5858
and xparam.default is not xparam.empty
5959
else value

alphaconf/internal/configuration.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def get(
5555
type: Type[T],
5656
*,
5757
default: Union[T, RaiseOnMissingType] = raise_on_missing,
58-
) -> T:
59-
...
58+
) -> T: ...
6059

6160
@overload
6261
def get(
@@ -65,8 +64,7 @@ def get(
6564
type: Union[str, None] = None,
6665
*,
6766
default: Any = raise_on_missing,
68-
) -> Any:
69-
...
67+
) -> Any: ...
7068

7169
@overload
7270
def get(
@@ -75,8 +73,7 @@ def get(
7573
type: None = None,
7674
*,
7775
default: Union[T, RaiseOnMissingType] = raise_on_missing,
78-
) -> T:
79-
...
76+
) -> T: ...
8077

8178
def get(self, key: Union[str, Type], type=None, *, default=raise_on_missing):
8279
"""Get a configuation value and cast to the correct type"""

example-inv.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ def doit(ctx, param=None):
1616

1717
# add some default configuration and run/configure invoke's namespace
1818
alphaconf.setup_configuration({'backup': 'all'})
19+
# TODO just setup logging and load variables into ns?
1920
alphaconf.invoke.run(__name__, globals())

example-plumbum.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
@app.command()
1414
def main():
1515
"""Simple demo of alphaconf with plumbum"""
16-
1716
log = logging.getLogger(__name__)
1817
cmd = plumbum.local[alphaconf.get("cmd")]
1918
log.info("Running a command %s", cmd)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dynamic = ["version"]
1212
description = "Write simple scripts leveraging omegaconf"
1313
readme = "README.md"
1414
keywords = ["configuration", "omegaconf", "pydantic", "script"]
15-
license = {text = "BSD License"}
15+
license = {file = "LICENSE"}
1616
requires-python = ">=3.9"
1717
classifiers = [
1818
# https://pypi.org/pypi?%3Aaction=list_classifiers

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Build tools
22
setuptools
33
setuptools_scm
4-
black
5-
flake8
6-
isort
4+
black>=22
5+
flake8>=7
6+
isort>=5
77
mypy
88
pytest
99
types-toml

0 commit comments

Comments
 (0)