forked from LibreTranslate/LibreTranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
140 lines (122 loc) · 3.31 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
[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 = "[email protected]" },
{ name = "LibreTranslate Authors" },
]
maintainers = [
{ name = "Piero Toffanin", email = "[email protected]" },
{ name = "LibreTranslate Authors" },
]
keywords = [
"Python",
"Translate",
"Translation",
"API",
]
classifiers = [
"Operating System :: OS Independent",
"License :: OSI Approved :: GNU Affero General Public License v3",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
]
dynamic = ["version"]
dependencies = [
"argostranslate ==1.9.6",
"Flask ==2.2.5",
"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",
"langdetect==1.0.9",
"lexilang==1.0.1",
"morfessor ==2.0.6",
"appdirs ==1.4.4",
"APScheduler ==3.9.1",
"translatehtml ==1.5.2",
"argos-translate-files ==1.1.4",
"itsdangerous ==2.1.2",
"Werkzeug ==2.3.8",
"requests ==2.31.0",
"redis ==4.4.4",
"numpy <2",
"prometheus-client ==0.15.0",
"polib ==1.1.1",
"packaging ==23.1",
"torch ==2.0.1"
]
[project.scripts]
libretranslate = "libretranslate.main:main"
ltmanage = "libretranslate.manage:manage"
[project.optional-dependencies]
test = [
"pytest >=7.2.0",
"pytest-cov",
"pre-commit >=3.0.0",
"types-requests",
"pip-audit"
]
[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"
[tool.hatch.build]
artifacts = ["*.mo"]
# ENVIRONMENTS AND SCRIPTS
[tool.hatch.envs.default]
features = [
"test",
]
post-install-commands = [
"pre-commit install",
]
[tool.hatch.envs.default.scripts]
dev = "python main.py {args}"
locales = "python scripts/compile_locales.py"
fmt = [
"pre-commit run --all --all-files",
]
test = [
"fmt",
"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"
pattern = "^(?P<version>[0-9]*.[0-9]*.[0-9]*)$"
[tool.pytest.ini_options]
addopts = [
"-v",
"--cov=libretranslate",
"--color=yes",
"--cov-report=term-missing",
]
ignore = [
"E501", # line too long
"A003", # Class attribute is shadowing a python builtin
"S101", # Use of `assert` detected
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
"T201", "T203", # remove print and pprint
"E402", # Module level import not at top of file
]