forked from openego/eDisGo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
81 lines (73 loc) · 2.38 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
from setuptools import find_packages, setup
from setuptools.command.install import install
import os
import sys
BASEPATH = '.eDisGo'
if sys.version_info[:2] < (3, 7):
error = (
"eDisGo requires Python 3.7 or later (%d.%d detected)." % sys.version_info[:2]
)
sys.stderr.write(error + "\n")
sys.exit(1)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class InstallSetup(install):
def run(self):
self.create_edisgo_path()
install.run(self)
@staticmethod
def create_edisgo_path():
edisgo_path = os.path.join(os.path.expanduser('~'), BASEPATH)
data_path = os.path.join(edisgo_path, 'data')
if not os.path.isdir(edisgo_path):
os.mkdir(edisgo_path)
if not os.path.isdir(data_path):
os.mkdir(data_path)
setup(
name='eDisGo',
version='0.1.1dev',
packages=find_packages(),
url='https://github.com/openego/eDisGo',
license='GNU Affero General Public License v3.0',
author='birgits, AnyaHe, gplssm, nesnoj, jaappedersen, Elias, boltbeard',
author_email='[email protected]',
description='A python package for distribution network analysis and optimization',
long_description=read('README.md'),
long_description_content_type='text/markdown',
install_requires=[
'demandlib',
'networkx >= 2.5.0',
'geopy >= 2.0.0',
'pandas >= 1.2.0, < 1.3.0',
'pyproj >= 3.0.0',
'shapely >= 1.7.0',
'pypsa >= 0.17.0',
'pyomo >= 6.0',
'multiprocess',
'workalendar',
'sqlalchemy < 1.4.0',
'geoalchemy2 < 0.7.0',
'egoio >= 0.4.7',
'matplotlib >= 3.3.0',
'pypower',
'sklearn'
],
extras_require={
'geoplot': ['geopandas >= 0.9.0', 'contextily', 'descartes'],
'examples': ['jupyter'],
'dev': ['pytest', 'sphinx_rtd_theme'],
'full': ['geopandas >= 0.9.0', 'contextily', 'descartes', 'jupyter', 'pytest',
'sphinx_rtd_theme']
},
package_data={
'edisgo': [
os.path.join('config', 'config_system'),
os.path.join('config', '*.cfg'),
os.path.join('equipment', '*.csv')]
},
cmdclass={
'install': InstallSetup},
entry_points={
'console_scripts': ['edisgo_run = edisgo.tools.edisgo_run:edisgo_run']
}
)