pyproject.toml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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://princeton-nlp.github.io/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. "ctf: marks EnIGMA tests for using SWE-agent on capture the flag (CTF) challenges",
  61. ]
  62. testpaths = [
  63. "tests"
  64. ]
  65. xfail_strict = true
  66. [tool.ruff]
  67. # Exclude a variety of commonly ignored directories.
  68. exclude = [
  69. ".bzr",
  70. ".direnv",
  71. ".eggs",
  72. ".git",
  73. ".git-rewrite",
  74. ".hg",
  75. ".ipynb_checkpoints",
  76. ".mypy_cache",
  77. ".nox",
  78. ".pants.d",
  79. ".pyenv",
  80. ".pytest_cache",
  81. ".pytype",
  82. ".ruff_cache",
  83. ".svn",
  84. ".tox",
  85. ".venv",
  86. ".vscode",
  87. "__pypackages__",
  88. "_build",
  89. "buck-out",
  90. "build",
  91. "dist",
  92. "node_modules",
  93. "site-packages",
  94. "venv",
  95. # ---- project specific ----
  96. "tests/test_data",
  97. # Exclude commands so they don't get the __future__ imports
  98. "config/commands",
  99. ]
  100. line-length = 120
  101. indent-width = 4
  102. target-version = "py39"
  103. [tool.ruff.lint]
  104. # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
  105. # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
  106. # McCabe complexity (`C901`) by default.
  107. # I001: Isort, I002: required import
  108. select = [
  109. # Error (E)
  110. "E",
  111. # Error (PLE)
  112. "PLE",
  113. # pycodestyle
  114. "E713", # not in
  115. "E714", # is not
  116. "E711", # comparison with None
  117. # pyflakes
  118. "F821",
  119. "F822",
  120. "F401", # unused-import
  121. "F841", # unused var
  122. "F541", # f-string without args
  123. "F901", # raise NotImplemented should be raise NotImplementedError
  124. # isort
  125. "I001", # isort
  126. "I002", # required import
  127. # pyupgrade and related
  128. "UP", # pyupgrade
  129. "C401", # flake8-comprehensions: unnecessary-generator-set
  130. "C402", # flake8-comprehensions: unnecessary-generator-dict
  131. "C403", # flake8-comprehensions: unnecessary-list-comprehension-set
  132. "C404", # flake8-comprehensions: unnecessary-list-comprehension-dict
  133. "C405", # flake8-comprehensions: unnecessary-literal-set
  134. "F632", # pyflakes: is-literal
  135. "W605", # pycodestyle: invalid-escape-sequence
  136. # bugbear
  137. "B006", # mutable default
  138. "B007", # unused loop var
  139. "B009", # getattr with constant
  140. # flake8-errmsg
  141. "EM",
  142. # flake8-future-annotations
  143. "FA102",
  144. # flake8-return
  145. "RET",
  146. # RUF
  147. "RUF019", # unneded key in dict check
  148. # pytest
  149. "PT",
  150. # flake8-simplify (SIM)
  151. "SIM201",
  152. # flake8-use-pathlib
  153. "PTH100",
  154. "PTH110",
  155. "PTH111",
  156. "PTH112",
  157. "PTH113",
  158. "PTH114",
  159. "PTH117",
  160. "PTH118",
  161. "PTH119",
  162. "PTH120",
  163. "PTH121",
  164. "PTH122",
  165. "PTH202",
  166. "PTH203",
  167. "PTH204",
  168. "PTH205",
  169. ]
  170. ignore = [
  171. # flake8-return
  172. "RET505", # can't autofix
  173. "RET506", # can't autofix
  174. "RET507", # can't autofix
  175. # error (E)
  176. "E501", # line too long
  177. "E402", # import not on top of file
  178. "E722", # bare except
  179. "E741", # ambiguous symbol
  180. # pytest
  181. "PT011",
  182. "PT018",
  183. ]
  184. # Allow fix for all enabled rules (when `--fix`) is provided.
  185. fixable = ["ALL"]
  186. unfixable = []
  187. # Allow unused variables when underscore-prefixed.
  188. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
  189. [tool.ruff.format]
  190. # Like Black, use double quotes for strings.
  191. quote-style = "double"
  192. # Like Black, indent with spaces, rather than tabs.
  193. indent-style = "space"
  194. # Like Black, respect magic trailing commas.
  195. skip-magic-trailing-comma = false
  196. # Like Black, automatically detect the appropriate line ending.
  197. line-ending = "auto"
  198. [tool.typos.default.extend-identifiers]
  199. # *sigh* this just isn't worth the cost of fixing
  200. ACI = "ACI"
  201. [tool.typos.default.extend-words]
  202. # Don't correct the surname "Teh"
  203. aci = "aci"
  204. [tool.ruff.lint.isort]
  205. required-imports = ["from __future__ import annotations"]