Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
frontdevops committed Nov 1, 2022
1 parent b599e1d commit 856634b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions magic_config/magic_config/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ def set_attr(self, key: str, t: str = "str") -> None:
case _:
default = None

val = os.getenv(key, default)
if val is None:
self.__data[key] = default
return

if cast == "obj":
self.__data[key] = json.loads(os.getenv(key, default))
self.__data[key] = json.loads(val)
else:
self.__data[key] = cast(os.getenv(key, default))
self.__data[key] = cast(val)

def __new__(cls, *args, **kwargs) -> 'MagicConfig':
"""Create singleton instance of MagicConfig"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "magic-config"
version = "0.1.12"
version = "0.1.13"
authors = [
{ name = "Alexander Majorov", email = "[email protected]" },
]
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ def get_version() -> str:
raise RuntimeError('Unable to determine version.')


version = get_version()

setup(
name='magic_config',
version=get_version(),
version=version,
license='MIT',
author='Alexander Majorov',
author_email='[email protected]',
Expand All @@ -46,13 +48,13 @@ def get_version() -> str:
long_description=get_description(),
long_description_content_type="text/markdown",
url='https://github.com/frontdevops/magic-config',
download_url="https://github.com/frontdevops/magic-config/archive/refs/tags/0.1.11.tar.gz",
download_url=f"https://github.com/frontdevops/magic-config/archive/refs/tags/{version}.tar.gz",
project_urls={
"Documentation": "https://github.com/frontdevops/magic-config/blob/main/README.md",
"Source": "https://github.com/frontdevops/magic-config",
"Bug Tracker": "https://github.com/frontdevops/magic-config/issues",
},
keywords=["pypi", "config", "library"],
keywords=["pypi", "config", "library", "magic"],
classifiers=[
# 'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
Expand Down

0 comments on commit 856634b

Please sign in to comment.