pyproject.toml 5.6 KB

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