-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
36 lines (31 loc) · 1.18 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
import os
import sys
from setuptools import setup
# transfer profile_pydistsim for ipython into IPYTHONDIR
if "install" in sys.argv or "develop" in sys.argv:
import shutil
try:
from IPython.paths import get_ipython_dir
ipythondir = get_ipython_dir()
except ImportError: # @ReservedAssignment
print(
"PyDistSim IPython configuration not installed. Install latest "
"IPython and then copy the conf/ipython/profile_pydistsim/"
"ipython_config.py manually to IPython config dir."
)
else:
profiledir = os.path.join(ipythondir, "profile_pydistsim")
if not os.path.exists(ipythondir):
os.makedirs(ipythondir)
if not os.path.exists(profiledir):
os.makedirs(profiledir)
print("copying ipython_config.py and ipython_notebook_config.py to " + profiledir)
shutil.copy(
os.path.join("pydistsim", "conf", "ipython", "ipython_config.py"),
profiledir,
)
shutil.copy(
os.path.join("pydistsim", "conf", "ipython", "ipython_notebook_config.py"),
profiledir,
)
setup()