1#!/usr/bin/env python 2import os 3from setuptools import setup, find_packages 4try: 5 from itertools import imap as map, izip as zip 6except ImportError: 7 # Python3 has those in builtins. 8 pass 9 10try: 11 from sphinx.setup_command import BuildDoc 12 cmdclass = {'build_sphinx': BuildDoc} 13except ImportError: 14 cmdclass = {} 15 16 17# Figure out the version. This could also be done by importing the 18# module, the parsing takes place for historical reasons. 19import re 20here = os.path.dirname(os.path.abspath(__file__)) 21version_re = re.compile( 22 r'__version__ = (\(.*?\))') 23fp = open(os.path.join(here, 'src/webassets', '__init__.py')) 24version = None 25for line in fp: 26 match = version_re.search(line) 27 if match: 28 version = eval(match.group(1)) 29 break 30else: 31 raise Exception("Cannot find version in __init__.py") 32fp.close() 33 34 35setup( 36 name='webassets', 37 version=".".join(map(str, version)), 38 description='Media asset management for Python, with glue code for '+\ 39 'various web frameworks', 40 long_description='Merges, minifies and compresses Javascript and ' 41 'CSS files, supporting a variety of different filters, including ' 42 'YUI, jsmin, jspacker or CSS tidy. Also supports URL rewriting ' 43 'in CSS files.', 44 author='Michael Elsdoerfer', 45 author_email='michael@elsdoerfer.com', 46 license='BSD', 47 url='http://github.com/miracle2k/webassets/', 48 classifiers=[ 49 'Development Status :: 3 - Alpha', 50 'Environment :: Web Environment', 51 'Intended Audience :: Developers', 52 'License :: OSI Approved :: BSD License', 53 'Operating System :: OS Independent', 54 'Programming Language :: Python', 55 'Programming Language :: Python :: 3', 56 'Topic :: Internet :: WWW/HTTP', 57 'Topic :: Software Development :: Libraries', 58 ], 59 entry_points="""[console_scripts]\nwebassets = webassets.script:run\n""", 60 packages=find_packages('src'), 61 package_dir={'': 'src'}, 62 cmdclass=cmdclass, 63) 64