-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
44 lines (33 loc) · 1.41 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
# -*- coding: utf-8 -*-
import re
from setuptools import setup
from setuptools.command.install import install as InstallCommand
#------------------------------------------------------------------------------
class PreInstallCommand(InstallCommand):
"""DO NOT INSTALL -- This is NOT ready to be installed."""
def run(self):
# PUT YOUR PRE-INSTALL SCRIPT HERE or CALL A FUNCTION
# NO # install.run(self)
# PUT YOUR POST-INSTALL SCRIPT HERE or CALL A FUNCTION
pass
#------------------------------------------------------------------------------
slurp = lambda fname : [(f.read(), f.close()) for f in [open(fname,'r')]][0][0]
contents = slurp('src/docopt.peg')
vpattern = ".*//\s*__version__\s*=\s*[\"'](.*)[\"']"
_version = re.search ( vpattern, contents, re.M ).group(1)
with open('README.rst', 'rb') as f:
_long_description = f.read().decode('utf-8')
#------------------------------------------------------------------------------
setup(
name = 'docopt-parser',
version = _version,
description = "Exploratory PEG Grammar for docopt style usaged text.",
author = 'Philip H. Dye',
url = 'https://github.com/philip-h-dye/docpt-parser',
long_description = _long_description,
# py_modules=['docopt_parser'], # none yet
cmdclass={
'install': PreInstallCommand,
},
)
#------------------------------------------------------------------------------