setup.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python
  2. import os,sys
  3. from setuptools import setup
  4. from jsbeautifier.__version__ import __version__
  5. from setuptools.command.test import test as TestCommand
  6. DIR='jsbeautifier/tests/'
  7. class PyTest(TestCommand):
  8. user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
  9. def initialize_options(self):
  10. TestCommand.initialize_options(self)
  11. self.pytest_args = ['--assert=plain'] +[DIR+x for x in os.listdir(DIR) if x.endswith('.py') and x[0] not in '._']
  12. def run_tests(self):
  13. #import here, cause outside the eggs aren't loaded
  14. import pytest
  15. errno = pytest.main(self.pytest_args)
  16. sys.exit(errno)
  17. setup(name='jsbeautifier',
  18. version=__version__,
  19. description='JavaScript unobfuscator and beautifier.',
  20. long_description=('Beautify, unpack or deobfuscate JavaScript. '
  21. 'Handles popular online obfuscators.'),
  22. author='Einar Lielmanis, Stefano Sanfilippo et al.',
  23. author_email='einar@jsbeautifier.org',
  24. url='http://jsbeautifier.org',
  25. scripts=['js-beautify'],
  26. packages=['jsbeautifier', 'jsbeautifier.tests', 'jsbeautifier.tests.generated',
  27. 'jsbeautifier.unpackers', 'jsbeautifier.unpackers.tests'],
  28. install_requires=["six>=1.6.1", "editorconfig>=0.12.0"],
  29. license='MIT',
  30. test_suite='pytest.collector',
  31. cmdclass = {'test': PyTest},
  32. )