setup.py 1.56 KB
Newer Older
Ben Firshman's avatar
Ben Firshman committed
1
2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
chris's avatar
chris committed
3
4
import os
from distutils.core import setup, Command
chrisspen's avatar
chrisspen committed
5
import database_files
chris's avatar
chris committed
6

7
8
9
10
11
12
13
14
15
16
def get_reqs(reqs=[]):
    # optparse is included with Python <= 2.7, but has been deprecated in favor
    # of argparse.  We try to import argparse and if we can't, then we'll add
    # it to the requirements
    try:
        import argparse
    except ImportError:
        reqs.append("argparse>=1.1")
    return reqs

chris's avatar
chris committed
17
18
19
20
21
22
23
24
25
26
class TestCommand(Command):
    description = "Runs unittests."
    user_options = []
    def initialize_options(self):
        pass
    def finalize_options(self):
        pass
    def run(self):
        os.system('django-admin.py test --pythonpath=. --settings=database_files.tests.settings tests')

Ben Firshman's avatar
Ben Firshman committed
27
28
setup(
    name='django-database-files',
chrisspen's avatar
chrisspen committed
29
    version=database_files.__version__,
30
31
32
33
    description='A storage system for Django that stores uploaded files in both the database and file system.',
    author='Chris Spencer',
    author_email='chrisspen@gmail.com',
    url='http://github.com/chrisspen/django-database-files',
Ben Firshman's avatar
Ben Firshman committed
34
35
    packages=[
        'database_files',
36
37
38
        'database_files.management',
        'database_files.management.commands',
        'database_files.migrations',
Ben Firshman's avatar
Ben Firshman committed
39
    ],
40
41
42
43
44
45
46
47
    classifiers=[
        'Development Status :: 4 - Beta',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
    ],
48
    requires = ["Django (>=1.4)",],
chris's avatar
chris committed
49
50
51
    cmdclass={
        'test': TestCommand,
    },
52
)