Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
104 lines (83 sloc) 2.71 KB
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import codecs
try:
from setuptools import setup, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Command # noqa
from distutils.command.install import INSTALL_SCHEMES
import bankdownloads as distmeta
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
src_dir = "bankdownloads"
def fullsplit(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 fullsplit(head, [tail] + result)
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
SKIP_EXTENSIONS = [".pyc", ".pyo", ".swp", ".swo"]
def is_unwanted_file(filename):
for skip_ext in SKIP_EXTENSIONS:
if filename.endswith(skip_ext):
return True
return False
for dirpath, dirnames, filenames in os.walk(src_dir):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith("."):
del dirnames[i]
for filename in filenames:
if filename.endswith(".py"):
packages.append('.'.join(fullsplit(dirpath)))
elif is_unwanted_file(filename):
pass
else:
data_files.append([dirpath, [os.path.join(dirpath, f) for f in
filenames]])
if os.path.exists("README.md"):
long_description = codecs.open("README.md", "r", "utf-8").read()
else:
long_description = "See http://github.com/evandavey/django-bankdownloads"
try:
REQUIREMENTS = open('requirements.txt').read()
except:
REQUIREMENTS = None
setup(
name = 'django-bankdownloads',
version=distmeta.__version__,
description=distmeta.__doc__,
install_requires=REQUIREMENTS,
author=distmeta.__author__,
author_email=distmeta.__contact__,
url=distmeta.__homepage__,
platforms=["any"],
license="CC-SA-NC",
packages = packages,
data_files = data_files,
classifiers = ['Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Utilities'],
zip_safe=False,
long_description=long_description,
)