-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
60 lines (56 loc) · 1.92 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
#Kage Park
import os
import setuptools
from sys import version_info
import subprocess
# require package
#python -m pip install wheel --user
#python -m pip install --upgrade build --user
#python -m pip install twine --user
def lib_ver():
my_dir=os.path.dirname(os.path.abspath(__file__))
if os.path.isdir(os.path.join(my_dir,'.git')):
gver=subprocess.check_output('''git describe --tags >/dev/null && (git describe --tags | sed "s/^v//g" | sed "s/^V//g") || (git tag V1.0; sleep 1; git describe --tags | sed "s/^v//g" | sed "s/^V//g")''',stderr=subprocess.STDOUT,shell=True)
if gver:
if version_info[0] >= 3:
if isinstance(gver,bytes): gver=gver.decode('latin1')
else:
if isinstance(gver,unicode): gver=gver.encode('latin1')
gver_a=gver.split('\n')[0].split('-')
if len(gver_a) == 1:
return gver_a[0]
else:
return '.'.join(gver_a[:-1])
else:
my_ver=os.path.basename(my_dir)
ver_a=my_ver.split('-')
if len(ver_a) == 2:
return ver_a[1]
return 1.0
pkg_name='SqlDB'
pkg_desc='SQL Family DB handler'
pkg_git="https://github.com/kagepark/SqlDB"
long_description=''
if os.path.isfile('README.md'):
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name=pkg_name,
version='{}'.format(lib_ver()),
author='Kage Park',
autor_email='kagepark1@gmail.com',
license="MIT",
description=pkg_desc,
long_description=long_description,
long_description_content_type="text/markdown",
url=pkg_git,
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
include_package_data=True,
# install_requires=["ast"],
)