-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsetup.py
79 lines (68 loc) · 2.43 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
import os
from setuptools import setup, find_packages
# Hack to force dist utils to install data files in correct location along with
# Python package.
from distutils.command.install import INSTALL_SCHEMES
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
try:
long_description = open("README.rst").read()
except IOError:
long_description = ""
def full_split(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
if head == path:
return result
return full_split(head, [tail] + result)
# Compile the list of data files available.
data_files = []
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
for dir_path, dir_names, file_names in os.walk('django_extras'):
# Ignore .directories and Python3 cache directories
for idx, dir_name in enumerate(dir_names):
if dir_name.startswith('.') or dir_name == '__pycache__':
del dir_names[idx]
# Ignore package directories
if '__init__.py' in file_names:
continue
elif file_names:
data_files.append([dir_path, [os.path.join(dir_path, f) for f in file_names]])
setup(
name='django-extras',
version='0.3',
url="https://github.com/timsavage/django-extras",
license='LICENSE',
author='Tim Savage',
author_email='[email protected]',
description='Object Data Mapping for Python',
long_description=long_description,
packages=find_packages(exclude=('django_app_test',)),
data_files=data_files,
install_requires=['django>=1.4', 'six'],
zip_safe=False,
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Internet :: WWW/HTTP :: WSGI',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)