[Mod] setup.py: use psycopg2-binary instead of psycopg2, and only install when psycopg2 doesn't exists.
This commit is contained in:
parent
1f70d34b12
commit
0aed24b403
13
setup.py
13
setup.py
@ -107,6 +107,15 @@ else:
|
|||||||
|
|
||||||
pkgs = find_packages()
|
pkgs = find_packages()
|
||||||
|
|
||||||
|
|
||||||
|
def is_psycopg2_exists():
|
||||||
|
try:
|
||||||
|
import psycopg2
|
||||||
|
return True
|
||||||
|
except ImportError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"PyQt5<5.12",
|
"PyQt5<5.12",
|
||||||
"qdarkstyle",
|
"qdarkstyle",
|
||||||
@ -114,7 +123,6 @@ install_requires = [
|
|||||||
"websocket-client",
|
"websocket-client",
|
||||||
"peewee",
|
"peewee",
|
||||||
"pymysql",
|
"pymysql",
|
||||||
"psycopg2",
|
|
||||||
"mongoengine",
|
"mongoengine",
|
||||||
"numpy",
|
"numpy",
|
||||||
"pandas",
|
"pandas",
|
||||||
@ -127,6 +135,9 @@ install_requires = [
|
|||||||
"ibapi",
|
"ibapi",
|
||||||
"deap"
|
"deap"
|
||||||
]
|
]
|
||||||
|
if not is_psycopg2_exists():
|
||||||
|
install_requires.append("psycopg2-binary")
|
||||||
|
|
||||||
if sys.version_info.minor < 7:
|
if sys.version_info.minor < 7:
|
||||||
install_requires.append("dataclasses")
|
install_requires.append("dataclasses")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user