pyproject.toml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. [tool.pytest.ini_options]
  2. DJANGO_SETTINGS_MODULE = "desktop.settings"
  3. console_output_style = "count"
  4. addopts = """
  5. -v \
  6. -m \
  7. 'not integration' \
  8. --strict-markers \
  9. --disable-warnings \
  10. --html=reports/pytest/report.html \
  11. --self-contained-html \
  12. --cov=./ \
  13. --cov-report html:reports/code-cov/coverage-html \
  14. --cov-report xml:reports/code-cov/coverage.xml \
  15. """
  16. norecursedirs = "desktop/core/ext-py3"
  17. python_files = "tests.py test_*.py *_tests.py tests_* *_test.py"
  18. markers = [
  19. "integration: live server based tests",
  20. "requires_hadoop: live hadoop cluster based tests",
  21. ]
  22. [tool.coverage.run]
  23. branch = true
  24. omit = [
  25. "*/ext-py3/*",
  26. "desktop/core/src/desktop/lib/wsgiserver.py",
  27. "*/migrations/*",
  28. "*/org_migrations/*",
  29. "*/old_migrations/*",
  30. "*/gen-py/*",
  31. "desktop/core/src/desktop/app_template/src/app_name/*",
  32. "desktop/core/src/desktop/app_template_proxy/src/app_name/*",
  33. "*conf.py",
  34. "*settings.py",
  35. "*urls.py",
  36. "*metrics.py",
  37. "*tests.py*",
  38. "test_*.py",
  39. "*_tests.py",
  40. "tests_*.py",
  41. "*_test.py",
  42. ]
  43. source = [
  44. "about",
  45. "beeswax",
  46. "filebrowser",
  47. "hbase",
  48. "help",
  49. "hive",
  50. "impala",
  51. "jobbrowser",
  52. "jobsub",
  53. "metastore",
  54. "oozie",
  55. "pig",
  56. "proxy",
  57. "rdbms",
  58. "search",
  59. "security",
  60. "spark",
  61. "sqoop",
  62. "useradmin",
  63. "zookeeper",
  64. "desktop",
  65. "aws",
  66. "azure",
  67. "dashboard",
  68. "hadoop",
  69. "indexer",
  70. "kafka",
  71. "libanalyze",
  72. "liboauth",
  73. "liboozie",
  74. "librdbms",
  75. "libsaml",
  76. "libsentry",
  77. "libsolr",
  78. "libzookeeper",
  79. "metadata",
  80. "notebook",
  81. ]
  82. [tool.coverage.report]
  83. precision = 2
  84. [tool.ruff]
  85. target-version = "py38"
  86. line-length = 140
  87. indent-width = 2
  88. force-exclude = true
  89. extend-exclude = [
  90. "*/ext-py3/*",
  91. "desktop/core/src/desktop/lib/wsgiserver.py",
  92. "*/migrations/*",
  93. "apps/oozie/src/oozie/tests.py",
  94. "tools/ops/",
  95. "tools/ace-editor/",
  96. "*/gen-py/*",
  97. "*/org_migrations/*",
  98. "*/old_migrations/*",
  99. "desktop/core/src/desktop/app_template/src/app_name/*",
  100. "desktop/core/src/desktop/app_template_proxy/src/app_name/*",
  101. ]
  102. [tool.ruff.lint]
  103. preview = true
  104. select = [
  105. "E", # pycodestyle errors
  106. "W", # pycodestyle warnings
  107. "I", # isort
  108. ]
  109. ignore = ["E111", "E114", "E117", "W191", "E731"]
  110. [tool.ruff.lint.per-file-ignores]
  111. "desktop/libs/notebook/src/notebook/connectors/altus.py" = ["E501"]
  112. "desktop/libs/notebook/src/notebook/connectors/altus_adb.py" = ["E501"]
  113. "desktop/libs/metadata/src/metadata/catalog/dummy_client.py" = ["E501"]
  114. "desktop/libs/liboozie/src/liboozie/submission2.py" = ["E501"]
  115. "desktop/libs/libanalyze/src/libanalyze/rules.py" = ["E501"]
  116. "apps/hbase/src/hbase/api.py" = ["E501"]
  117. "desktop/libs/librdbms/src/librdbms/server/mysql_lib.py" = ["E402"]
  118. "desktop/core/src/desktop/urls.py" = ["E402"]
  119. "desktop/core/src/desktop/lib/thrift_util_test.py" = ["E402"]
  120. "desktop/core/src/desktop/auth/backend.py" = ["E402"]
  121. [tool.ruff.format]
  122. docstring-code-format = true
  123. docstring-code-line-length = 140
  124. indent-style = "space"
  125. quote-style = "preserve"
  126. [tool.ruff.lint.isort]
  127. combine-as-imports = true
  128. length-sort-straight = true
  129. known-first-party = [
  130. "about",
  131. "beeswax",
  132. "filebrowser",
  133. "hbase",
  134. "help",
  135. "hive",
  136. "impala",
  137. "jobbrowser",
  138. "jobsub",
  139. "metastore",
  140. "oozie",
  141. "pig",
  142. "proxy",
  143. "rdbms",
  144. "search",
  145. "security",
  146. "spark",
  147. "sqoop",
  148. "useradmin",
  149. "zookeeper",
  150. "desktop",
  151. "aws",
  152. "azure",
  153. "dashboard",
  154. "hadoop",
  155. "indexer",
  156. "kafka",
  157. "libanalyze",
  158. "liboauth",
  159. "liboozie",
  160. "librdbms",
  161. "libsaml",
  162. "libsentry",
  163. "libsolr",
  164. "libzookeeper",
  165. "metadata",
  166. "notebook",
  167. ]