This repository was archived by the owner on Nov 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsetup.py
73 lines (64 loc) · 2.32 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
# -*- encoding: utf-8 -*-
import os, sys
from setuptools import setup
from setuptools import find_packages
# Make the open function accept encodings in python < 3.x
if sys.version_info[0] < 3:
import codecs
open = codecs.open # pylint: disable=redefined-builtin
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def get_path(fname):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
def read(fname):
return open(get_path(fname), 'r', encoding='utf8').read()
if sys.argv[-1] == 'genreadme':
try:
import pypandoc
long_description = pypandoc.convert(get_path('README.md'), 'rst')
long_description = long_description.split('<!---Illegal PyPi RST data -->')[0]
f = open(get_path('README.rst'), 'w')
f.write(long_description)
f.close()
print("Successfully converted README.md to README.rst")
except (IOError, ImportError):
pass
sys.exit()
try:
long_description=read('README.rst')
except (OSError, IOError):
try:
long_description=read('README.md')
except (OSError, IOError):
long_description = ""
setup(
name="django-compat",
version="1.0.15",
author='arteria GmbH',
author_email="[email protected]",
packages=find_packages(),
include_package_data=True,
description="For- and backwards compatibility layer for Django 1.4, 1.7, 1.8, 1.9, 1.10, and 1.11",
long_description=long_description,
license='MIT',
install_requires=open('requirements.txt').read().splitlines(),
url="https://github.com/arteria/django-compat",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Framework :: Django',
'License :: OSI Approved :: MIT License',
'Framework :: Django',
'Framework :: Django :: 1.4',
'Framework :: Django :: 1.6',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
)