-
Notifications
You must be signed in to change notification settings - Fork 29
/
setup.py
executable file
·80 lines (68 loc) · 2.53 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Setup ~/.pypirc at https://packaging.python.org/guides/migrating-to-pypi-org/
# python setup.py sdist
# pip3 install twine
# twine upload -r test dist/django-jinja-knockout-0.8.0.tar.gz
import os
import sys
import django_jinja_knockout
from setuptools import setup, find_namespace_packages
version = django_jinja_knockout.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
if sys.argv[-1] == 'tag':
print("Tagging the version on github:")
os.system("git tag -a %s -m 'version %s'" % (version, version))
os.system("git push --tags")
sys.exit()
lines = []
with open('README.rst', 'r') as readme_file:
for line in readme_file:
# Do not include github relative links which are not parsed by pypi.
if '.. github relative links' in line:
break
else:
lines.append(line)
readme = ''.join(lines)
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
# http://stackoverflow.com/questions/14399534/how-can-i-reference-requirements-txt-for-the-install-requires-kwarg-in-setuptool
with open('requirements.txt', 'r') as f:
install_reqs = [
s for s in [
line.split('#', 1)[0].strip(' \t\n') for line in f
] if s != ''
]
packages = find_namespace_packages(
where='.',
include=['django_jinja_knockout', 'django_jinja_knockout.*']
)
setup(
name='django-jinja-knockout',
version=version,
description="""Django AJAX ModelForms. Read-only display ModelForms. Django AJAX datatables with CRUD and custom actions. Supports Django Templates.""",
long_description=readme,
long_description_content_type='text/x-rst',
author='Dmitriy Sintsov',
author_email='[email protected]',
url='https://github.com/Dmitri-Sintsov/django-jinja-knockout',
packages=packages,
include_package_data=True,
install_requires=install_reqs,
license="LGPL-3.0",
zip_safe=False,
keywords='django jinja knockout.js ajax forms datatable datatables datagrid'.split(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
setup_requires=['wheel'],
)