-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
56 lines (46 loc) · 1.77 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
import os
from setuptools import setup, find_packages
import subprocess
__author__ = 'Josue Kouka'
__username__ = 'josuebrunel'
__email__ = '[email protected]'
name = 'mysdq'
version_py = os.path.join(os.path.dirname(__file__), 'version.py')
try:
version_git = subprocess.check_output(["git", "describe"]).rstrip().decode()
except Exception:
with open(version_py, 'r') as fh:
version_git = open(version_py).read().strip().split('=')[-1].replace('"', '')
version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
with open(version_py, 'w') as fh:
fh.write(version_msg + os.linesep + "__version__=" + version_git)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
url = "https://github.com/%s/%s/" % (__username__, name)
download_url = url + 'archive/{version}.tar.gz'.format(version=version_git)
requirements = read('requirements.txt').splitlines() if os.path.isfile('requirements.txt') else []
setup(
name=name,
version=version_git,
description="Simple Django queryset like dict querer",
long_description=read("README.rst"),
author=__author__,
author_email=__email__,
url=url,
download_url=download_url,
keywords=['dictquery', 'queryset', 'dict', 'query'],
packages=find_packages(),
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 5 - Production/Stable',
'Topic :: Software Development :: Libraries :: Python Modules',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License'
],
platforms=['Any'],
license='MIT',
install_requires=requirements
)