-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsetup.py
68 lines (60 loc) · 2.56 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
#!/usr/bin/env python3
__name__ = 'ThermoParser'
__author__ = 'Kieran B. Spooner'
__copyright__ = 'Copyright Scanlon Materials Theory Group (2024)'
__version__ = '3.1.4' # Remember to update the main README header too!
__maintainer__ = 'Kieran B. Spooner'
__email__ = '[email protected]'
__date__ = 'April 1st 2024'
import os
import setuptools
from setuptools.command.install import install
from shutil import copy
import unittest
with open('README.rst', 'r') as f:
long_description=f.read()
def load_test_suite():
test_loader = unittest.TestLoader()
test_suite = test_loader.discover('tests', pattern='test*.py')
return test_suite
def install_style():
from matplotlib import get_configdir
style = ['tp.mplstyle', 'tp-large.mplstyle']
styledir = os.path.join(get_configdir(), 'stylelib')
if not os.path.exists(styledir):
os.makedirs(styledir)
for plotting in style:
copy(os.path.join(os.path.dirname(__file__), plotting),
os.path.join(styledir, plotting))
class PostInstallMoveFile(install):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
install_style()
setuptools.setup(
name='tp',
version=__version__,
author=__author__,
description='streamlined analysis of thermoelectric properties',
long_description=long_description,
long_description_content_type='text/x-rst',
url='https://smtg-bham.github.io/ThermoParser/',
packages=setuptools.find_packages(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Scientific/Engineering :: Visualization'],
keywords='chemistry materials thermoelectric dft phonopy phono3py '
'amset boltztrap tp te matplotlib vasp transport',
test_suite='setup.load_test_suite',
install_requires=['click', 'h5py', 'matplotlib', 'numpy', 'pymatgen',
'pyyaml', 'scipy', 'setuptools', 'wheel'],
extras_require={'docs': ['sphinx', 'sphinx_rtd_theme']},
python_requires='>=3.8',
cmdclass={'install': PostInstallMoveFile},
entry_points={'console_scripts': ['tp = tp.cli.cli:tp_cli']})