pyproject.toml 5.6 KB

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