pyproject.toml 5.6 KB

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