[project] name = "toiminnanohjaus" version = "0.1.0" requires-python = ">=3.14" [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "config.settings" python_files = ["test_*.py"] testpaths = ["apps"] addopts = "-p no:cacheprovider --strict-markers" markers = [ "browser: Playwright browser tests (run: pytest tests/browser -m browser)", ] [tool.ruff] line-length = 100 target-version = "py314" extend-exclude = ["*/migrations/*", "node_modules", "static"] [tool.ruff.lint] select = ["E", "F", "W", "I", "UP", "B", "DJ", "SIM", "RUF"] ignore = ["RUF001", "RUF002", "RUF003", "RUF012", "DJ008"] [tool.mypy] python_version = "3.14" plugins = ["mypy_django_plugin.main"] ignore_missing_imports = true exclude = ["migrations/", "tests/"] [[tool.mypy.overrides]] module = ["apps.*.domain.*", "apps.*.application.*"] strict = true [tool.django-stubs] django_settings_module = "config.settings" [tool.importlinter] root_package = "apps" include_external_packages = true [[tool.importlinter.contracts]] name = "Domain and application layers do not depend on Django" type = "forbidden" source_modules = [ "apps.shared.domain", "apps.shared.application", "apps.users.domain", "apps.users.application", ] forbidden_modules = ["django"] allow_indirect_imports = true [[tool.importlinter.contracts]] name = "users layers" type = "layers" layers = [ "apps.users.container", "apps.users.presentation", "apps.users.infrastructure", "apps.users.application", "apps.users.domain", ] ignore_imports = [ # Composition root and presentation may both see the container. "apps.users.presentation.** -> apps.users.container", ] [[tool.importlinter.contracts]] name = "Presentation does not use infrastructure directly" type = "forbidden" source_modules = ["apps.users.presentation"] forbidden_modules = ["apps.users.infrastructure"] allow_indirect_imports = true [[tool.importlinter.contracts]] name = "shared layers" type = "layers" layers = [ "apps.shared.presentation", "apps.shared.infrastructure", "apps.shared.application", "apps.shared.domain", ]