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 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
|
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=78.0.2"
]
[dependency-groups]
dev = [
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
{include-group = "types"}
]
docs = [
# Do not attempt to build doc on older Python
"furo==2025.12.19; python_version >= '3.12'",
"matplotlib==3.10.8; python_version >= '3.12'",
"sphinx-copybutton==0.5.2; python_version >= '3.12'",
"Sphinx==9.1.0; python_version >= '3.12'",
"sphinxext-opengraph==0.13.0; python_version >= '3.12'"
]
lint = [
{include-group = "pre-commit"},
{include-group = "pylint"}
]
pre-commit = [
"pre-commit==4.5.1"
]
pylint = [
"pylint==4.0.4"
]
test = [
"pytest-cov==7.0.0",
"pytest-xdist==3.8.0",
"pytest==9.0.2",
"syrupy==5.0.0"
]
types = [
"setuptools>=61.2",
"ty==0.0.11",
"types-lxml==2026.1.1",
"wcwidth-stubs==0.2.14.0"
]
[project]
authors = [
{email = "translate-devel@lists.sourceforge.net", name = "Translate"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: OS Independent",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python",
"Topic :: Software Development :: Internationalization",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Localization"
]
dependencies = [
"lxml>=5.2.0,<6.1",
"unicode-segmentation-rs>=0.2.0,<0.3"
]
description = "Tools and API for translation and localization engineering."
dynamic = [
"version"
]
keywords = [
"i18n l10n gettext translate"
]
license = "GPL-2.0-or-later"
license-files = ["COPYING"]
name = "translate-toolkit"
requires-python = ">=3.11"
[project.optional-dependencies]
all = [
"translate-toolkit[chardet,fluent,ical,ini,levenshtein,markdown,php,rc,spellcheck,subtitles,tmserver,toml,trados,yaml]"
]
chardet = [
"charset-normalizer>=3.4.0,<4.0"
]
fluent = [
"fluent.syntax>=0.19.0,<0.20"
]
ical = [
"vobject==0.9.9"
]
ini = [
"iniparse==0.5"
]
levenshtein = [
"python-Levenshtein>=0.21.0"
]
markdown = [
"mistletoe>=1.4.0,<1.6.0"
]
php = [
"phply>=1.2.6,<1.3"
]
rc = [
"pyparsing>=3.2.0,<3.4"
]
spellcheck = [
"pyenchant==3.3.0"
]
subtitles = [
"aeidon>=1.14.1,<1.16"
]
tmserver = [
"cheroot==11.1.2"
]
toml = [
"tomlkit>=0.13.0,<0.15.0"
]
trados = [
"BeautifulSoup4>=4.13.0"
]
yaml = [
"ruamel.yaml>=0.18.0,<0.20.0"
]
[project.readme]
content-type = "text/x-rst"
file = "README.rst"
[project.scripts]
android2po = "translate.convert.android2po:main"
build_tmdb = "translate.tools.build_tmdb:main"
csv2po = "translate.convert.csv2po:main"
csv2tbx = "translate.convert.csv2tbx:main"
dtd2po = "translate.convert.dtd2po:main"
flatxml2po = "translate.convert.flatxml2po:main"
html2po = "translate.convert.html2po:main"
ical2po = "translate.convert.ical2po:main"
idml2po = "translate.convert.idml2po:main"
ini2po = "translate.convert.ini2po:main"
json2po = "translate.convert.json2po:main"
junitmsgfmt = "translate.tools.junitmsgfmt:main"
md2po = "translate.convert.md2po:main"
moz2po = "translate.convert.moz2po:main"
mozfunny2prop = "translate.convert.mozfunny2prop:main"
mozlang2po = "translate.convert.mozlang2po:main"
odf2xliff = "translate.convert.odf2xliff:main"
oo2po = "translate.convert.oo2po:main"
oo2xliff = "translate.convert.oo2xliff:main"
php2po = "translate.convert.php2po:main"
phppo2pypo = "translate.tools.phppo2pypo:main"
po2csv = "translate.convert.po2csv:main"
po2dtd = "translate.convert.po2dtd:main"
po2flatxml = "translate.convert.po2flatxml:main"
po2html = "translate.convert.po2html:main"
po2ical = "translate.convert.po2ical:main"
po2idml = "translate.convert.po2idml:main"
po2ini = "translate.convert.po2ini:main"
po2json = "translate.convert.po2json:main"
po2md = "translate.convert.po2md:main"
po2moz = "translate.convert.po2moz:main"
po2mozlang = "translate.convert.po2mozlang:main"
po2odf = "translate.convert.po2odf:main"
po2oo = "translate.convert.po2oo:main"
po2php = "translate.convert.po2php:main"
po2prop = "translate.convert.po2prop:main"
po2rc = "translate.convert.po2rc:main"
po2resx = "translate.convert.po2resx:main"
po2sub = "translate.convert.po2sub:main"
po2symb = "translate.convert.po2symb:main"
po2tiki = "translate.convert.po2tiki:main"
po2tmx = "translate.convert.po2tmx:main"
po2toml = "translate.convert.po2toml:main"
po2ts = "translate.convert.po2ts:main"
po2txt = "translate.convert.po2txt:main"
po2web2py = "translate.convert.po2web2py:main"
po2wordfast = "translate.convert.po2wordfast:main"
po2xliff = "translate.convert.po2xliff:main"
po2yaml = "translate.convert.po2yaml:main"
poclean = "translate.tools.poclean:main"
pocompile = "translate.tools.pocompile:main"
poconflicts = "translate.tools.poconflicts:main"
pocount = "translate.tools.pocount:main"
podebug = "translate.tools.podebug:main"
pofilter = "translate.filters.pofilter:main"
pogrep = "translate.tools.pogrep:main"
pomerge = "translate.tools.pomerge:main"
porestructure = "translate.tools.porestructure:main"
posegment = "translate.tools.posegment:main"
poswap = "translate.tools.poswap:main"
pot2po = "translate.convert.pot2po:main"
poterminology = "translate.tools.poterminology:main"
pretranslate = "translate.tools.pretranslate:main"
prop2mozfunny = "translate.convert.prop2mozfunny:main"
prop2po = "translate.convert.prop2po:main"
pydiff = "translate.tools.pydiff:main"
pypo2phppo = "translate.tools.pypo2phppo:main"
rc2po = "translate.convert.rc2po:main"
resx2po = "translate.convert.resx2po:main"
sub2po = "translate.convert.sub2po:main"
symb2po = "translate.convert.symb2po:main"
tbx2po = "translate.convert.tbx2po:main"
tiki2po = "translate.convert.tiki2po:main"
tmserver = "translate.services.tmserver:main"
toml2po = "translate.convert.toml2po:main"
ts2po = "translate.convert.ts2po:main"
txt2po = "translate.convert.txt2po:main"
web2py2po = "translate.convert.web2py2po:main"
xliff2odf = "translate.convert.xliff2odf:main"
xliff2oo = "translate.convert.xliff2oo:main"
xliff2po = "translate.convert.xliff2po:main"
yaml2po = "translate.convert.yaml2po:main"
[project.urls]
Documentation = "https://docs.translatehouse.org/projects/translate-toolkit/"
Download = "https://github.com/translate/translate/releases/"
Homepage = "https://toolkit.translatehouse.org/"
"Issue Tracker" = "https://github.com/translate/translate/issues"
"Source Code" = "https://github.com/translate/translate"
[tool.check-manifest]
ignore = [
"*.toml",
"*.yaml",
"*.yml",
".well-known/funding-manifest-urls",
"CREDITS",
"docs/*",
"docs/*/*",
"docs/*/*/*",
"docs/*/*/*/*",
"Makefile",
"tests/*",
"tests/*/*",
"tests/*/*/*",
"tests/*/*/*/*",
"tests/*/*/*/*/*",
"tools/phase", # TODO: investigate purpuse, it was never installed
"tools/phaselist2goals", # TODO: investigate purpuse, it was never installed
"translate/convert/odfxml", # TODO: investigate purpuse, it was never installed
"translate/convert/roundtrip-gaia", # TODO: investigate purpuse, it was never installed
"translate/convert/roundtrip-mozilla", # TODO: investigate purpuse, it was never installed
"translate/convert/roundtrip-OOo", # TODO: investigate purpuse, it was never installed
"translate/storage/debug.properties" # TODO: this should be converted to tests
]
[tool.coverage.run]
# C Tracer not available in quemu testing
disable_warnings = ["no-ctracer"]
[tool.isort]
known_third_party = [
"bs4",
"cheroot",
"iniparse",
"lxml",
"phply",
"pyparsing",
"pytest",
"ruamel",
"setuptools",
"sphinx",
"vobject"
]
profile = "black"
[tool.pylint.main]
disable = [
"abstract-method", # TODO
"arguments-differ", # TODO
"arguments-renamed", # TODO
"attribute-defined-outside-init", # TODO
"bidirectional-unicode", # TODO
"broad-exception-caught", # TODO
"c-extension-no-member", # TODO
"consider-using-f-string", # TODO
"consider-using-with", # TODO
"cyclic-import",
"dangerous-default-value", # TODO
"disallowed-name", # TODO
"duplicate-code", # TODO
"fixme",
"global-statement", # TODO
"invalid-name", # TODO
"invalid-overridden-method", # TODO
"keyword-arg-before-vararg", # TODO
"line-too-long",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-member", # TODO
"no-name-in-module", # TODO
"no-value-for-parameter", # TODO
"not-an-iterable", # TODO
"not-callable", # TODO
"protected-access", # TODO
"redefined-builtin", # TODO
"redefined-outer-name", # TODO
"signature-differs", # TODO
"super-init-not-called", # TODO
"too-few-public-methods",
"too-many-arguments",
"too-many-boolean-expressions", # TODO
"too-many-branches",
"too-many-function-args",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
"too-many-nested-blocks",
"too-many-positional-arguments",
"too-many-public-methods",
"too-many-return-statements",
"too-many-statements",
"unidiomatic-typecheck", # TODO
"unspecified-encoding", # TODO
"unsubscriptable-object", # TODO
"unsupported-assignment-operation", # TODO
"unused-argument",
"use-implicit-booleaness-not-comparison", # TODO
"use-implicit-booleaness-not-len", # TODO
"used-before-assignment" # TODO
]
[tool.pytest.ini_options]
filterwarnings = [
# Treat all unfiltered warnings as errors
"error",
# translate-toolkit warning for accesskeys
"ignore:Could not find accesskey:UserWarning:translate.convert",
# warning in a third-party library
"ignore:The 'u' type code is deprecated:DeprecationWarning:enchant.checker",
# TODO: these might be worth investigating
'default:unclosed:ResourceWarning'
]
norecursedirs = ".git build docs"
[tool.ruff.lint]
extend-safe-fixes = [
"FURB113",
"PLC2801",
"TCH003"
]
# CONFIG - intentional configuration
# TODO - needs decision whether intention, add noqa tags or fix
# WONTFIX - not fixable in current codebase, might be better to go for noqa
ignore = [
"A001", # TODO: Variable is shadowing a Python builtin
"A002", # TODO: overriding builtins (might need noqa tags)
"ANN", # TODO: type annotations missing
"ARG001", # TODO: Unused function argument (mostly for API compatibility)
"ARG002", # TODO: Unused method argument (mostly for API compatibility)
"ARG004", # TODO: Unused static method argument
"ARG005", # TODO: Unused lambda argument:
"B006", # TODO: Do not use mutable data structures for argument defaults
"B020", # TODO: Loop control variable `node` overrides iterable it iterates
"B028", # TODO: No explicit `stacklevel` keyword argument found
"BLE001", # WONTFIX: Do not catch blind exception: `Exception`, third-party modules do not have defined exceptions
"C901", # TODO: too complex
"COM", # CONFIG: No trailing commas
"CPY001", # TODO: Missing copyright notice at top of file
"D1", # TODO: Missing docstring
"D203", # CONFIG: incompatible with D211
"D205", # TODO: 1 blank line required between summary line and description
"D206", # CONFIG: formatter
"D212", # CONFIG: incompatible with D213
"D401", # TODO: First line of docstring should be in imperative mood
"D404", # TODO: First word of the docstring should not be "This"
"D409", # TODO: Section underline should match the length of its name
"DOC", # TODO: is not documented in docstring
"E262", # TODO: Inline comment should start with `# `
"E265", # TODO: Block comment should start with `# `
"E266", # TODO: Too many leading `#` before block comment
"E501", # WONTFIX: we accept long strings (rest is formatted by black)
"EM", # TODO: Exception strings
"ERA001", # TODO: Found commented-out code
"FBT", # TODO: Boolean in function definition
"FIX001", # TODO: Line contains FIXME, consider resolving the issue
"FIX002", # CONFIG: we use TODO
"FIX003", # TODO: Line contains XXX, consider resolving the issue
"FIX004", # TODO: Line contains HACK, consider resolving the issue
"FURB101", # TODO: `open` and `read` should be replaced by `Path(file_).read_bytes()`
"FURB103", # TODO: `open` and `write` should be replaced by `Path(outputfile.name).write_bytes(outputmo)`
"FURB189", # TODO: Subclassing `dict` can be error prone, use `collections.UserDict` instead
"INP001", # TODO: File is part of an implicit namespace package. Add an `__init__.py`.
"N801", # TODO: Class name should use CapWords convention
"N802", # TODO: Function name `FAIL` should be lowercase
"N803", # TODO: Argument name `attributeValue` should be lowercase
"N806", # TODO: Variable `sourcelanguageNode` in function should be lowercase
"N813", # TODO: Camelcase `StateEnum` imported as lowercase `state`
"N815", # TODO: Variable `bodyNode` in class scope should not be mixedCase
"N816", # TODO: Variable `theDOMImplementation` in global scope should not be mixedCase
"N818", # TODO: Exception name `FilterFailure` should be named with an Error suffix
"PLE2502", # TODO: Contains control characters that can permit obfuscated code
"PLR0904", # TODO: Too many public methods (21 > 20)
"PLR0911", # TODO: Too many return statements
"PLR0912", # TODO: Too many branches
"PLR0913", # TODO: Too many arguments in function definition
"PLR0914", # TODO: Too many local variables (16/15)
"PLR0915", # TODO: Too many statements
"PLR0916", # TODO: Too many Boolean expressions (6 > 5)
"PLR0917", # TODO: Too many positional arguments (7/5)
"PLR1702", # TODO: Too many nested blocks (8 > 5)
"PLR2004", # TODO: Magic value used in comparison, consider replacing with a constant variable
"PLR6301", # TODO: Method `entry` could be a function, class method, or static method
"PLW1514", # TODO: `open` in text mode without explicit `encoding` argument
"PLW1641", # TODO: Object does not implement `__hash__` method
"PLW2901", # TODO: `for` loop variable `input_unit` overwritten by assignment target
"PT009", # TODO: Use a regular `assert` instead of unittest-style `assertCountEqual`
"PT011", # TODO: `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception
"PT013", # TODO: Found incorrect import of pytest, use simple `import pytest` instead
"PTH", # TODO: Not using pathlib for now
"RUF001", # WONTFIX: String contains ambiguous unicode character, we are using Unicode
"RUF002", # WONTFIX: Docstring contains ambiguous
"RUF003", # WONTFIX: Comment contains ambiguous
"RUF012", # TODO: Mutable class attributes should be annotated with `typing.ClassVar`
"S101", # CONFIG: Use of `assert` detected
"S404", # TODO: `subprocess` module is possibly insecure
"S407", # TODO: `xml.dom.expatbuilder` is vulnerable to XML attacks
"S408", # TODO: `xml.dom.minidom` is vulnerable to XML attacks
"S603", # CONFIG: `subprocess` call: check for execution of untrusted input
"S607", # CONFIG: executing system installed tools
"SIM115", # TODO: Use context handler for opening files
"SLF001", # TODO: Private member accessed
"SLOT000", # TODO: Subclasses of `str` should define `__slots__`
"TD001", # TODO: Invalid TODO tag: `FIXME`
"TD002", # CONFIG: no detailed TODO documentation is required
"TD003", # CONFIG: no detailed TODO documentation is required
"TD004", # TODO: Missing colon in TODO
"TD005", # TODO: Missing issue description after `TODO`
"TD007", # TODO: Missing space after colon in TODO
"TID252", # TODO: Relative imports from parent modules are banned
"TRY003", # WONTFIX: Avoid specifying long messages outside the exception class
'ISC001', # CONFIG: formatter
'Q000', # CONFIG: formatter
'Q001', # CONFIG: formatter
'Q002', # CONFIG: formatter
'Q003', # CONFIG: formatter
'W191' # CONFIG: formatter
]
preview = true
select = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"tests/**.py" = ["PLC1901", "T201"]
"translate/misc/progressbar.py" = ["T201"]
"translate/storage/benchmark.py" = ["T201"]
"translate/storage/placeables/strelem.py" = ["T201"]
"translate/tools/**.py" = ["T201"]
[tool.setuptools]
include-package-data = true
platforms = [
"any"
]
script-files = [
"tools/pocommentclean",
"tools/pocompendium",
"tools/pomigrate2",
"tools/popuretext",
"tools/poreencode",
"tools/posplit"
]
zip-safe = false
[tool.setuptools.dynamic.version]
attr = "translate.__version__.sver"
[tool.setuptools.packages.find]
include = [
"translate*"
]
namespaces = true
[tool.tomlsort]
ignore_case = true
sort_inline_arrays = true
sort_inline_tables = true
sort_table_keys = true
spaces_before_inline_comment = 2
[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*# codespell:ignore.*$",
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"
]
[tool.typos.default.extend-identifiers]
plasTeX = "plasTeX"
[tool.typos.default.extend-words]
# Belarusian/Polish translations in test files
dni = "dni"
"dźeń" = "dźeń"
"dźon" = "dźon"
elementy = "elementy"
# Open Document Format acronym
ODF = "ODF"
tamu = "tamu"
Uniforum = "Uniforum"
# Author name
Wil = "Wil"
[tool.typos.files]
extend-exclude = [
"docs/commands/poterminology_stopword_file.rst",
"tests/odf_xliff/test_inline-test_odf2xliff_inline-reference.xlf",
"tests/translate/filters/test_checks.py",
"tests/translate/lang/test_*.py",
"tests/translate/lang/test_identify.py",
"tests/translate/tools/data/pocount_syntax_errors/",
"tests/xliff_conformance/af-pootle.po",
"tests/xliff_conformance/en-US.sdf",
"translate/lang/data.py",
"translate/lang/st.py",
"translate/share/langmodels/*.lm",
"translate/share/stoplist-en"
]
|