pyproject.toml 5.1 KB

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