pyproject.toml 5.5 KB

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