pyproject.toml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. [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. ]
  101. line-length = 88
  102. [tool.ruff.format]
  103. docstring-code-format = true
  104. [tool.ruff.per-file-ignores]
  105. "test*.py" = [
  106. "D", # Documentation not needed in tests
  107. "S101", # S101 Use of `assert` detected
  108. "PLR2004" # Magic value used in comparison
  109. ]
  110. "docs/source/notebooks/*" = [
  111. "D100", # Missing docstring at the top of file
  112. "E402", # Module level import not at top of file
  113. "S101", # Use of `assert` detected
  114. ]
  115. "scripts/*" = [
  116. "S101" # S101 Use of `assert` detected
  117. ]
  118. [tool.ruff.isort]
  119. known-first-party = ["src"]
  120. [tool.ruff.pydocstyle]
  121. convention = "numpy"
  122. [tool.towncrier]
  123. package = "faostat_data_primap"
  124. package_dir = "src"
  125. filename = "docs/source/changelog.md"
  126. directory = "changelog/"
  127. title_format = "## faostat-data-primap {version} ({project_date})"
  128. underlines = ["", "", ""]
  129. issue_format = "[#{issue}](https://github.com/primap-community/FAOSTAT_data_primap/pulls/{issue})"
  130. [[tool.towncrier.type]]
  131. directory = "breaking"
  132. name = "Breaking Changes"
  133. showcontent = true
  134. [[tool.towncrier.type]]
  135. directory = "deprecation"
  136. name = "Deprecations"
  137. showcontent = true
  138. [[tool.towncrier.type]]
  139. directory = "feature"
  140. name = "Features"
  141. showcontent = true
  142. [[tool.towncrier.type]]
  143. directory = "improvement"
  144. name = "Improvements"
  145. showcontent = true
  146. [[tool.towncrier.type]]
  147. directory = "fix"
  148. name = "Bug Fixes"
  149. showcontent = true
  150. [[tool.towncrier.type]]
  151. directory = "docs"
  152. name = "Improved Documentation"
  153. showcontent = true
  154. [[tool.towncrier.type]]
  155. directory = "trivial"
  156. name = "Trivial/Internal Changes"
  157. showcontent = false
  158. [tool.liccheck]
  159. authorized_licenses = [
  160. "bsd",
  161. "bsd license",
  162. "BSD 3-Clause",
  163. "CC0",
  164. "apache",
  165. "apache 2.0",
  166. "apache software",
  167. "apache software license",
  168. "Apache License, Version 2.0",
  169. "Historical Permission Notice and Disclaimer (HPND)",
  170. "isc license",
  171. "isc license (iscl)",
  172. "gnu lgpl",
  173. "lgpl with exceptions or zpl",
  174. "LGPLv2+",
  175. "GNU Lesser General Public License v2 (LGPLv2)",
  176. "GNU Lesser General Public License v2 or later (LGPLv2+)",
  177. "mit",
  178. "mit license",
  179. "Mozilla Public License 2.0 (MPL 2.0)",
  180. "python software foundation",
  181. "python software foundation license",
  182. "zpl 2.1",
  183. 'CMU License (MIT-CMU)',
  184. ]
  185. # This starting list is relatively conservative. Depending on the project, it
  186. # may make sense to move some of these into the authorized list
  187. unauthorized_licenses = [
  188. "agpl",
  189. "gnu agpl",
  190. "gpl v3",
  191. "gplv3",
  192. "gpl v2",
  193. "gplv2",
  194. "gpl v1",
  195. "gplv1",
  196. ]
  197. [tool.liccheck.authorized_packages]
  198. numbagg = "0.8.2"