-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
93 lines (81 loc) · 2.64 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
#!/usr/bin/env python
import os
import logging
from codecs import open
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from subprocess import check_call
import shlex
logger = logging.getLogger(__name__)
try:
from pypandoc import convert_text
except ImportError:
convert_text = lambda string, *args, **kwargs: string
here = os.path.abspath(os.path.dirname(__file__))
with open("README.md", encoding="utf-8") as readme_file:
readme = convert_text(readme_file.read(), "rst", format="md")
with open(os.path.join(here, "R2PD", "version.py"), encoding="utf-8") as f:
version = f.read()
version = version.split('=')[-1].strip().strip('"').strip("'")
test_requires = [
"backports.tempfile",
"pytest",
"pytest-cov",
"sphinx-rtd-theme",
"nbsphinx",
"sphinxcontrib-napoleon",
"ghp-import",
]
class PostDevelopCommand(develop):
def run(self):
try:
check_call(shlex.split("pre-commit install"))
except Exception:
logger.warning("Unable to run 'pre-commit install'")
develop.run(self)
setup(
name="R2PD",
version=version,
description="Renewable Resource and Power Data tool",
long_description=readme,
author="Michael Rossol, Elaine Hale",
author_email="[email protected]",
url="https://github.com/Smart-DS/R2PD",
packages=find_packages(),
package_dir={"R2PD": "R2PD"},
entry_points={
"console_scripts": ["R2PD=R2PD.cli:main",
"R2PD-lite=R2PD.r2pd_lite:cli"],
"shapers": [
"timeseries=R2PD.library.shapers:DefaultTimeseriesShaper",
"forecast=R2PD.library.shapers:DefaultForecastShaper",
],
# "formatters": [
# "csv=R2PD.library.formatters:ToCSV",
# "hdf=ditto.writers.opendss:ToHDF",
# ],
},
package_data={
"R2PD.library": ["solar_site_meta.csv", "wind_site_meta.csv"]
},
include_package_data=True,
license="MIT license",
zip_safe=False,
keywords="R2PD",
classifiers=[
"Development Status :: Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
],
test_suite="tests",
install_requires=["click", "future", "pandas", "numpy", "h5py", "scipy"],
extras_require={
"test": test_requires,
"dev": test_requires + ["pypandoc", "pre-commit"],
},
cmdclass={"develop": PostDevelopCommand},
)