setup.py 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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',
  37. 'Programming Language :: Python :: 2.7',
  38. 'Programming Language :: Python :: 3',
  39. 'Programming Language :: Python :: 3.4',
  40. 'Programming Language :: Python :: 3.5',
  41. 'Programming Language :: Python :: 3.6',
  42. 'Programming Language :: Python :: 3.7',
  43. 'Programming Language :: Python :: Implementation :: CPython',
  44. 'Programming Language :: Python :: Implementation :: PyPy',
  45. 'Topic :: Software Development :: Libraries :: Python Modules',
  46. ],
  47. python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
  48. packages=['babel', 'babel.messages', 'babel.localtime'],
  49. include_package_data=True,
  50. install_requires=[
  51. # This version identifier is currently necessary as
  52. # pytz otherwise does not install on pip 1.4 or
  53. # higher.
  54. 'pytz>=2015.7',
  55. ],
  56. cmdclass={'import_cldr': import_cldr},
  57. zip_safe=False,
  58. # Note when adding extractors: builtin extractors we also want to
  59. # work if packages are not installed to simplify testing. If you
  60. # add an extractor here also manually add it to the "extract"
  61. # function in babel.messages.extract.
  62. entry_points="""
  63. [console_scripts]
  64. pybabel = babel.messages.frontend:main
  65. [distutils.commands]
  66. compile_catalog = babel.messages.frontend:compile_catalog
  67. extract_messages = babel.messages.frontend:extract_messages
  68. init_catalog = babel.messages.frontend:init_catalog
  69. update_catalog = babel.messages.frontend:update_catalog
  70. [distutils.setup_keywords]
  71. message_extractors = babel.messages.frontend:check_message_extractors
  72. [babel.checkers]
  73. num_plurals = babel.messages.checkers:num_plurals
  74. python_format = babel.messages.checkers:python_format
  75. [babel.extractors]
  76. ignore = babel.messages.extract:extract_nothing
  77. python = babel.messages.extract:extract_python
  78. javascript = babel.messages.extract:extract_javascript
  79. """
  80. )