forked from wxwilcke/hypodisc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
43 lines (34 loc) · 1.12 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python
from setuptools import setup
import sys
try:
import tomllib as toml
except ImportError:
try:
import toml
except ImportError:
print("Outdated Python version detected.\n"
"Please install 'toml' to continue: "
" pip3 install toml")
sys.exit(1)
METADATA_FILE = "pyproject.toml"
def readme():
with open('README.md') as f:
return f.read()
mode = 'rb' if sys.version_info >= (3, 11) else 'r'
with open(METADATA_FILE, mode) as fb:
metadata = toml.load(fb)
setup(
name=metadata['project']['name'],
version=metadata['project']['version'],
author=metadata['project']['authors'][-1]['name'],
author_email=metadata['project']['authors'][-1]['email'],
url=metadata['project']['urls']['Homepage'],
install_requires=metadata['project']['dependencies'],
description=metadata['project']['description'],
long_description=open('README.md').read(),
long_description_content_type="text/markdown",
license='GLP3',
keywords=metadata['project']['keywords'],
python_requires=metadata['project']['requires-python'],
)