pyproject.toml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. [project]
  2. name = "kmp-proto-manipulator"
  3. version = "0.1.0"
  4. description = "Manipulate Generated .kt files from .proto"
  5. authors = [
  6. {name = "Tim Camise",email = "tcamise@gopro.com"}
  7. ]
  8. readme = "README.md"
  9. requires-python = ">=3.11"
  10. [tool.poetry.scripts]
  11. set-kmp-scopes = "kmp_proto_manipulator.scripts.set_kotlin_proto_scopes:entrypoint"
  12. [tool.poetry.dependencies]
  13. python = "^3.11"
  14. pydantic = "^2"
  15. pyparsing = "^3"
  16. [tool.poetry.group.dev.dependencies]
  17. pydoclint = "^0"
  18. pydocstyle = { extras = ["toml"], version = "^6" }
  19. pytest = "^7"
  20. black = "*"
  21. pylint = "^2"
  22. mypy = "*"
  23. pytest-html = "==4.0.0rc4"
  24. poethepoet = "^0"
  25. isort = "^5"
  26. [build-system]
  27. requires = ["poetry-core>=2.0.0,<3.0.0"]
  28. build-backend = "poetry.core.masonry.api"
  29. [tool.poe.tasks.tests]
  30. cmd = "pytest tests -vv"
  31. help = "Run unit tests"
  32. [tool.poe.tasks._types]
  33. cmd = "mypy kmp_proto_manipulator"
  34. help = "Check types"
  35. # We're only enforcing documentation on public objects
  36. [tool.poe.tasks._pylint]
  37. cmd = "pylint --no-docstring-rgx=_|main|parse_arguments|entrypoint kmp_proto_manipulator"
  38. help = "Run pylint"
  39. [tool.poe.tasks._isort]
  40. cmd = "isort kmp_proto_manipulator tests"
  41. help = "Apply black formatting to source code"
  42. [tool.poe.tasks.lint]
  43. sequence = ["_types", "_isort", "_pylint"]
  44. help = "Lint code"
  45. [tool.poe.tasks.format]
  46. cmd = "black kmp_proto_manipulator tests"
  47. help = "Apply black formatting to source code"
  48. [tool.poe.tasks._pydocstyle]
  49. cmd = "pydocstyle --config pyproject.toml -v kmp_proto_manipulator"
  50. help = "check docstrings style"
  51. [tool.poe.tasks._doclint]
  52. cmd = "pydoclint kmp_proto_manipulator"
  53. help = "validate docstrings"
  54. [tool.poe.tasks.docstrings]
  55. sequence = ["_pydocstyle", "_doclint"]
  56. help = "Analyze docstrings for consistency and errors"
  57. [tool.poe.tasks._clean_artifacts]
  58. cmd = "rm -rf **/__pycache__ *.csv *.mp4 *.jpg *.log .mypy_cache .nox"
  59. help = "Clean testing artifacts and pycache"
  60. [tool.poe.tasks._clean_tests]
  61. cmd = "rm -rf .reports && rm -rf .pytest_cache"
  62. help = "Clean test reports"
  63. [tool.poe.tasks.clean]
  64. sequence = ["_clean_artifacts", "_clean_tests"]
  65. help = "Clean everything"
  66. [tool.poe.tasks.all]
  67. sequence = ["format", "lint", "tests", "docstrings"]
  68. help = "Format, check types, lint, and run unit tests"
  69. [tool.mypy]
  70. ignore_missing_imports = true
  71. warn_redundant_casts = true
  72. disallow_untyped_calls = false
  73. disallow_untyped_defs = true
  74. disallow_incomplete_defs = true
  75. disallow_untyped_decorators = false
  76. warn_unused_ignores = true
  77. warn_unreachable = false
  78. show_error_context = true
  79. pretty = true
  80. [tool.pylint.'MASTER']
  81. load-plugins = "pylint.extensions.docparams"
  82. accept-no-param-doc = "yes"
  83. accept-no-return-doc = "yes"
  84. default-docstring-type = "google"
  85. ignore-paths = "kmp_proto_manipulator/models/schemas/"
  86. [tool.pylint.'MESSAGES CONTROL']
  87. disable = [
  88. "unnecessary-lambda",
  89. "unnecessary-lambda-assignment",
  90. "too-many-ancestors",
  91. "no-name-in-module",
  92. "too-many-nested-blocks",
  93. "unspecified-encoding",
  94. "consider-using-with",
  95. "abstract-method",
  96. "useless-type-doc",
  97. "cyclic-import",
  98. "logging-fstring-interpolation",
  99. "logging-format-interpolation",
  100. "duplicate-code",
  101. "global-statement",
  102. "too-few-public-methods",
  103. "too-many-arguments",
  104. "too-many-instance-attributes",
  105. "too-many-branches",
  106. "too-many-locals",
  107. "too-many-lines",
  108. "too-many-statements",
  109. "fixme",
  110. "protected-access",
  111. "invalid-name",
  112. "useless-param-doc",
  113. ]
  114. [tool.pylint.'FORMAT']
  115. max-line-length = 300 # This is handled by black
  116. [tool.pytest.ini_options]
  117. log_auto_indent = true
  118. log_cli = true
  119. log_cli_level = "ERROR"
  120. log_cli_format = "%(asctime)s %(levelname)s %(message)s"
  121. log_cli_date_format = "%H:%M:%S"
  122. log_file_level = "DEBUG"
  123. log_file_format = "%(threadName)13s: %(name)40s:%(lineno)5d %(asctime)s.%(msecs)03d %(levelname)-8s | %(message)s"
  124. log_file_date_format = "%H:%M:%S"
  125. filterwarnings = "ignore::DeprecationWarning"
  126. addopts = [
  127. "-s",
  128. "--capture=tee-sys",
  129. "--html=.reports/test_report.html",
  130. "--self-contained-html",
  131. ]
  132. [tool.black]
  133. line-length = 120
  134. exclude = ".venv"
  135. [tool.isort]
  136. line_length = 120
  137. [tool.pydocstyle]
  138. convention = "google"
  139. add-ignore = "D415, D107, D105, D402"
  140. [tool.pydoclint]
  141. style = 'google'
  142. require-return-section-when-returning-nothing = false
  143. ignore-underscore-args = true
  144. should-document-private-class-attributes = false
  145. check-class-attributes = false