Skip to content

Commit f60c554

Browse files
authored
release(1.3.2): Add "dataclasses" peer dependency for Python 3.6 to allow use events.py and improve "get_env" function from utils.py to allow avoid casting to str the default option given keeping the behavior retro-compatibility but extending the return type as optional
1 parent 4312a29 commit f60c554

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

aioddd/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from typing import Any, Dict, Optional, Type, TypeVar, Union
44

55

6-
def get_env(key: str, default: Optional[str] = None) -> str: # pragma: no cover
6+
def get_env(key: str, default: Optional[str] = None, cast_default_to_str: bool = True) -> Optional[str]:
77
"""Get an environment variable, return default if it is empty or doesn't exist."""
88
value = getenv(key, default)
9-
return str(default) if not value or len(value) == 0 else value
9+
return str(default) if cast_default_to_str else default if not value or len(value) == 0 else value
1010

1111

1212
def get_simple_logger(

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = "aioddd"
3-
version = "1.3.1"
3+
version = "1.3.2"
44
description = "Async Python DDD utilities library."
55
license = "MIT"
66
authors = ["ticdenis <[email protected]>"]
@@ -13,7 +13,7 @@ include = ["LICENSE", "README.md"]
1313

1414
[build-system]
1515
build-backend = "setuptools.build_meta"
16-
requires = ["setuptools==58.5.3", "wheel==0.37.0"]
16+
requires = ["setuptools==59.1.1", "wheel==0.37.0"]
1717

1818
[tool.black]
1919
include = '\.pyi?$'

pyscript.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ export PYTHONUNBUFFERED=1
101101

102102
# shellcheck disable=SC2269
103103
case "$function" in
104-
-h | --help) function=help ;;
105-
-v | --version) function=version ;;
106-
help | version | build | build_docs | deploy | install | fmt | security_analysis | static_analysis | test | coverage | clean) function=$function ;;
104+
-h | --help | help) function=help ;;
105+
-v | --version | version) function=version ;;
106+
build | build_docs | deploy | install | fmt | security_analysis | static_analysis | test | coverage | clean) function=$function ;;
107107
*) echo >&2 "pyscript: '$function' is not a pyscript command." && exit 1 ;;
108108
esac
109109

110-
eval "_$function" "$@"
110+
"_$function" "$@"

requirements-dev.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r requirements.txt
22
autoflake==1.4
3-
bandit==1.7.0
4-
black==21.10b0
3+
bandit==1.7.1
4+
black==21.11b1
55
commitizen==2.20.0
66
isort==5.10.1
77
liccheck==0.6.2
@@ -16,9 +16,9 @@ pytest-asyncio==0.16.0
1616
pytest-cov==3.0.0
1717
pytest-xdist==2.4.0
1818
pytoml==0.1.21
19-
setuptools==58.5.3
20-
shellcheck-py==0.7.2.1
21-
twine==3.5.0
19+
setuptools==59.1.1
20+
shellcheck-py==0.8.0.1
21+
twine==3.6.0
2222
types-dataclasses==0.6.1; python_version <= "3.6"
2323
types-backports==0.1.3; python_version <= "3.6"
2424
wheel==0.37.0

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
backports-datetime-fromisoformat>=1.0.0; python_version <= "3.6"
2+
dataclasses>=0.8; python_version <= "3.6"

0 commit comments

Comments
 (0)