-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsetup.py
85 lines (68 loc) · 2.46 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
73
74
75
76
77
78
79
80
81
82
83
84
from __future__ import print_function
import sys
import os
from glob import glob
import shutil
try:
import setuptools
except ImportError:
sys.stderr.write(
"Please install setuptools before running this script. Exiting.")
sys.exit(1)
from setuptools import setup, find_packages
# --------------------------------------------------------------------------- #
# Basic project information
# --------------------------------------------------------------------------- #
name = 'BGWpy'
description = 'Interface BerkeleyGW flows in python.'
license = 'BSD'
url = 'https://github.com/BerkeleyGW/BGWpy'
__version__ = '3.2.3'
# author and author_email should be a single string, not a list, but we can put
# multiple authors / emails by separating them by commas inside the string.
# If you contributed to this package, add your name and email. Don't be shy!
author = 'Gabriel Antonius'
author_email = '[email protected]'
# Requirements
install_requires = [
'numpy >=1.6',
'pymatgen >=2021',
]
# --------------------------------------------------------------------------- #
# Helper functions
# --------------------------------------------------------------------------- #
def find_package_data():
package_data={'BGWpy': ['data/structures/*', 'data/pseudos/*']}
return package_data
def find_data_files():
return [('config', ['config/BGWpyrc'])]
def find_scripts():
scripts = []
for fname in glob(os.path.join('BGWpy', 'scripts', "*.py")):
if os.path.basename(fname) != '__init__.py':
scripts.append(fname)
return scripts
def cleanup():
print('Cleaning up')
shutil.rmtree('BGWpy.egg-info', ignore_errors=True)
shutil.rmtree('build', ignore_errors=True)
shutil.rmtree('__pycache__', ignore_errors=True)
# --------------------------------------------------------------------------- #
# Setup
# --------------------------------------------------------------------------- #
setup_args = dict(
name = name,
version = __version__,
description = description,
author = author,
author_email = author_email,
license = license,
url = url,
install_requires = install_requires,
packages = find_packages(),
package_data = find_package_data(),
data_files = find_data_files(),
scripts = find_scripts(),
)
if __name__ == "__main__":
setup(**setup_args)