-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
executable file
·148 lines (122 loc) · 3.96 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
from io import open
import os
import sys
from setuptools import find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install
# Get package __version__.
# Same effect as "from s import __version__",
# but avoids importing the module which may not be installed yet:
__version__ = None
here = os.path.abspath(os.path.dirname(__file__))
with open("hypernets_processor/version.py") as f:
exec(f.read())
# Get the long description from the README file
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
def pre_install_processor_setup():
pass
def post_install_processor_setup():
sys.argv = sys.argv[:1]
from hypernets_processor.cli.setup_processor_cli import cli
print("\nSet up processor\n----------------\n")
cli()
return None
class SetupDevelopCommand(develop):
"""
Custom installation for development mode.
"""
user_options = develop.user_options + [
("setup-processor", None, "Option to run additional processor setup."),
]
def initialize_options(self):
develop.initialize_options(self)
self.setup_processor = 0
def run(self):
if self.setup_processor:
pre_install_processor_setup()
develop.run(self)
if self.setup_processor:
post_install_processor_setup()
class SetupInstallCommand(install):
"""
Custom installation for installation mode
"""
user_options = install.user_options + [
("setup-processor", None, "Option to run additional processor setup."),
]
def initialize_options(self):
install.initialize_options(self)
self.setup_processor = 0
def run(self):
if self.setup_processor:
pre_install_processor_setup()
install.run(self)
if self.setup_processor:
post_install_processor_setup()
setup(
name="hypernets_processor",
version=__version__,
description="Software for processing Hypernets field data",
authors=["Pieter De Vis", "Clemence Goyens", "Sam Hunt"],
long_description=long_description,
author_email="[email protected]",
url="http://hypernets.eu",
packages=find_packages(exclude=["contrib", "docs", "tests"]),
include_package_data=True,
cmdclass={
"develop": SetupDevelopCommand,
"install": SetupInstallCommand,
},
package_data={
"hypernets_processor": [
os.path.join("etc", "processor.config"),
os.path.join("etc", "scheduler.config"),
os.path.join("etc", "jobs.txt"),
os.path.join("etc", "job_template.config"),
os.path.join("etc", "processor_land_defaults.config"),
os.path.join("etc", "processor_water_defaults.config"),
"calibration/calibration_files/*/*/*/*"],
},
setup_requires=['numpy'],
install_requires=[
"alembic==1.10.2",
"numpy",
"netCDF4",
"schedule",
"matplotlib",
"pysolar",
"dataset",
"sqlalchemy==1.3.20",
"sqlalchemy-utils",
"punpy>=1.0.0",
"matheo",
"comet_maths>=1.0.0",
"obsarray>=1.0.0",
"freezegun",
"importlib-metadata>=4.0.1",
"pyhdf",
],
extras_require={
"docs": [
"sphinx",
"sphinx_design",
"sphinx_book_theme",
"ipython",
"sphinx_autosummary_accessors",
"sphinx-rtd-theme"
],
"dev": [
"pytest >=5.4.1",
"pytest-cov >=2.8.1",
]
},
entry_points={
"console_scripts": [
"hypernets_sequence_processor = hypernets_processor.cli.sequence_processor_cli:cli",
"hypernets_scheduler = hypernets_processor.cli.scheduler_cli:cli",
"hypernets_processor_setup = hypernets_processor.cli.setup_processor_cli:cli",
"hypernets_processor_job_init = hypernets_processor.cli.init_job_cli:cli"
],
},
)