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
|
#!/usr/bin/env python
import ast
import os.path
from setuptools import setup, find_packages
class GetVersion(ast.NodeVisitor):
def __init__(self, path):
with open(path) as f:
self.visit(ast.parse(f.read(), path))
def visit_Assign(self, node):
if any(target.id == 'VERSION' for target in node.targets):
assert not hasattr(self, 'VERSION')
self.VERSION = node.value.value
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.rst')) as f:
long_description = f.read()
setup(
name='django-bitfield',
version=GetVersion(os.path.join(os.path.dirname(__file__), 'bitfield', '__init__.py')).VERSION,
author='Disqus',
author_email='opensource@disqus.com',
url='https://github.com/disqus/django-bitfield',
description='BitField in Django',
long_description=long_description,
long_description_content_type='text/x-rst',
packages=find_packages(),
zip_safe=False,
install_requires=[
'Django>=1.11.29',
],
extras_require={
'tests': [
'flake8',
'mysqlclient',
'psycopg2>=2.3',
'pytest-django',
],
},
include_package_data=True,
classifiers=[
'Framework :: Django',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Topic :: Software Development',
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
)
|