forked from switch-model/switch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
121 lines (111 loc) · 4.7 KB
/
setup.py
File metadata and controls
121 lines (111 loc) · 4.7 KB
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
"""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="authors@switch-model.org",
url="http://switch-model.org",
license="Apache License 2.0",
platforms=["any"],
description="Switch Power System Planning Model",
long_description=read("README"),
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",
],
# Pyomo <=6.4.2 crashes on Python 3.11, so we rule that out until they
# resolve it
python_requires=">=3.7.0, <3.11.0a0",
install_requires=[
# Most of our code is compatible with Pyomo 5.5.1+, but Pyomo <=5.6.8
# has a bug that makes it fail to report when values are out of domain
# for a parameter. So we must require a later version than 5.6.8, which
# was the highest version we previously supported, so all users will
# need to upgrade their Pyomo version.
# In principle, we could accept Pyomo 5.6.9 with pyutilib 5.8.0 (works
# OK in testing), but we block that because Pyomo 5.6.9 says it's
# willing to work with pyutilib 6.0.0, but isn't actually compatible.
# We have to allow pyutilib 6.0.0 for the later versions of Pyomo and
# setuptools doesn't give us a way to say Pyomo 5.6.9 should only be
# installed with pyutilib 5.8.0, so we just block Pyomo 5.6.9.
"Pyomo >=5.7.0, <=6.4.2",
# Pyomo 5.7 specifies that it needs pyutilib >=6.0.0. We've seen cases
# cases where Pyomo released a later pyutilib that broke an earlier
# Pyomo (e.g., Pyomo 5.6.x with Pyutilib 6.0.0), so we had to
# retroactively pin the pyutilib version. Pyomo 6.0 phased out the
# pyutilib dependency, but we still pin at 6.0.0, just in case the user
# installs Pyomo 5.7 and Pyutilib releases an incompatible update.
"pyutilib ==6.0.0",
# pint is needed by Pyomo when running our tests, but isn't installed by
# Pyomo.
"pint",
# used for standard tests
"testfixtures",
# used for input upgrades and some reporting
"pandas",
],
extras_require={
# packages used for advanced demand response, progressive hedging
"advanced": [
"numpy",
"scipy",
"rpy2",
"sympy",
],
"dev": ["ipdb"],
"plotting": [
# plotnine before <= 0.9.0 is not compatible with matplotlib >= 3.6
# later versions of plotnine may be, but for now we require that
# matplotlib be below 3.6.0 to ensure compatibility.
# See https://stackoverflow.com/a/73797154/
"plotnine<=0.9.0",
"matplotlib<3.6.0a0",
],
"database_access": ["psycopg2-binary"],
},
entry_points={"console_scripts": ["switch = switch_model.main:main"]},
)