setup.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # -*- coding: utf-8 -*-
  2. import subprocess
  3. import sys
  4. from distutils.cmd import Command
  5. from setuptools import setup
  6. try:
  7. from babel import __version__
  8. except SyntaxError as exc:
  9. sys.stderr.write("Unable to import Babel (%s). Are you running a supported version of Python?\n" % exc)
  10. sys.exit(1)
  11. class import_cldr(Command):
  12. description = 'imports and converts the CLDR data'
  13. user_options = []
  14. def initialize_options(self):
  15. pass
  16. def finalize_options(self):
  17. pass
  18. def run(self):
  19. subprocess.check_call([sys.executable, 'scripts/download_import_cldr.py'])
  20. setup(
  21. name='Babel',
  22. version=__version__,
  23. description='Internationalization utilities',
  24. long_description="""A collection of tools for internationalizing Python applications.""",
  25. author='Armin Ronacher',
  26. author_email='armin.ronacher@active-4.com',
  27. license='BSD',
  28. url='http://babel.pocoo.org/',
  29. classifiers=[
  30. 'Development Status :: 5 - Production/Stable',
  31. 'Environment :: Web Environment',
  32. 'Intended Audience :: Developers',
  33. 'License :: OSI Approved :: BSD License',
  34. 'Operating System :: OS Independent',
  35. 'Programming Language :: Python',
  36. 'Programming Language :: Python :: 2.6',
  37. 'Programming Language :: Python :: 2.7',
  38. 'Programming Language :: Python :: 3',
  39. 'Programming Language :: Python :: 3.3',
  40. 'Programming Language :: Python :: 3.4',
  41. 'Programming Language :: Python :: 3.5',
  42. 'Programming Language :: Python :: Implementation :: PyPy',
  43. 'Topic :: Software Development :: Libraries :: Python Modules',
  44. ],
  45. packages=['babel', 'babel.messages', 'babel.localtime'],
  46. include_package_data=True,
  47. install_requires=[
  48. # This version identifier is currently necessary as
  49. # pytz otherwise does not install on pip 1.4 or
  50. # higher.
  51. 'pytz>=0a',
  52. ],
  53. cmdclass={'import_cldr': import_cldr},
  54. zip_safe=False,
  55. # Note when adding extractors: builtin extractors we also want to
  56. # work if packages are not installed to simplify testing. If you
  57. # add an extractor here also manually add it to the "extract"
  58. # function in babel.messages.extract.
  59. entry_points="""
  60. [console_scripts]
  61. pybabel = babel.messages.frontend:main
  62. [distutils.commands]
  63. compile_catalog = babel.messages.frontend:compile_catalog
  64. extract_messages = babel.messages.frontend:extract_messages
  65. init_catalog = babel.messages.frontend:init_catalog
  66. update_catalog = babel.messages.frontend:update_catalog
  67. [distutils.setup_keywords]
  68. message_extractors = babel.messages.frontend:check_message_extractors
  69. [babel.checkers]
  70. num_plurals = babel.messages.checkers:num_plurals
  71. python_format = babel.messages.checkers:python_format
  72. [babel.extractors]
  73. ignore = babel.messages.extract:extract_nothing
  74. python = babel.messages.extract:extract_python
  75. javascript = babel.messages.extract:extract_javascript
  76. """
  77. )