pyproject.toml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. [tool.poetry]
  2. name = "faostat-data-primap"
  3. version = "0.1.0"
  4. description = "Download and process FAOSTAT data"
  5. authors = ["Daniel Busch <daniel.busch@climate-resource.com>"]
  6. readme = "README.md"
  7. packages = [{include = "faostat_data_primap", from = "src"}]
  8. license = "TBD"
  9. include = ["LICENCE"] # poetry uses US English so assumes it will be spelt LICENSE
  10. [tool.poetry.dependencies]
  11. python = "^3.9"
  12. selenium = "^4.26.1"
  13. [tool.poetry.group.tests.dependencies]
  14. pytest = "^7.3.1"
  15. [tool.poetry.group.docs.dependencies]
  16. myst-nb = "^0.17.0"
  17. sphinx-book-theme = "^1.1.0"
  18. sphinx-autodoc-typehints = "^1.23.0"
  19. sphinx-autodocgen = "^1.3"
  20. jupytext = "^1.14.5"
  21. sphinx-copybutton = "^0.5.2"
  22. [tool.poetry.group.dev.dependencies]
  23. pytest-cov = "^4.0.0"
  24. coverage = "^7.2.0"
  25. mypy = "^1.2.0"
  26. ruff = "^0.1.8"
  27. pre-commit = "^3.3.1"
  28. towncrier = "^23.6.0"
  29. liccheck = "^0.9.1"
  30. # Required here so that liccheck will install
  31. # liccheck's installation isn't setup correctly
  32. setuptools = "^70.1.1"
  33. [build-system]
  34. requires = ["poetry-core"]
  35. build-backend = "poetry.core.masonry.api"
  36. [tool.coverage.run]
  37. source = ["src"]
  38. branch = true
  39. [tool.coverage.report]
  40. fail_under = 95
  41. skip_empty = true
  42. show_missing = true
  43. # Regexes for lines to exclude from consideration in addition to the defaults
  44. exclude_also = [
  45. # Don't complain about missing type checking code:
  46. "if TYPE_CHECKING",
  47. ]
  48. [tool.mypy]
  49. strict = true
  50. # prevent unimported libraries silently being treated as Any
  51. disallow_any_unimported = true
  52. # show error codes on failure with context
  53. show_error_codes = true
  54. show_error_context = true
  55. # warn if code can't be reached
  56. warn_unreachable = true
  57. # importing following uses default settings
  58. follow_imports = "normal"
  59. [tool.jupytext]
  60. formats = "ipynb,py:percent"
  61. [tool.pytest.ini_options]
  62. addopts = [
  63. "--import-mode=importlib",
  64. ]
  65. [tool.ruff]
  66. src = ["src"]
  67. target-version = "py39"
  68. select = [
  69. "E", # pycodestyle error
  70. "W", # pycodestyle warning
  71. "F", # pyflakes
  72. "I", # isort
  73. "D", # pydocstyle
  74. "PL", # pylint
  75. "TRY", # tryceratops
  76. "NPY", # numpy rules
  77. "RUF", # ruff specifics
  78. "UP", # pyupgrade
  79. "S", # flake8-bandit
  80. # pandas support via pandas-vet. In some cases we will want to disable
  81. # this because it can lead to too many false positives.
  82. "PD",
  83. ]
  84. unfixable = [
  85. "PD002", # Disable autofix for inplace as this often introduces bugs
  86. ]
  87. ignore = [
  88. "D200", # One-line docstring should fit on one line with quotes
  89. "D400", # First line should end with a period
  90. ]
  91. line-length = 88
  92. [tool.ruff.format]
  93. docstring-code-format = true
  94. [tool.ruff.per-file-ignores]
  95. "test*.py" = [
  96. "D", # Documentation not needed in tests
  97. "S101", # S101 Use of `assert` detected
  98. "PLR2004" # Magic value used in comparison
  99. ]
  100. "docs/source/notebooks/*" = [
  101. "D100", # Missing docstring at the top of file
  102. "E402", # Module level import not at top of file
  103. "S101", # Use of `assert` detected
  104. ]
  105. "scripts/*" = [
  106. "S101" # S101 Use of `assert` detected
  107. ]
  108. [tool.ruff.isort]
  109. known-first-party = ["src"]
  110. [tool.ruff.pydocstyle]
  111. convention = "numpy"
  112. [tool.towncrier]
  113. package = "faostat_data_primap"
  114. package_dir = "src"
  115. filename = "docs/source/changelog.md"
  116. directory = "changelog/"
  117. title_format = "## faostat-data-primap {version} ({project_date})"
  118. underlines = ["", "", ""]
  119. issue_format = "[#{issue}](https://github.com/primap-community/FAOSTAT_data_primap/pulls/{issue})"
  120. [[tool.towncrier.type]]
  121. directory = "breaking"
  122. name = "Breaking Changes"
  123. showcontent = true
  124. [[tool.towncrier.type]]
  125. directory = "deprecation"
  126. name = "Deprecations"
  127. showcontent = true
  128. [[tool.towncrier.type]]
  129. directory = "feature"
  130. name = "Features"
  131. showcontent = true
  132. [[tool.towncrier.type]]
  133. directory = "improvement"
  134. name = "Improvements"
  135. showcontent = true
  136. [[tool.towncrier.type]]
  137. directory = "fix"
  138. name = "Bug Fixes"
  139. showcontent = true
  140. [[tool.towncrier.type]]
  141. directory = "docs"
  142. name = "Improved Documentation"
  143. showcontent = true
  144. [[tool.towncrier.type]]
  145. directory = "trivial"
  146. name = "Trivial/Internal Changes"
  147. showcontent = false
  148. [tool.liccheck]
  149. authorized_licenses = [
  150. "bsd",
  151. "bsd license",
  152. "BSD 3-Clause",
  153. "CC0",
  154. "apache",
  155. "apache 2.0",
  156. "apache software",
  157. "apache software license",
  158. "Apache License, Version 2.0",
  159. "Historical Permission Notice and Disclaimer (HPND)",
  160. "isc license",
  161. "isc license (iscl)",
  162. "gnu lgpl",
  163. "lgpl with exceptions or zpl",
  164. "LGPLv2+",
  165. "GNU Lesser General Public License v2 (LGPLv2)",
  166. "GNU Lesser General Public License v2 or later (LGPLv2+)",
  167. "mit",
  168. "mit license",
  169. "Mozilla Public License 2.0 (MPL 2.0)",
  170. "python software foundation",
  171. "python software foundation license",
  172. "zpl 2.1",
  173. ]
  174. # This starting list is relatively conservative. Depending on the project, it
  175. # may make sense to move some of these into the authorized list
  176. unauthorized_licenses = [
  177. "agpl",
  178. "gnu agpl",
  179. "gpl v3",
  180. "gplv3",
  181. "gpl v2",
  182. "gplv2",
  183. "gpl v1",
  184. "gplv1",
  185. ]