pyproject.toml 5.2 KB

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