pyproject.toml 5.1 KB

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