pyproject.toml 5.5 KB

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