Skip to content

Commit 68d685c

Browse files
committed
Fix
1 parent 6de515f commit 68d685c

File tree

5 files changed

+21
-142
lines changed

5 files changed

+21
-142
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Magic Config
2-
A simple library for easy handling of .env files and environment variables configurations
2+
A simple library for easy handling of .env files and environment variables configurations.
33

44
This library is a class for working with configurations. The class is implemented as a singleton, which allows you to always have exactly one instance of the same data registry everywhere.
55

@@ -40,12 +40,11 @@ if Config.debug:
4040
# You can access to variables as key of dict object
4141
if Config["debug"]:
4242
...
43-
4443
```
4544

4645
## Configure custom variables
4746
```py
48-
You can add variables to the object
47+
# You can add variables to the object
4948

5049
# as dict
5150
MagicConfig({

README.rst

Lines changed: 0 additions & 116 deletions
This file was deleted.

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ rm -vrf magic_config/magic_config.egg-info
1111

1212
python -m build
1313

14+
twine check dist/* && python -m twine upload --verbose dist/*
15+
16+
1417
#python -m twine upload --verbose --repository testpypi dist/*
15-
python -m twine upload --verbose dist/*
18+
#python -m twine upload --verbose dist/*
1619

setup.cfg renamed to setup._cfg

File renamed without changes.

setup.py

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
import re
33
import sys
4+
import tomllib
45
import pathlib
56
from setuptools import find_packages, setup
67

@@ -13,42 +14,34 @@
1314

1415

1516
def get_description() -> str:
16-
"""
17-
Read full description from 'README.md'
18-
:return: description
19-
:rtype: str
20-
"""
2117
with open('README.md', 'r', encoding='utf-8') as f:
2218
return f.read()
2319

2420

25-
def get_version() -> str:
26-
"""
27-
Read version
28-
:return: str
29-
"""
30-
txt = (WORK_DIR / 'pyproject.toml').read_text('utf-8')
21+
def get_meta_info() -> dict:
3122
try:
32-
return re.findall(r"^version = \"([^']+)\"\r?$", txt, re.M)[0]
23+
with open("pyproject.toml", "rb") as f:
24+
return tomllib.load(f)
3325
except IndexError:
3426
raise RuntimeError('Unable to determine version.')
3527

3628

37-
version = get_version()
29+
project_meta = get_meta_info()
30+
project_dir = project_meta["project"]["name"].replace("-", "_")
31+
3832

3933
setup(
40-
name='magic_config',
41-
version=version,
42-
license='MIT',
43-
author='Alexander Majorov',
44-
author_email='[email protected]',
45-
description=('Is a pretty simple library for working with configuration'
46-
' files based on the .env files and environment variables'
47-
),
34+
license="MIT",
35+
name=project_meta["project"]["name"],
36+
version=project_meta["project"]["version"],
37+
author=project_meta["project"]["authors"][0]["name"],
38+
author_email=project_meta["project"]["authors"][0]["email"],
39+
description=project_meta["project"]["description"],
4840
long_description=get_description(),
4941
long_description_content_type="text/markdown",
5042
url='https://github.com/frontdevops/magic-config',
51-
download_url=f"https://github.com/frontdevops/magic-config/archive/refs/tags/{version}.tar.gz",
43+
download_url=("https://github.com/frontdevops/magic-config/archive/refs/tags/"
44+
f'{project_meta["project"]["version"]}.tar.gz'),
5245
project_urls={
5346
"Documentation": "https://github.com/frontdevops/magic-config/blob/main/README.md",
5447
"Source": "https://github.com/frontdevops/magic-config",

0 commit comments

Comments
 (0)