1#!/usr/bin/env python
2# coding: utf-8
3"""
4Flask-Assets
5-------------
6
7Integrates the ``webassets`` library with Flask, adding support for
8merging, minifying and compiling CSS and Javascript files.
9"""
10
11from __future__ import with_statement
12from setuptools import setup
13
14# Figure out the version; this could be done by importing the
15# module, though that requires dependencies to be already installed,
16# which may not be the case when processing a pip requirements
17# file, for example.
18def parse_version(asignee):
19    import os, re
20    here = os.path.dirname(os.path.abspath(__file__))
21    version_re = re.compile(
22        r'%s = (\(.*?\))' % asignee)
23    with open(os.path.join(here, 'src', 'flask_assets.py')) as fp:
24        for line in fp:
25            match = version_re.search(line)
26            if match:
27                version = eval(match.group(1))
28                return ".".join(map(str, version))
29        else:
30            raise Exception("cannot find version")
31version = parse_version('__version__')
32webassets_requirement = parse_version('__webassets_version__')
33
34setup(
35    name='Flask-Assets',
36    version=version,
37    url='http://github.com/miracle2k/flask-assets',
38    license='BSD',
39    author='Michael Elsdoerfer',
40    author_email='michael@elsdoerfer.com',
41    description='Asset management for Flask, to compress and merge ' \
42        'CSS and Javascript files.',
43    long_description=__doc__,
44    py_modules=['flask_assets'],
45    package_dir={'': 'src'},
46    zip_safe=False,
47    platforms='any',
48    entry_points={
49        'flask.commands': [
50            'assets = flask_assets:assets',
51        ],
52    },
53    install_requires=[
54        'Flask>=0.8',
55        'webassets%s' % webassets_requirement,
56    ],
57    classifiers=[
58        'Environment :: Web Environment',
59        'Intended Audience :: Developers',
60        'License :: OSI Approved :: BSD License',
61        'Operating System :: OS Independent',
62        'Programming Language :: Python',
63        'Programming Language :: Python :: 2',
64        'Programming Language :: Python :: 3',
65        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
66        'Topic :: Software Development :: Libraries :: Python Modules'
67    ],
68    test_suite='nose.collector',
69    tests_require=[
70        'nose',
71        'flask-script'
72    ],
73)
74