hosted/pyproject.toml
renovate[bot] c6d619092c
Some checks are pending
mypy / mypy (push) Waiting to run
Pre-commit check / pre-commit (push) Waiting to run
Distribution / setup (push) Waiting to run
Test / Python 3.12 (push) Waiting to run
Test / Python 3.13 (push) Waiting to run
Test / Python 3.14 (push) Waiting to run
chore(deps): update dependency pytest-github-actions-annotate-failures to v0.4.0 (#1371)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-02 22:06:09 +00:00

277 lines
7.3 KiB
TOML

[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=78.0.2",
"translate-toolkit"
]
[dependency-groups]
dev = [
{include-group = "lint"},
{include-group = "test"},
{include-group = "types"}
]
lint = [
{include-group = "pre-commit"}
]
pre-commit = [
"prek==0.3.4"
]
test = [
"coverage==7.13.4",
"pytest-cov==7.0.0",
"pytest-django==4.12.0",
"pytest-github-actions-annotate-failures==0.4.0",
"pytest-profiling==1.8.1",
"pytest-xdist==3.8.0",
"pytest==9.0.2",
"responses==0.26.0"
]
types = [
"celery-types==0.24.0",
"django-stubs-ext==5.2.9",
"django-stubs[compatible-mypy]==5.2.9",
"mypy==1.19.1",
"types-dateparser==1.3.0.20260211",
"types-python-dateutil==2.9.0.20260302",
"types-requests==2.32.4.20260107"
]
[project]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Internationalization",
"Topic :: Software Development :: Localization"
]
dependencies = [
"django-appconf>=1.0",
"django-countries==8.2.0",
"django-vies==6.3.0",
"Django>=5.2,<6.1",
"fakturace==0.7.2",
"mysqlclient>=2.1.1,<3",
"psycopg[binary]",
"python-dateutil",
"requests",
"Weblate>=5.5.3"
]
description = "Hosted Weblate Customization"
keywords = [
"gettext",
"git",
"i18n",
"l10n",
"mercurial",
"translate"
]
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
name = "wlhosted"
requires-python = ">=3.12"
version = "2026.1"
[[project.authors]]
email = "michal@weblate.org"
name = "Michal Čihař"
[project.readme]
content-type = "text/x-rst"
file = "README.rst"
[project.urls]
Documentation = "https://docs.weblate.org/"
Download = "https://github.com/WeblateOrg/hosted"
Homepage = "https://weblate.org/"
"Issue Tracker" = "https://github.com/WeblateOrg/hosted/issues"
"Source Code" = "https://github.com/WeblateOrg/hosted"
Twitter = "https://twitter.com/WeblateOrg"
[tool.check-manifest]
ignore = [
"*.json",
"*.toml",
"*.yaml",
"*.yml",
".editorconfig",
".reuse/dep5",
".weblate",
"json/*",
"LICENSES/*",
"scripts/*"
]
[tool.check-wheel-contents]
ignore = [
"W004" # Django migrations fail here
]
[tool.coverage.paths]
source = [
"."
]
[tool.coverage.report]
exclude_also = [
"@(abc\\.)?abstractmethod",
# Don't complain about missing debug-only code:
"def __repr__",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
"if self\\.debug",
# Type checking
"if TYPE_CHECKING:",
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError"
]
[tool.coverage.run]
branch = true
concurrency = ["multiprocessing", "thread"]
omit = [
".venv*/*"
]
[tool.django-stubs]
django_settings_module = "wlhosted.settings_test"
strict_settings = false
[tool.djlint]
blank_line_after_tag = "load,extends,endblock"
# - reconsider T032 and H014 once formatter is in use
# T003 - Endblock should have name.
# T002 - Double quotes should be used in tags. (makes using tags in attributes hard)
# H013 - Img tag should have an alt attribute.
# H006 - Img tag should have height and width attributes.
# H021 - Inline styles should be avoided.
# H031 - Consider adding meta keywords.
ignore = "T003,H014,T032,T002,H013,H006,H021,H031"
indent = 2
max_attribute_length = 80
max_blank_lines = 2
preserve_blank_lines = true
profile = "django"
[tool.isort]
profile = "black"
[tool.mypy]
check_untyped_defs = true
plugins = [
"mypy_django_plugin.main"
]
[[tool.mypy.overrides]]
disallow_untyped_defs = true
ignore_missing_imports = true
module = [
"appconf.*",
"vies.*"
]
[tool.pytest.ini_options]
addopts = "--reuse-db --cov=wlhosted --cov-report= --durations=20 --durations-min=2 --ignore=data --ignore=data-test --ignore=dev-docker --ignore=scripts"
DJANGO_SETTINGS_MODULE = "wlhosted.settings_test"
FAIL_INVALID_TEMPLATE_VARS = true
python_files = ["test_*.py", "tests.py"]
[tool.ruff]
target-version = "py311"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
extend-safe-fixes = [
"ANN",
"D",
"EM101",
"FA102",
"FLY",
"SIM",
"TCH",
"UP"
]
future-annotations = true
ignore = [
"ANN001", # TODO: Missing type annotation for function argument
"ANN002", # TODO: Missing type annotation for `*args`
"ANN003", # TODO: Missing type annotation for `**kwargs`
"ANN201", # TODO: Missing return type annotation for public function
"ANN202", # TODO: Missing return type annotation for private function
"ANN204", # TODO: Missing return type annotation for special method
"ANN205", # TODO: Missing return type annotation for staticmethod
"ANN206", # TODO: Missing return type annotation for classmethod
"ARG001", # TODO: Unused function argument (mostly for API compatibility)
"ARG002", # TODO: Unused method argument (mostly for API compatibility)
"ARG003", # TODO: Unused class method argument (mostly for API compatibility)
"COM", # CONFIG: No trailing commas
"D10", # TODO: we are missing many docstrings
"D203", # CONFIG: incompatible with D211
"D212", # CONFIG: incompatible with D213
"D401", # TODO: many strings need rephrasing
"DJ001", # TODO: Avoid using `null=True` on string-based fields such as CharField (maybe add noqa)
"E501", # WONTFIX: we accept long strings (rest is formatted by black)
"EM101", # TODO: Exception must not use a string literal, assign to variable first
"EM102", # TODO: Exception must not use an f-string literal, assign to variable first
"FBT", # TODO: Boolean in function definition
"FIX002", # CONFIG: we use TODO
"ISC001", # CONFIG: formatter
"N818", # TODO: exception naming
"PLR2004", # TODO: Magic value used in comparison, consider replacing 201 with a constant variable
"PLW2901", # TODO: overwriting variables inside loop
"PT", # CONFIG: Not using pytest
"PTH", # TODO: Not using pathlib
"RUF012", # TODO: Mutable class attributes should be annotated with `typing.ClassVar`
"SLF001", # TODO: Private member accessed (might need noqa tags)
"T201", # WONTFIX: using print() (maybe add noqa)
"TD002", # CONFIG: no detailed TODO documentation is required
"TD003", # CONFIG: no detailed TODO documentation is required
"TRY003" # WONTFIX: Avoid specifying long messages outside the exception class
]
select = ["ALL"]
[tool.ruff.lint.mccabe]
max-complexity = 16
[tool.ruff.lint.per-file-ignores]
"wlhosted/settings_*.py" = ["F405"]
[tool.setuptools]
include-package-data = true
zip-safe = true
[tool.setuptools.package-dir]
hosted = "hosted"
[tool.setuptools.packages.find]
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.files]
extend-exclude = [
"**.po",
"**.pot"
]