-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
78 lines (70 loc) · 2.16 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
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import subprocess, sys, os
from pathlib import Path
def julia_instantiate(install_lib_path):
args = ["julia", "_installation/julia_install_from_git.jl", "main", "main"]
# raise ImportError("package path %s", package_path)
package_path = Path(install_lib_path).joinpath("pomato")
process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, cwd=str(package_path))
process.communicate()
def check_for_julia():
# Check if julia exists
import distutils.spawn
import os
if not bool(distutils.spawn.find_executable("julia")):
raise ImportError('Julia Executable not found on path.')
else:
print("Julia Found!")
# https://stackoverflow.com/questions/20288711/post-install-script-with-python-setuptools
class DevelopCommand(develop):
"""Pre-installation for development mode."""
def run(self):
#check_for_julia()
develop.run(self)
class InstallCommand(install):
"""Pre-installation for installation mode."""
def run(self):
check_for_julia()
install.run(self)
julia_instantiate(self.install_lib)
setup(name='pomato',
version='0.5.0',
description='Power Market Tool',
author='Richard Weinhold',
author_email='riw@wip.tu-berlin.de',
url='https://github.com/richard-weinhold/pomato',
packages=find_packages(),
python_requires='>=3.6',
include_package_data = True,
install_requires=[
# 'alabaster',
# 'numpydoc',
'matplotlib',
'numpy',
'xlrd',
'openpyxl',
'pandas',
'pathlib',
'psutil',
'scipy',
'plotly',
'progress',
'geojson',
'shapely',
'logaugment',
'kaleido',
'dash',
'dash_bootstrap_components',
'dash_daq',
'pycddlib',
'requests',
'pyarrow'
# 'pypoman'
],
cmdclass={
'develop': DevelopCommand,
'install': InstallCommand,}
)