This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
forked from manuelbua/gitver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
71 lines (56 loc) · 1.96 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
65
66
67
68
69
70
71
#!/usr/bin/env python2
# coding=utf-8
import sys
from setuptools import setup
from gitver.version import gitver_version, gitver_pypi
make_sdist = len({'sdist', 'build'} & set(sys.argv)) > 0
try:
import gitver._version_next as next
vtype = '(NEXT)'
except ImportError:
vtype = '(RELEASE)'
def readme():
if make_sdist:
try:
import pypandoc
return pypandoc.convert('README.md', 'rst')
except ImportError:
print "Warning: the \"pypandoc\" package and/or the pandoc " \
"binary can't be found on your system: if you want to " \
"generate the README.rst for PyPI you'll need to install " \
"them properly, else a fallback description will be used."
# falling back to a simple description
return 'Simple version string management for git'
def requirements():
with open('requirements.txt') as f:
return f.read()
def main():
"""Runs setuptools.setup()"""
scripts = [
'bin/gitver'
]
if make_sdist:
print "--------------------------------------------------"
print "Setting up for " + vtype + " v" + gitver_version
print "--------------------------------------------------"
setup(
name='gitver',
version=gitver_pypi,
description='Simple version string management for git',
long_description=readme(),
license='Apache License, Version 2.0',
author='Manuel Bua',
author_email='manuel.bua[at]gmail.com',
url='https://github.com/manuelbua/gitver',
scripts=scripts,
packages=['gitver'],
install_requires=requirements(),
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Version Control',
]
)
if __name__ == '__main__':
main()