-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
52 lines (48 loc) · 1.73 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
#!/usr/bin/env python
import os
import shutil
from setuptools import setup,Command
__version__ = '1.1.5'
class Doc(Command):
description = "Custom doc command that converts README.md to the reStructured text file README.txt"
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
import pypandoc
assert os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
description = pypandoc.convert('README.md', 'rst')
with open('README.txt','w+') as f:
f.write(description)
class Clean(Command):
description = "Custom clean command that forcefully removes dist/build directories"
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
assert os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
shutil.rmtree("./build", ignore_errors=True)
shutil.rmtree("./dist", ignore_errors=True)
shutil.rmtree("./viewlog.egg-info", ignore_errors=True)
try:
os.remove("./MANIFEST")
except OSError:
pass
setup(
name='viewlog',
version=__version__,
author='roubles',
author_email='[email protected]',
url='https://github.com/roubles/viewlog',
download_url='https://github.com/roubles/viewlog/tarball/' + __version__,
license='Creative Commons Attribution-Noncommercial-Share Alike license',
description='terminal git log browser',
long_description=open('README.txt').read(),
scripts = ['scripts/viewlog'],
install_requires=['pick==0.4.0'],
cmdclass={ 'doc': Doc, 'clean': Clean}
)