pyproject.toml 5.6 KB

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