forked from switch-model/switch
-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
106 lines (96 loc) · 3.76 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
"""Setup script for Switch.
Use "pip install --upgrade ." to install a copy in the site packages directory.
Use "pip install --upgrade --editable ." to install Switch to be run from its
current location.
Optional dependencies can be added during the initial install or later by
running a command like this:
pip install --upgrade --editable .[advanced,database_access]
Use "pip uninstall switch" to uninstall switch from your system.
"""
import os
from setuptools import setup, find_packages
# Get the version number. Strategy #3 from https://packaging.python.org/single_source_version/
version_path = os.path.join(os.path.dirname(__file__), "switch_model", "version.py")
version = {}
with open(version_path) as f:
exec(f.read(), version)
__version__ = version["__version__"]
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(
name="switch_model",
version=__version__,
maintainer="Switch Authors",
maintainer_email="[email protected]",
url="http://switch-model.org",
license="Apache License 2.0",
platforms=["any"],
description="Switch Power System Planning Model",
long_description=read("README.md"),
long_description_content_type="text/markdown",
classifiers=[
# from https://pypi.org/classifiers/
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Education",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
],
packages=find_packages(include=["switch_model", "switch_model.*"]),
keywords=[
"renewable",
"power",
"energy",
"electricity",
"production cost",
"capacity expansion",
"planning",
"optimization",
],
python_requires='>=3.7',
install_requires=[
"Pyomo>=6.1,<6.4.1", # 6.1 Has all the bug fixes we need
"pint", # needed by Pyomo when we run our tests, but not included
"testfixtures", # used for standard tests
"pandas", # used for input upgrades and testing that functionality
"gurobipy", # used to provided python bindings for Gurobi for faster solving
"pyyaml", # used to read configurations for switch
# Following libraries used for graphing
"matplotlib",
"seaborn",
"plotnine",
"scipy",
"pillow", # Image processing to make plots stick together
],
extras_require={
# packages used for advanced demand response, progressive hedging
# note: rpy2 discontinued support for Python 2 as of rpy2 2.9.0
"advanced": [
"numpy",
"scipy",
'rpy2<2.9.0;python_version<"3.0"',
'rpy2;python_version>="3.0"',
"sympy",
],
# These packages are installed when one runs 'pip install --editable .[dev]'
"dev": ["ipdb", "black", "psycopg2-binary"],
# On Windows at least, installing these will only work via conda.
# Run conda install -c conda-forge geopandas shapely [... all the other packages]
"maps_INSTALL_WITH_CONDA": ["geopandas", "shapely", "cartopy", "plotnine"]
},
entry_points={
"console_scripts": [
"switch = switch_model.__main__:main",
]
},
)