-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
72 lines (61 loc) · 2.1 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (C) 2020-2022 Markus Wallerberger, Hiroshi Shinaoka, and others
# SPDX-License-Identifier: MIT
import io, os.path, re
from setuptools import setup, find_packages
def readfile(*parts):
"""Return contents of file with path relative to script directory"""
herepath = os.path.abspath(os.path.dirname(__file__))
fullpath = os.path.join(herepath, *parts)
with io.open(fullpath, 'r') as f:
return f.read()
def extract_varvals(*varnames):
"""Extract value of __version__ variable by parsing python script"""
initfile = readfile('src', 'sparse_ir', '__init__.py')
for varname in varnames:
var_re = re.compile(rf"(?m)^{varname}\s*=\s*['\"]([^'\"]*)['\"]")
match = var_re.search(initfile)
yield match.group(1)
REPO_URL = "https://github.com/SpM-lab/sparse-ir"
VERSION, = extract_varvals('__version__')
LONG_DESCRIPTION = readfile('README.rst')
setup(
name='sparse-ir',
version=VERSION,
description=
'intermediate representation (IR) basis for electronic propagator',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/x-rst',
keywords=' '.join([
'irbasis', 'many-body', 'propagator', 'svd'
]),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Physics',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
],
url=REPO_URL,
author=[
'Markus Wallerberger',
'Hiroshi Shinaoka',
'Kazuyoshi Yoshimi',
'Junya Otsuki',
'Chikano Naoya'
],
author_email='[email protected]',
python_requires='>=3',
install_requires=[
'numpy',
'scipy',
'setuptools'
],
extras_require={
'test': ['pytest', 'irbasis', 'xprec'],
'doc': ['sphinx>=2.1', 'sphinx_rtd_theme'],
'xprec': [f'xprec>=1.0'],
},
package_dir={'': 'src'},
packages=find_packages(where='src'),
)