-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
44 lines (40 loc) · 1.32 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
44
import os
import re
import setuptools
def parse_init_file():
init_path = os.path.join(os.path.dirname(__file__), 'crystmatch', '__init__.py')
variables = {}
pattern = re.compile(r'^__(\w+)__\s*=\s*[\'"]([^\'"]+)[\'"]')
with open(init_path, 'r', encoding='utf-8') as f:
for line in f:
match = pattern.match(line.strip())
if match:
key, value = match.groups()
variables[key] = value
return variables
metadata = parse_init_file()
with open("README.md", "r", encoding="utf-8") as fhand:
long_description = fhand.read()
setuptools.setup(
name=metadata["name"],
version=metadata["version"],
author=metadata["author"],
author_email=metadata["email"],
description=(metadata["description"]),
long_description=long_description,
long_description_content_type="text/markdown",
url=metadata["url"],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
install_requires=["numpy", "scipy", "matplotlib", "spglib"],
packages=setuptools.find_packages(),
python_requires=">=3.9",
entry_points={
"console_scripts": [
"crystmatch = crystmatch:main",
]
}
)