forked from grigoryvp/parabridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
65 lines (58 loc) · 1.87 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
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python
# coding:utf-8 vi:et:ts=2
# parabridge distribute install
# Copyright 2013 Grigory Petrov
# See LICENSE for details.
import os
import setuptools
import subprocess
from parabridge.info import NAME_SHORT, DESCR, VER_MAJOR, VER_MINOR
## Get version from VCS.
VER_BUILD = 0
try:
## If this file exist, package is installed from pypi and this file is
## executed with 'egg_info' command-line argument.
with open( 'PKG-INFO' ) as oFile:
import rfc822
import re
sVer = rfc822.Message( oFile ).get( 'version' )
if sVer:
oMatch = re.match( r'\d+\.\d+\.(\d+)', sVer.strip() )
if oMatch:
VER_BUILD = int( oMatch.group( 1 ) )
except IOError:
DIR_THIS = os.path.dirname( os.path.abspath( __file__ ) )
sId = subprocess.check_output( [ 'hg', '-R', DIR_THIS, 'id', '-n' ] )
VER_BUILD = int( sId.strip( '+\n' ) )
VER_TXT = ".".join( map( str, [ VER_MAJOR, VER_MINOR, VER_BUILD ] ) )
setuptools.setup(
name = NAME_SHORT,
version = VER_TXT,
description = DESCR,
author = "Grigory Petrov",
author_email = "[email protected]",
url = "http://bitbucket.org/eyeofhell/{0}".format( NAME_SHORT ),
license = 'GPLv3',
packages = [ NAME_SHORT ],
zip_safe = True,
install_requires = [
## Python interface to Paradox database engine.
'pyparadox',
],
entry_points = {
'console_scripts': [
'{0} = {0}:main'.format( NAME_SHORT ),
],
},
## http://pypi.python.org/pypi?:action=list_classifiers
classifiers = [
('Development Status :: 1 - Planning'),
('Environment :: Console'),
('Intended Audience :: System Administrators'),
('License :: OSI Approved :: GNU General Public License v3 (GPLv3)'),
('Natural Language :: English'),
('Operating System :: OS Independent'),
('Programming Language :: Python :: 2.7'),
('Topic :: Database'),
]
)