2023-07-09 11:35:53 +02:00
|
|
|
[build-system]
|
|
|
|
requires = ["hatchling"]
|
|
|
|
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
[project]
|
|
|
|
requires-python = ">=3.8"
|
|
|
|
name = "libretranslate"
|
|
|
|
description = "Free and Open Source Machine Translation API. Self-hosted, no limits, no ties to proprietary services."
|
|
|
|
readme = "README.md"
|
|
|
|
license = { file = "LICENSE" }
|
|
|
|
authors = [
|
|
|
|
{ name = "Piero Toffanin", email = "pt@uav4geo.com" },
|
|
|
|
{ name = "LibreTranslate Authors" },
|
|
|
|
]
|
|
|
|
maintainers = [
|
|
|
|
{ name = "Piero Toffanin", email = "pt@uav4geo.com" },
|
|
|
|
{ name = "LibreTranslate Authors" },
|
|
|
|
]
|
|
|
|
keywords = [
|
|
|
|
"Python",
|
|
|
|
"Translate",
|
|
|
|
"Translation",
|
2023-07-09 12:38:03 +02:00
|
|
|
"API",
|
2023-07-09 11:35:53 +02:00
|
|
|
]
|
|
|
|
classifiers = [
|
|
|
|
"Operating System :: OS Independent",
|
2023-07-09 12:18:58 +02:00
|
|
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
2023-07-09 11:35:53 +02:00
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10"
|
|
|
|
]
|
|
|
|
dynamic = ["version"]
|
|
|
|
|
|
|
|
dependencies = [
|
2024-04-30 23:46:20 +02:00
|
|
|
"argostranslate ==1.9.6",
|
2024-01-08 16:42:21 +02:00
|
|
|
"Flask ==2.2.5",
|
2023-07-09 11:35:53 +02:00
|
|
|
"flask-swagger ==0.2.14",
|
|
|
|
"flask-swagger-ui ==4.11.1",
|
|
|
|
"Flask-Limiter ==2.6.3",
|
|
|
|
"Flask-Babel ==3.1.0",
|
|
|
|
"Flask-Session ==0.4.0",
|
|
|
|
"waitress ==2.1.2",
|
|
|
|
"expiringdict ==1.2.2",
|
2023-10-31 02:39:30 +02:00
|
|
|
"langdetect==1.0.9",
|
2023-10-30 18:52:33 +02:00
|
|
|
"lexilang==1.0.1",
|
2023-07-09 11:35:53 +02:00
|
|
|
"morfessor ==2.0.6",
|
|
|
|
"appdirs ==1.4.4",
|
|
|
|
"APScheduler ==3.9.1",
|
|
|
|
"translatehtml ==1.5.2",
|
2023-08-05 22:56:28 +02:00
|
|
|
"argos-translate-files ==1.1.4",
|
2023-07-09 11:35:53 +02:00
|
|
|
"itsdangerous ==2.1.2",
|
2024-01-08 16:42:21 +02:00
|
|
|
"Werkzeug ==2.3.8",
|
|
|
|
"requests ==2.31.0",
|
|
|
|
"redis ==4.4.4",
|
2024-09-21 18:23:50 +02:00
|
|
|
"numpy<2",
|
2023-07-09 11:35:53 +02:00
|
|
|
"prometheus-client ==0.15.0",
|
|
|
|
"polib ==1.1.1",
|
2023-11-15 20:11:52 +02:00
|
|
|
"packaging ==23.1",
|
|
|
|
"torch ==2.0.1"
|
2023-07-09 11:35:53 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
libretranslate = "libretranslate.main:main"
|
|
|
|
ltmanage = "libretranslate.manage:manage"
|
|
|
|
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
test = [
|
|
|
|
"pytest >=7.2.0",
|
|
|
|
"pytest-cov",
|
2023-07-23 13:24:15 +02:00
|
|
|
"pre-commit >=3.0.0",
|
2023-07-09 11:35:53 +02:00
|
|
|
"types-requests",
|
2024-01-08 16:42:21 +02:00
|
|
|
"pip-audit"
|
2023-07-09 11:35:53 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
Homepage = "https://libretranslate.com"
|
|
|
|
Source = "https://github.com/LibreTranslate/LibreTranslate"
|
|
|
|
Documentation = "https://github.com/LibreTranslate/LibreTranslate"
|
|
|
|
Tracker = "https://github.com/LibreTranslate/LibreTranslate/issues"
|
|
|
|
History = "https://github.com/LibreTranslate/LibreTranslate/releases"
|
|
|
|
|
2024-04-22 19:13:47 +02:00
|
|
|
[tool.hatch.build]
|
|
|
|
artifacts = ["*.mo"]
|
2023-07-09 11:35:53 +02:00
|
|
|
|
|
|
|
# ENVIRONMENTS AND SCRIPTS
|
|
|
|
[tool.hatch.envs.default]
|
|
|
|
features = [
|
|
|
|
"test",
|
|
|
|
]
|
2023-07-23 13:24:15 +02:00
|
|
|
post-install-commands = [
|
|
|
|
"pre-commit install",
|
|
|
|
]
|
2023-07-09 11:35:53 +02:00
|
|
|
|
2023-07-10 08:11:51 +02:00
|
|
|
|
2023-07-09 11:35:53 +02:00
|
|
|
[tool.hatch.envs.default.scripts]
|
|
|
|
dev = "python main.py {args}"
|
2023-07-10 08:11:51 +02:00
|
|
|
locales = "python scripts/compile_locales.py"
|
2023-07-09 11:35:53 +02:00
|
|
|
fmt = [
|
2023-07-23 13:24:15 +02:00
|
|
|
"pre-commit run --all --all-files",
|
2023-07-09 11:35:53 +02:00
|
|
|
]
|
|
|
|
test = [
|
2023-07-09 12:38:03 +02:00
|
|
|
"fmt",
|
2023-07-09 11:35:53 +02:00
|
|
|
"pytest {args}",
|
|
|
|
]
|
|
|
|
cov = [
|
|
|
|
"pytest --cov-report html {args}",
|
|
|
|
"python -c 'import webbrowser; webbrowser.open(\"http://0.0.0.0:3000\")'",
|
|
|
|
"python -m http.server 3000 --directory ./htmlcov",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
[[tool.hatch.envs.all.matrix]]
|
|
|
|
python = ["3.8", "3.9", "3.10", "3.11"]
|
|
|
|
|
|
|
|
|
|
|
|
# TOOLS
|
|
|
|
[tool.hatch.version]
|
|
|
|
path = "VERSION"
|
2023-07-09 12:18:58 +02:00
|
|
|
pattern = "^(?P<version>[0-9]*.[0-9]*.[0-9]*)$"
|
2023-07-09 11:35:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
[tool.pytest.ini_options]
|
|
|
|
addopts = [
|
|
|
|
"-v",
|
|
|
|
"--cov=libretranslate",
|
|
|
|
"--color=yes",
|
|
|
|
"--cov-report=term-missing",
|
|
|
|
]
|
|
|
|
|
|
|
|
ignore = [
|
2023-07-09 11:43:58 +02:00
|
|
|
"E501", # line too long
|
2023-07-09 12:29:11 +02:00
|
|
|
"A003", # Class attribute is shadowing a python builtin
|
2023-07-09 11:43:58 +02:00
|
|
|
"S101", # Use of `assert` detected
|
2023-07-09 12:29:11 +02:00
|
|
|
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
|
2023-07-09 11:43:58 +02:00
|
|
|
"T201", "T203", # remove print and pprint
|
|
|
|
"E402", # Module level import not at top of file
|
2023-07-09 11:35:53 +02:00
|
|
|
]
|