Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

pkg: merge all packaging stuff into pyproject.toml (#256)

Jirka Borovec58c571716949
diff --git a/pyproject.toml b/pyproject.toml
index cb8fccb9..b79b4103 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,77 @@
+# Guide (user-friendly):
+# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
+# Specification (technical, formal):
+# https://packaging.python.org/en/latest/specifications/pyproject-toml/
+
+
+# Choosing a build backend:
[build-system]
-requires = ['setuptools>=42']
-build-backend = 'setuptools.build_meta'
+requires = ["setuptools"] # REQUIRED if [build-system] table is used
+build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen.
+
+
+[project]
+name = "sweagent"
+dynamic = ["version"]
+description = "The official SWE-agent package - an open source Agent Computer Interface for running language models as software engineers."
+readme = "README.md"
+requires-python = ">=3.9"
+license = {file = "LICENSE"}
+keywords = ["nlp", "agents", "code"]
+authors = [
+ {name = "Carlos E. Jimenez", email = "[email protected]" },
+ {name = "John Yang", email = "[email protected]" }
+]
+
+# Classifiers help users find your project by categorizing it.
+classifiers = [
+ # How mature is this project? Common values are
+ # 3 - Alpha, 4 - Beta, 5 - Production/Stable
+ "Operating System :: OS Independent",
+ # Indicate who your project is intended for
+ "Intended Audience :: Developers",
+ # Pick your license as you wish
+ "License :: OSI Approved :: MIT License",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3 :: Only",
+]
+
+dependencies = [
+ "anthropic",
+ "config",
+ "datasets",
+ "docker",
+ "gymnasium",
+ "numpy",
+ "openai>=1.0",
+ "pandas",
+ "rich",
+ "ollama",
+ "ruamel.yaml",
+ "simple-parsing",
+ "swebench>=1.0.1",
+ "tenacity",
+ "together",
+ "unidiff",
+ "rich-argparse"
+]
+
+[tool.setuptools]
+include-package-data = true
+
+[tool.setuptools.dynamic]
+version = {attr = "sweagent.__version__"}
+
+[tool.setuptools.packages.find]
+where = ["."]
+namespaces = false
+
+[project.urls]
+"Homepage" = "https://swe-agent.com"
+"Bug Reports" = "http://github.com/princeton-nlp/SWE-agent/issues"
+"Documentation" = "https://github.com/princeton-nlp/SWE-agent"
+"Source" = "http://github.com/princeton-nlp/SWE-agent"
+
[tool.pytest.ini_options]
markers = [
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index c0e8d0b4..00000000
--- a/setup.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-[metadata]
-version = attr: sweagent.__version__
-license_files = LICENSE
diff --git a/setup.py b/setup.py
deleted file mode 100644
index bb578967..00000000
--- a/setup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-import setuptools
-
-with open('README.md', 'r', encoding='utf-8') as fh:
- long_description = fh.read()
-
-setuptools.setup(
- name='sweagent',
- author='John Yang',
- author_email='[email protected]',
- description='The official SWE-agent package - an open source Agent Computer Interface for running language models as software engineers',
- keywords='nlp, agents, code',
- long_description=long_description,
- long_description_content_type='text/markdown',
- url='https://swe-agent.com',
- project_urls={
- 'Documentation': 'https://github.com/princeton-nlp/SWE-agent',
- 'Bug Reports': 'http://github.com/princeton-nlp/SWE-agent/issues',
- 'Source Code': 'http://github.com/princeton-nlp/SWE-agent',
- 'Website': 'https://sweagent.com',
- },
- packages=setuptools.find_packages(),
- classifiers=[
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3 :: Only',
- 'License :: OSI Approved :: MIT License',
- 'Operating System :: OS Independent',
- ],
- python_requires='>=3.9',
- install_requires=[
- 'anthropic[bedrock]',
- 'config',
- 'datasets',
- 'docker',
- 'gymnasium',
- 'numpy',
- 'openai>=1.0',
- 'pandas',
- 'rich',
- 'ollama',
- 'ruamel.yaml',
- 'simple-parsing',
- 'swebench>=1.0.1',
- 'tenacity',
- 'together',
- 'unidiff',
- 'rich-argparse',
- ],
- include_package_data=True,
-)
diff --git a/tests/test_packaging.py b/tests/test_packaging.py
new file mode 100644
index 00000000..d373fad8
--- /dev/null
+++ b/tests/test_packaging.py
@@ -0,0 +1,5 @@
+from sweagent import __version__
+
+
+def test_version():
+ assert __version__.count(".") == 2
\ No newline at end of file