pyproject.toml 3.8 KB

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