-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
70 lines (53 loc) · 1.84 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
"""
Author: F. Thomas
Date: February 17, 2021
"""
from setuptools import setup
import setuptools
from setuptools.command.build_py import build_py
import versioneer
import subprocess
from pathlib import Path
import shutil
from hercules import _versionhelper
class cmd_build_py(build_py):
def run(self) -> None:
_versionhelper.persist_hexbug_commit_version()
#pickle CRESana models
try:
import cresana
path = Path('hercules/hexbug/Phase4/CRESana_models')
paths_to_delete = [p for p in path.glob('*') if not p.suffix=='.py']
for p in paths_to_delete:
if p.is_file():
p.unlink()
else:
shutil.rmtree(p)
for file in path.glob('*.py'):
subprocess.run(['python', str(file)])
except:
print('Not installing CRESana models')
build_py.run(self)
with open("README.md", "r") as fh:
long_description = fh.read()
with open("requirements.txt", "r") as fh:
required = [line.strip() for line in fh]
cmd_class = {'build_py': cmd_build_py}
setup(
name="hercules",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(cmd_class),
author="Florian Thomas, Mingyu (Charles) Li",
author_email="fthomas@uni-mainz.de, mingyuli@mit.edu",
description="https://github.com/project8/hercules",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/project8/hercules",
packages=setuptools.find_packages(),
package_data={'hercules': ['hexbug/**/**/*', 'hexbug/**/*', 'hexbug/*', 'settings/*']},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
python_requires='>=3.5',
install_requires=required)