-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·87 lines (74 loc) · 2.44 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python
import subprocess
import sys
from datetime import datetime
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.test import test
class CustomTestCommand(test):
def run(self):
create_version_file()
super(CustomTestCommand, self).run()
class CustomInstallCommand(install):
def run(self):
create_version_file()
self.do_egg_install()
class CustomDevelopCommand(develop):
def run(self):
create_version_file()
super(CustomDevelopCommand, self).run()
def create_version_file():
app_version = subprocess.Popen(sys.argv[0] + " --version", shell=True,
stdout=subprocess.PIPE).stdout.read().strip().decode()
commit_hash = subprocess.Popen("git rev-parse HEAD", shell=True,
stdout=subprocess.PIPE).stdout.read().strip().decode()
with open('pytcher/_version.py', 'wt') as fd:
fd.write("git_version = '%s'\n" % commit_hash)
fd.write("app_version = '%s'\n" % app_version)
fd.write("built_at = '%s'\n" % datetime.now())
setup(
name='pytcher',
version='0.0.2',
description='Micro framework for Python',
long_description='Micro framework for Python',
keywords='python rest routing framework',
license='Apache License 2.0',
author='Francois Dang Ngoc',
author_email='francois.dangngoc@gmail.com',
url='http://github.com/chimpler/pytcher',
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
install_requires=[
'python-dateutil',
'pytz',
'watchdog'
],
packages=[
'pytcher',
],
extras_require={
'json-path': [
'jsonpath-ng'
],
'docs': [
'mkdocs-material',
'markdown-include',
'sphinx',
'recommonmark'
]
},
cmdclass={
'install': CustomInstallCommand,
'develop': CustomDevelopCommand,
'test': CustomTestCommand
}
)