File size: 1,805 Bytes
772829a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
from collections import defaultdict
from swebench.harness.constants import (
MAP_REPO_TO_REQS_PATHS,
MAP_REPO_TO_TEST_FRAMEWORK,
MAP_VERSION_TO_INSTALL,
)
from swebench.harness.log_parsers import parse_log_pytest, MAP_REPO_TO_PARSER
MAP_VERSION_TO_INSTALL_PLACEHOLDER = {
"0.0": {
"python": "3.9",
"packages": "requirements.txt",
"pip_packages": [
"pytest",
"cython",
"distro",
"pytest-cov",
"pytest-xdist",
"pytest-mock",
"pytest-asyncio",
"pytest-bdd",
"pytest-benchmark",
"pytest-randomly",
"responses",
"mock",
"hypothesis",
"freezegun",
"trustme",
"requests-mock",
"requests",
"tomlkit",
],
"install": "pip install --force-reinstall -e .; pip install -e .[test]; pip install -e .[testing]; pip install -e .[tests]; pip install -e .[dev]",
"pre_install": ["apt install -y make gcc g++ pkg-config"],
}
}
MAP_REPO_TO_REQS_PATHS_PLACEHOLDER = [
"requirements.txt",
"requirements-dev.txt",
"requirements-test.txt",
"requirements_test.txt",
"requirements_dev.txt",
]
TEST_PYTEST_WO_DEPRECATION = (
"pytest --no-header -rA --tb=no -p no:cacheprovider -W ignore::DeprecationWarning"
)
MAP_REPO_TO_REQS_PATHS = defaultdict(
lambda: MAP_REPO_TO_REQS_PATHS_PLACEHOLDER, MAP_REPO_TO_REQS_PATHS
)
MAP_REPO_TO_TEST_FRAMEWORK = defaultdict(
lambda: TEST_PYTEST_WO_DEPRECATION, MAP_REPO_TO_TEST_FRAMEWORK
)
MAP_VERSION_TO_INSTALL = defaultdict(
lambda: MAP_VERSION_TO_INSTALL_PLACEHOLDER, MAP_VERSION_TO_INSTALL
)
MAP_REPO_TO_PARSER = defaultdict(lambda: parse_log_pytest, MAP_REPO_TO_PARSER) |