pyproject.toml 5.0 KB

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