[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", "apps.customers.domain", "apps.customers.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 = "customers layers" type = "layers" layers = [ "apps.customers.container", "apps.customers.presentation", "apps.customers.infrastructure", "apps.customers.application", "apps.customers.domain", ] ignore_imports = ["apps.customers.presentation.** -> apps.customers.container"] [[tool.importlinter.contracts]] name = "Presentation does not use infrastructure directly" type = "forbidden" source_modules = ["apps.users.presentation", "apps.customers.presentation"] forbidden_modules = ["apps.users.infrastructure", "apps.customers.infrastructure"] allow_indirect_imports = true [[tool.importlinter.contracts]] name = "Modules use each other only through application interfaces" type = "forbidden" source_modules = ["apps.customers"] forbidden_modules = [ "apps.users.infrastructure", "apps.users.container", "apps.users.application", ] ignore_imports = [ # Integration tests may arrange data with another module's models. "apps.customers.tests.** -> apps.users.infrastructure.**", ] [[tool.importlinter.contracts]] name = "users does not depend on customers" type = "forbidden" source_modules = ["apps.users"] forbidden_modules = ["apps.customers"] [[tool.importlinter.contracts]] name = "shared layers" type = "layers" layers = [ "apps.shared.presentation", "apps.shared.infrastructure", "apps.shared.application", "apps.shared.domain", ]