pyproject.toml 4.9 KB

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