forked from tobiasgass/vsdConnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
48 lines (38 loc) · 1.28 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
#!/usr/bin/env python
from setuptools import setup
from distutils.command.sdist import sdist
import os
import sys
class sdist_git(sdist):
"""Add revision number to version for development releases."""
def run(self):
if "dev" in self.distribution.metadata.version:
self.distribution.metadata.version += self.get_tip_revision()
sdist.run(self)
def get_tip_revision(self, path=os.getcwd()):
try:
import git
except ImportError:
return ''
try:
repo = git.Repo('.')
except git.InvalidGitRepositoryError:
return ''
return repo.head.commit.hexsha[:7]
install_requires = [
'requests',
'pyjwt>1.3',
'jsonmodels',
'six']
major_python_version, minor_python_version, _, _, _ = sys.version_info
if major_python_version < 3 or (major_python_version == 3 and minor_python_version < 4):
install_requires.append('pathlib')
setup(
name = "vsdConnect",
version = "0.8dev",
package_dir = {'vsdConnect': 'vsdConnect'},
packages = ['vsdConnect'],
long_description = open('README.md').read(),
install_requires = install_requires,
url = 'https://github.com/SICASFoundation/vsdConnect'
)