debian-django-admin-rangefi.../setup.py

66 lines
2.2 KiB
Python
Raw Permalink Normal View History

2016-06-24 12:17:49 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
2016-08-02 11:20:38 +02:00
import re
2018-04-16 11:45:08 +02:00
from os.path import join, dirname
2016-06-24 12:17:49 +02:00
from setuptools import setup
2016-08-02 11:20:38 +02:00
def get_version(package):
init_py = open(os.path.join(package, '__init__.py')).read()
2018-12-05 07:54:10 +01:00
return re.search('__version__ = [\'"]([^\'"]+)[\'"]', init_py).group(1)
2016-08-02 11:20:38 +02:00
2016-06-24 12:17:49 +02:00
def get_packages(package):
return [dirpath for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path.join(dirpath, '__init__.py'))]
def get_package_data(package):
walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
for dirpath, dirnames, filenames in os.walk(package)
if not os.path.exists(os.path.join(dirpath, '__init__.py'))]
filepaths = []
for base, filenames in walk:
filepaths.extend([os.path.join(base, filename)
for filename in filenames])
return {package: filepaths}
setup(
name='django-admin-rangefilter',
2016-08-02 11:20:38 +02:00
version=get_version('rangefilter'),
2016-06-24 12:17:49 +02:00
url='https://github.com/silentsokolov/django-admin-rangefilter',
license='MIT',
2018-04-11 14:18:33 +02:00
description='django-admin-rangefilter app, add the filter by a custom date range on the admin UI.',
2018-04-16 11:45:08 +02:00
long_description=open(join(dirname(__file__), 'README.rst')).read(),
2016-06-24 12:17:49 +02:00
author='Dmitriy Sokolov',
author_email='silentsokolov@gmail.com',
packages=get_packages('rangefilter'),
package_data=get_package_data('rangefilter'),
2018-04-11 14:18:33 +02:00
include_package_data=True,
2016-06-24 12:17:49 +02:00
install_requires=[],
2018-04-11 14:18:33 +02:00
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
zip_safe=False,
platforms='any',
2016-06-24 12:17:49 +02:00
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
2018-04-11 14:18:33 +02:00
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
2016-06-24 12:17:49 +02:00
'Programming Language :: Python :: 3',
2018-04-11 14:18:33 +02:00
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
2016-06-24 12:17:49 +02:00
'Topic :: Utilities',
],
)