Skip to content

Commit 07c5d5e

Browse files
committed
fix: forgot to convert os.environ values to string orz
1 parent 4f71e17 commit 07c5d5e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

nbs/00_core.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
" for key, value in validated_config.items():\n",
322322
" if key in os.environ:\n",
323323
" continue\n",
324-
" os.environ[key] = value\n",
324+
" os.environ[key] = str(value)\n",
325325
" \n",
326326
" return validated_config"
327327
]
@@ -711,6 +711,7 @@
711711
" 'type': 'object',\n",
712712
" 'properties': {\n",
713713
" 'UNINVITED_GUEST': { 'type': 'string', 'default': 'from schema' },\n",
714+
" 'convert_me': { 'type': 'integer', 'default': 1 },\n",
714715
" }\n",
715716
" }))\n",
716717
" \n",
@@ -750,6 +751,8 @@
750751
" )\n",
751752
" test_eq(validated_config1, validated_config2)\n",
752753
" test_eq(os.environ.get(\"UNINVITED_GUEST\"), \"from schema\")\n",
754+
" test_eq(validated_config1.get(\"convert_me\"), 1)\n",
755+
" test_eq(os.environ.get(\"convert_me\"), \"1\")\n",
753756
" \n",
754757
" os.environ.pop('UNINVITED_GUEST')\n",
755758
" # update os.environ, loading from dotenv\n",

schematized_config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.7"
1+
__version__ = "0.0.8"

schematized_config/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,6 @@ def load_dotenv(cls,
198198
for key, value in validated_config.items():
199199
if key in os.environ:
200200
continue
201-
os.environ[key] = value
201+
os.environ[key] = str(value)
202202

203203
return validated_config

settings.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[DEFAULT]
22
repo = python-schematized-config
33
lib_name = python-schematized-config
4-
version = 0.0.7
4+
version = 0.0.8
55
min_python = 3.7
66
license = apache2
77
black_formatting = False

0 commit comments

Comments
 (0)