Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (64 sloc) 2.12 KB
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import join
import re
from setuptools import setup, find_packages
PYPI_RST_FILTERS = (
# Replace code-blocks
(r'\.\.\s? code-block::\s*(\w|\+)+', '::'),
# Remove travis ci badge
(r'.*travis-ci\.org/.*', ''),
# Remove pypip.in badges
(r'.*pypip\.in/.*', ''),
(r'.*crate\.io/.*', ''),
(r'.*coveralls\.io/.*', ''),
)
def rst(filename):
'''
Load rst file and sanitize it for PyPI.
Remove unsupported github tags:
- code-block directive
- travis ci build badge
'''
content = open(filename).read()
for regex, replacement in PYPI_RST_FILTERS:
content = re.sub(regex, replacement, content)
return content
def pip(filename):
'''Parse pip requirement file and transform it to setuptools requirements'''
path = join('requirements', filename)
return [line for line in open(path).readlines() if not line.startswith('-e')]
long_description = '\n'.join((
rst('README.rst'),
rst('CHANGELOG.rst'),
''
))
setup(
name='django-ember',
version=__import__('ember').__version__,
description=__import__('ember').__description__,
long_description=long_description,
url='https://github.com/noirbizarre/django-ember',
download_url='http://pypi.python.org/pypi/django-ember',
author='Axel Haustant',
author_email='noirbizarre+django@gmail.com',
packages=find_packages(),
include_package_data=True,
install_requires=pip('install.pip'),
tests_require=pip('test.pip'),
use_2to3=True,
license='LGPL',
classifiers=[
"Framework :: Django",
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Environment :: Web Environment",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: System :: Software Distribution",
"Programming Language :: Python",
'Programming Language :: Python :: 3',
"Topic :: Software Development :: Libraries :: Python Modules",
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
],
)