pyproject.toml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. # Guide (user-friendly):
  2. # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
  3. # Specification (technical, formal):
  4. # https://packaging.python.org/en/latest/specifications/pyproject-toml/
  5. # Choosing a build backend:
  6. [build-system]
  7. requires = ["setuptools"] # REQUIRED if [build-system] table is used
  8. build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen.
  9. [project]
  10. name = "sweagent"
  11. dynamic = ["version", "dependencies"]
  12. description = "The official SWE-agent package - an open source Agent Computer Interface for running language models as software engineers."
  13. readme = "README.md"
  14. requires-python = ">=3.9"
  15. license = {file = "LICENSE"}
  16. keywords = ["nlp", "agents", "code"]
  17. authors = [
  18. {name = "Carlos E. Jimenez", email = "carlosej@princeton.edu" },
  19. {name = "John Yang", email = "byjohnyang@gmail.com" }
  20. ]
  21. # Classifiers help users find your project by categorizing it.
  22. classifiers = [
  23. # How mature is this project? Common values are
  24. # 3 - Alpha, 4 - Beta, 5 - Production/Stable
  25. "Operating System :: OS Independent",
  26. # Indicate who your project is intended for
  27. "Intended Audience :: Developers",
  28. # Pick your license as you wish
  29. "License :: OSI Approved :: MIT License",
  30. "Programming Language :: Python :: 3.9",
  31. "Programming Language :: Python :: 3 :: Only",
  32. ]
  33. [project.optional-dependencies]
  34. dev = [
  35. "mkdocs-material",
  36. "mkdocs-glightbox",
  37. "mkdocs-include-markdown-plugin",
  38. "mkdocstrings[python]>=0.18",
  39. "pytest",
  40. "pytest-cov",
  41. "pipx",
  42. "pre-commit",
  43. ]
  44. [tool.setuptools]
  45. include-package-data = true
  46. [tool.setuptools.dynamic]
  47. version = {attr = "sweagent.__version__"}
  48. dependencies = {file = ["requirements.txt"]}
  49. [tool.setuptools.packages.find]
  50. where = ["."]
  51. namespaces = false
  52. [project.urls]
  53. "Homepage" = "https://swe-agent.com"
  54. "Bug Reports" = "http://github.com/princeton-nlp/SWE-agent/issues"
  55. "Documentation" = "https://github.com/princeton-nlp/SWE-agent"
  56. "Source" = "http://github.com/princeton-nlp/SWE-agent"
  57. [tool.pytest.ini_options]
  58. markers = [
  59. "slow: marks tests as slow (deselect with '-m \"not slow\"')",
  60. ]
  61. testpaths = [
  62. "tests"
  63. ]
  64. xfail_strict = true
  65. [tool.ruff]
  66. # Exclude a variety of commonly ignored directories.
  67. exclude = [
  68. ".bzr",
  69. ".direnv",
  70. ".eggs",
  71. ".git",
  72. ".git-rewrite",
  73. ".hg",
  74. ".ipynb_checkpoints",
  75. ".mypy_cache",
  76. ".nox",
  77. ".pants.d",
  78. ".pyenv",
  79. ".pytest_cache",
  80. ".pytype",
  81. ".ruff_cache",
  82. ".svn",
  83. ".tox",
  84. ".venv",
  85. ".vscode",
  86. "__pypackages__",
  87. "_build",
  88. "buck-out",
  89. "build",
  90. "dist",
  91. "node_modules",
  92. "site-packages",
  93. "venv",
  94. "tests/test_data",
  95. ]
  96. line-length = 120
  97. indent-width = 4
  98. target-version = "py39"
  99. [tool.ruff.lint]
  100. # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
  101. # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
  102. # McCabe complexity (`C901`) by default.
  103. # I001: Isort, I002: required import
  104. select = [
  105. # Error (E)
  106. "E",
  107. # Error (PLE)
  108. "PLE",
  109. # pycodestyle
  110. "E713", # not in
  111. "E714", # is not
  112. "E711", # comparison with None
  113. # pyflakes
  114. "F821",
  115. "F822",
  116. "F401", # unused-import
  117. "F841", # unused var
  118. "F541", # f-string without args
  119. "F901", # raise NotImplemented should be raise NotImplementedError
  120. # isort
  121. "I001", # isort
  122. "I002", # required import
  123. # pyupgrade and related
  124. "UP", # pyupgrade
  125. "C401", # flake8-comprehensions: unnecessary-generator-set
  126. "C402", # flake8-comprehensions: unnecessary-generator-dict
  127. "C403", # flake8-comprehensions: unnecessary-list-comprehension-set
  128. "C404", # flake8-comprehensions: unnecessary-list-comprehension-dict
  129. "C405", # flake8-comprehensions: unnecessary-literal-set
  130. "F632", # pyflakes: is-literal
  131. "W605", # pycodestyle: invalid-escape-sequence
  132. # bugbear
  133. "B006", # mutable default
  134. "B007", # unused loop var
  135. "B009", # getattr with constant
  136. # flake8-errmsg
  137. "EM",
  138. # flake8-future-annotations
  139. "FA102",
  140. # flake8-return
  141. "RET",
  142. # RUF
  143. "RUF019", # unneded key in dict check
  144. # pytest
  145. "PT",
  146. # flake8-simplify (SIM)
  147. "SIM201",
  148. ]
  149. ignore = [
  150. # flake8-return
  151. "RET505", # can't autofix
  152. "RET506", # can't autofix
  153. "RET507", # can't autofix
  154. # error (E)
  155. "E501", # line too long
  156. "E402", # import not on top of file
  157. "E722", # bare except
  158. "E741", # ambiguous symbol
  159. # pytest
  160. "PT011",
  161. "PT018",
  162. ]
  163. # Allow fix for all enabled rules (when `--fix`) is provided.
  164. fixable = ["ALL"]
  165. unfixable = []
  166. # Allow unused variables when underscore-prefixed.
  167. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  168. [tool.ruff.format]
  169. # Like Black, use double quotes for strings.
  170. quote-style = "double"
  171. # Like Black, indent with spaces, rather than tabs.
  172. indent-style = "space"
  173. # Like Black, respect magic trailing commas.
  174. skip-magic-trailing-comma = false
  175. # Like Black, automatically detect the appropriate line ending.
  176. line-ending = "auto"
  177. [tool.typos.default.extend-identifiers]
  178. # *sigh* this just isn't worth the cost of fixing
  179. ACI = "ACI"
  180. [tool.typos.default.extend-words]
  181. # Don't correct the surname "Teh"
  182. aci = "aci"
  183. [tool.ruff.lint.isort]
  184. required-imports = ["from __future__ import annotations"]