| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
import ast |
| 4 |
import os.path |
| 5 |
from setuptools import setup, find_packages |
| 6 |
|
| 7 |
class GetVersion(ast.NodeVisitor): |
| 8 |
def __init__(self, path): |
| 9 |
with open(path) as f: |
| 10 |
self.visit(ast.parse(f.read(), path)) |
| 11 |
|
| 12 |
def visit_Assign(self, node): |
| 13 |
if any(target.id == 'VERSION' for target in node.targets): |
| 14 |
assert not hasattr(self, 'VERSION') |
| 15 |
self.VERSION = node.value.s |
| 16 |
|
| 17 |
this_directory = os.path.abspath(os.path.dirname(__file__)) |
| 18 |
with open(os.path.join(this_directory, 'README.rst')) as f: |
| 19 |
long_description = f.read() |
| 20 |
|
| 21 |
setup( |
| 22 |
name='django-bitfield', |
| 23 |
version=GetVersion(os.path.join(os.path.dirname(__file__), 'bitfield', '__init__.py')).VERSION, |
| 24 |
author='Disqus', |
| 25 |
author_email='[email protected]', |
| 26 |
url='https://github.com/disqus/django-bitfield', |
| 27 |
description='BitField in Django', |
| 28 |
long_description=long_description, |
| 29 |
long_description_content_type='text/x-rst', |
| 30 |
packages=find_packages(), |
| 31 |
zip_safe=False, |
| 32 |
install_requires=[ |
| 33 |
'Django>=1.11.29', |
| 34 |
], |
| 35 |
extras_require={ |
| 36 |
'tests': [ |
| 37 |
'flake8', |
| 38 |
'mysqlclient', |
| 39 |
'psycopg2>=2.3', |
| 40 |
'pytest-django', |
| 41 |
], |
| 42 |
}, |
| 43 |
include_package_data=True, |
| 44 |
classifiers=[ |
| 45 |
'Framework :: Django', |
| 46 |
'Intended Audience :: Developers', |
| 47 |
'Intended Audience :: System Administrators', |
| 48 |
'Operating System :: OS Independent', |
| 49 |
'Topic :: Software Development', |
| 50 |
"Programming Language :: Python", |
| 51 |
"Programming Language :: Python :: 3", |
| 52 |
"Programming Language :: Python :: 3.4", |
| 53 |
"Programming Language :: Python :: 3.5", |
| 54 |
"Programming Language :: Python :: 3.6", |
| 55 |
"Programming Language :: Python :: 3.7", |
| 56 |
"Programming Language :: Python :: 3.8", |
| 57 |
"Programming Language :: Python :: 3.9", |
| 58 |
], |
| 59 |
) |