Skip to content

Commit 737ab1f

Browse files
committed
feat: add install field from swe-forge dataset, fix default split to train, add openssh-client
1 parent 68bb93f commit 737ab1f

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM debian:bookworm-slim
1313

1414
# Pre-install all common runtimes and tools at build time (as root)
1515
RUN apt-get update && apt-get install -y --no-install-recommends \
16-
ca-certificates git curl wget unzip libssl3 libssl-dev pkg-config sudo \
16+
ca-certificates git curl wget unzip libssl3 libssl-dev pkg-config sudo openssh-client \
1717
python3 python3-pip python3-venv python3-dev \
1818
build-essential gcc g++ make cmake autoconf automake libtool \
1919
default-jdk maven gradle \

src/swe_forge/types.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub struct DatasetEntry {
3030
#[serde(default)]
3131
pub environment_setup_commit: Option<String>,
3232
#[serde(default)]
33+
pub install: Option<String>,
34+
#[serde(default)]
3335
pub language: Option<String>,
3436
#[serde(default)]
3537
pub difficulty: Option<String>,
@@ -59,7 +61,7 @@ pub struct DatasetConfig {
5961
}
6062

6163
fn default_split() -> String {
62-
"test".to_string()
64+
"train".to_string()
6365
}
6466

6567
fn default_limit() -> usize {
@@ -97,7 +99,7 @@ mod tests {
9799
fn test_dataset_config_default() {
98100
let config = DatasetConfig::default();
99101
assert_eq!(config.dataset_id, "CortexLM/swe-forge");
100-
assert_eq!(config.split, "test");
102+
assert_eq!(config.split, "train");
101103
assert_eq!(config.limit, 100);
102104
assert_eq!(config.offset, 0);
103105
}

src/task/registry.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ fn convert_dataset_entry_to_task(entry: &DatasetEntry) -> Result<SweForgeTask> {
147147
.as_deref()
148148
.and_then(|s| serde_json::from_str(s).ok());
149149

150+
let install = entry
151+
.install
152+
.as_ref()
153+
.filter(|s| !s.is_empty())
154+
.map(|s| vec![s.clone()]);
155+
150156
let workspace = WorkspaceConfig {
151157
repo: repo_url,
152158
version: entry.version.clone().unwrap_or_default(),
153159
base_commit: Some(entry.base_commit.clone()),
154-
install: None,
160+
install,
155161
language: Some(language),
156162
fail_to_pass: f2p,
157163
pass_to_pass: p2p,
@@ -237,6 +243,10 @@ mod tests {
237243
assert_eq!(task.workspace.repo, "https://github.com/django/django");
238244
assert_eq!(task.workspace.base_commit.as_deref(), Some("abc123def456"));
239245
assert!(task.swe_forge_fields.is_some());
246+
assert_eq!(
247+
task.workspace.install.as_deref(),
248+
Some(vec!["pip install -e .".to_string()].as_slice())
249+
);
240250

241251
let fields = task.swe_forge_fields.as_ref().unwrap();
242252
assert_eq!(fields.instance_id, "django__django-12345");
@@ -373,6 +383,7 @@ mod tests {
373383
fail_to_pass: Some(r#"["tests/test_orm.py::test_query"]"#.to_string()),
374384
pass_to_pass: None,
375385
environment_setup_commit: None,
386+
install: Some("pip install -e .".to_string()),
376387
language: Some("python".to_string()),
377388
difficulty: Some("medium".to_string()),
378389
difficulty_score: Some(2),

0 commit comments

Comments
 (0)