| 1 |
import subprocess |
| 2 |
import sys |
| 3 |
|
| 4 |
from setuptools import Command, setup |
| 5 |
|
| 6 |
try: |
| 7 |
from babel import __version__ |
| 8 |
except SyntaxError as exc: |
| 9 |
sys.stderr.write(f"Unable to import Babel ({exc}). Are you running a supported version of Python?\n") |
| 10 |
sys.exit(1) |
| 11 |
|
| 12 |
|
| 13 |
class import_cldr(Command): |
| 14 |
description = 'imports and converts the CLDR data' |
| 15 |
user_options = [] |
| 16 |
|
| 17 |
def initialize_options(self): |
| 18 |
pass |
| 19 |
|
| 20 |
def finalize_options(self): |
| 21 |
pass |
| 22 |
|
| 23 |
def run(self): |
| 24 |
subprocess.check_call([sys.executable, 'scripts/download_import_cldr.py']) |
| 25 |
|
| 26 |
|
| 27 |
setup( |
| 28 |
name='babel', |
| 29 |
version=__version__, |
| 30 |
description='Internationalization utilities', |
| 31 |
long_description='A collection of tools for internationalizing Python applications.', |
| 32 |
author='Armin Ronacher', |
| 33 |
author_email='[email protected]', |
| 34 |
maintainer='Aarni Koskela', |
| 35 |
maintainer_email='[email protected]', |
| 36 |
license='BSD-3-Clause', |
| 37 |
url='https://babel.pocoo.org/', |
| 38 |
project_urls={ |
| 39 |
'Source': 'https://github.com/python-babel/babel', |
| 40 |
}, |
| 41 |
classifiers=[ |
| 42 |
'Development Status :: 5 - Production/Stable', |
| 43 |
'Environment :: Web Environment', |
| 44 |
'Intended Audience :: Developers', |
| 45 |
'License :: OSI Approved :: BSD License', |
| 46 |
'Operating System :: OS Independent', |
| 47 |
'Programming Language :: Python', |
| 48 |
'Programming Language :: Python :: 3', |
| 49 |
'Programming Language :: Python :: 3 :: Only', |
| 50 |
'Programming Language :: Python :: 3.8', |
| 51 |
'Programming Language :: Python :: 3.9', |
| 52 |
'Programming Language :: Python :: 3.10', |
| 53 |
'Programming Language :: Python :: 3.11', |
| 54 |
'Programming Language :: Python :: 3.12', |
| 55 |
'Programming Language :: Python :: 3.13', |
| 56 |
'Programming Language :: Python :: 3.14', |
| 57 |
'Programming Language :: Python :: 3.15', |
| 58 |
'Programming Language :: Python :: Implementation :: CPython', |
| 59 |
'Programming Language :: Python :: Implementation :: PyPy', |
| 60 |
'Topic :: Software Development :: Internationalization', |
| 61 |
'Topic :: Software Development :: Libraries :: Python Modules', |
| 62 |
], |
| 63 |
python_requires='>=3.8', |
| 64 |
packages=['babel', 'babel.messages', 'babel.localtime'], |
| 65 |
package_data={"babel": ["py.typed"]}, |
| 66 |
include_package_data=True, |
| 67 |
install_requires=[ |
| 68 |
# This version identifier is currently necessary as |
| 69 |
# pytz otherwise does not install on pip 1.4 or |
| 70 |
# higher. |
| 71 |
# Python 3.9 and later include zoneinfo which replaces pytz |
| 72 |
'pytz>=2015.7; python_version<"3.9"', |
| 73 |
], |
| 74 |
extras_require={ |
| 75 |
'dev': [ |
| 76 |
"tzdata;sys_platform == 'win32'", |
| 77 |
'backports.zoneinfo; python_version<"3.9"', |
| 78 |
'freezegun~=1.0', |
| 79 |
'jinja2>=3.0', |
| 80 |
'pytest-cov', |
| 81 |
'pytest>=6.0', |
| 82 |
'pytz', |
| 83 |
'setuptools', |
| 84 |
], |
| 85 |
}, |
| 86 |
cmdclass={'import_cldr': import_cldr}, |
| 87 |
zip_safe=False, |
| 88 |
# Note when adding extractors: builtin extractors we also want to |
| 89 |
# work if packages are not installed to simplify testing. If you |
| 90 |
# add an extractor here also manually add it to the "extract" |
| 91 |
# function in babel.messages.extract. |
| 92 |
entry_points=""" |
| 93 |
[console_scripts] |
| 94 |
pybabel = babel.messages.frontend:main |
| 95 |
|
| 96 |
[distutils.commands] |
| 97 |
compile_catalog = babel.messages.setuptools_frontend:compile_catalog |
| 98 |
extract_messages = babel.messages.setuptools_frontend:extract_messages |
| 99 |
init_catalog = babel.messages.setuptools_frontend:init_catalog |
| 100 |
update_catalog = babel.messages.setuptools_frontend:update_catalog |
| 101 |
|
| 102 |
[distutils.setup_keywords] |
| 103 |
message_extractors = babel.messages.setuptools_frontend:check_message_extractors |
| 104 |
|
| 105 |
[babel.checkers] |
| 106 |
num_plurals = babel.messages.checkers:num_plurals |
| 107 |
python_format = babel.messages.checkers:python_format |
| 108 |
|
| 109 |
[babel.extractors] |
| 110 |
ignore = babel.messages.extract:extract_nothing |
| 111 |
python = babel.messages.extract:extract_python |
| 112 |
javascript = babel.messages.extract:extract_javascript |
| 113 |
""", |
| 114 |
) |