diff --git a/.flake8 b/.flake8 index d34cc7a..94b9207 100644 --- a/.flake8 +++ b/.flake8 @@ -19,5 +19,6 @@ include = exclude = src/calmjs/parse/parsers/*tab*.py, .git, + .eggs, .env*, env* diff --git a/setup.py b/setup.py index f5a09e4..c331c10 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,27 @@ +import atexit import sys from setuptools import setup, find_packages +from setuptools.command.develop import develop +from setuptools.command.install import install from subprocess import call + +class DevelopHook(develop): + """For hooking the optimizer when setup exits""" + def __init__(self, *a, **kw): + develop.__init__(self, *a, **kw) + atexit.register( + call, [sys.executable, '-m', 'calmjs.parse.parsers.optimize']) + + +class InstallHook(install): + """For hooking the optimizer when setup exits""" + def __init__(self, *a, **kw): + install.__init__(self, *a, **kw) + atexit.register( + call, [sys.executable, '-m', 'calmjs.parse.parsers.optimize']) + + version = '0.9.0' classifiers = """ @@ -41,13 +61,14 @@ namespace_packages=['calmjs'], include_package_data=True, zip_safe=False, + cmdclass={ + 'develop': DevelopHook, + 'install': InstallHook, + }, install_requires=[ 'ply>=3.6', ], - entry_points=""" - # -*- Entry points: -*- - """, + entry_points={ + }, test_suite="calmjs.parse.tests.make_suite", ) - -call([sys.executable, '-m', 'calmjs.parse.parsers.optimize'])