-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
42 lines (39 loc) · 1.35 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
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools.command.install import install
import os
import pathlib
def _patch_bashrc():
bashrc_path=os.path.join(str(pathlib.Path.home()),'.bashrc')
try:
with open(bashrc_path,'r') as fp:
bashrc = fp.readlines()
except FileNotFoundError:
bashrc=[]
for line in bashrc:
if 'eval "$(register-python-argcomplete scilog)"' in line:
break
else:
with open(bashrc_path,'a+') as fp:
fp.write('# added by scilog installer\neval "$(register-python-argcomplete scilog)"\n')
class PostInstallCommand(install):
def run(self):
_patch_bashrc()
install.run(self)
setup(
name='scilog',
version='1.7.2',
url = 'https://github.com/soerenwolfers/scilog',
python_requires='>=3.6',
long_description=open('README.rst').read(),
description='Record-keeping for computational experiments',
author='Soeren Wolfers',
author_email='[email protected]',
packages=find_packages(exclude=['*tests']),#,'examples*']),
install_requires=['swutil','IPython','matplotlib','numpy','argcomplete'],
scripts=['bin/gitdiffuntracked','bin/scilog'],
#entry_points={'console_scripts': ['scilog = scilog.command_line:main']},
cmdclass={
'install': PostInstallCommand,
},
)