Skip to content

Commit 76b86fc

Browse files
committed
self-dependency 버그 수정 + DartLab.exe 리네이밍
uv init → uv venv + uv pip install 방식으로 전환하여 프로젝트명 충돌(dartlab self-dependency) 해결. DartLab-Setup.exe → DartLab.exe 리네이밍.
1 parent ec170c3 commit 76b86fc

6 files changed

Lines changed: 23 additions & 18 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
- name: Rename exe
2121
run: |
22-
copy target\release\dartlab-desktop.exe DartLab-Setup.exe
22+
copy target\release\dartlab-desktop.exe DartLab.exe
2323
2424
- name: Create Release
2525
uses: softprops/action-gh-release@v2
2626
with:
27-
files: DartLab-Setup.exe
27+
files: DartLab.exe
2828
generate_release_notes: true

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Python, uv, Ollama를 모를 필요 없다. exe를 실행하면 전부 자동으
66

77
## 다운로드
88

9-
[GitHub Releases](https://github.com/eddmpython/dartlab-desktop/releases)에서 `DartLab-Setup.exe`를 다운로드.
9+
[GitHub Releases](https://github.com/eddmpython/dartlab-desktop/releases)에서 `DartLab.exe`를 다운로드.
1010

1111
## 사용법
1212

13-
1. `DartLab-Setup.exe` 더블클릭
13+
1. `DartLab.exe` 더블클릭
1414
2. 첫 실행: 환경 자동 설치 (2~5분)
1515
3. 이후 실행: 5초 내 브라우저 오픈
1616

‎src/paths.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ pub fn uv_bin(app_dir: &std::path::Path) -> PathBuf {
1111
}
1212

1313
pub fn venv_dir(app_dir: &std::path::Path) -> PathBuf {
14-
app_dir.join("env")
14+
app_dir.join(".venv")
15+
}
16+
17+
pub fn python_bin(app_dir: &std::path::Path) -> PathBuf {
18+
venv_dir(app_dir).join("Scripts").join("python.exe")
1519
}

‎src/runner.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const PORT: u16 = 8400;
66
const URL: &str = "http://localhost:8400";
77

88
pub fn run_dartlab(app_dir: &Path) -> Result<(), String> {
9-
let uv = paths::uv_bin(app_dir);
9+
let python = paths::python_bin(app_dir);
1010

1111
ui::print_info(&format!("브라우저에서 {URL} 을 엽니다"));
1212
ui::print_info("종료하려면 이 창을 닫으세요");
@@ -17,9 +17,9 @@ pub fn run_dartlab(app_dir: &Path) -> Result<(), String> {
1717
open::that(URL).ok();
1818
});
1919

20-
let status = Command::new(&uv)
20+
let status = Command::new(&python)
2121
.args([
22-
"run",
22+
"-m",
2323
"dartlab",
2424
"ai",
2525
"--port",

‎src/setup.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn ensure_uv(app_dir: &Path) -> Result<(), String> {
2727
download_file(&url, &zip_path)?;
2828
extract_zip(&zip_path, &uv_dir)?;
2929

30-
let nested = uv_dir.join(format!("uv-x86_64-pc-windows-msvc"));
30+
let nested = uv_dir.join("uv-x86_64-pc-windows-msvc");
3131
if nested.exists() {
3232
for entry in std::fs::read_dir(&nested).map_err(|e| e.to_string())? {
3333
let entry = entry.map_err(|e| e.to_string())?;
@@ -57,13 +57,13 @@ pub fn ensure_dartlab(app_dir: &Path) -> Result<(), String> {
5757
ui::print_step(2, 4, "Python 환경 생성 중...");
5858

5959
let status = Command::new(&uv)
60-
.args(["init", "--no-workspace"])
60+
.args(["venv", venv.to_str().unwrap(), "--python", "3.12"])
6161
.current_dir(app_dir)
6262
.status()
6363
.map_err(|e| e.to_string())?;
6464

6565
if !status.success() {
66-
return Err("uv init failed".into());
66+
return Err("uv venv failed".into());
6767
}
6868

6969
ui::print_ok("Python 환경 생성 완료");
@@ -72,13 +72,13 @@ pub fn ensure_dartlab(app_dir: &Path) -> Result<(), String> {
7272
ui::print_step(3, 4, "DartLab 설치/업데이트 중...");
7373

7474
let status = Command::new(&uv)
75-
.args(["add", "dartlab[ai]"])
75+
.args(["pip", "install", "dartlab[ai]", "--python", venv.join("Scripts").join("python.exe").to_str().unwrap()])
7676
.current_dir(app_dir)
7777
.status()
7878
.map_err(|e| e.to_string())?;
7979

8080
if !status.success() {
81-
return Err("uv add dartlab[ai] failed".into());
81+
return Err("uv pip install dartlab[ai] failed".into());
8282
}
8383

8484
ui::print_ok("DartLab 설치 완료");

‎src/updater.rs‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@ pub fn check_update(app_dir: &Path) -> Result<Option<String>, String> {
1717

1818
pub fn do_update(app_dir: &Path) -> Result<(), String> {
1919
let uv = paths::uv_bin(app_dir);
20+
let python = paths::python_bin(app_dir);
2021

2122
let status = Command::new(&uv)
22-
.args(["add", "--upgrade", "dartlab[ai]"])
23+
.args(["pip", "install", "--upgrade", "dartlab[ai]", "--python", python.to_str().unwrap()])
2324
.current_dir(app_dir)
2425
.status()
2526
.map_err(|e| e.to_string())?;
2627

2728
if !status.success() {
28-
return Err("uv add --upgrade failed".into());
29+
return Err("uv pip install --upgrade failed".into());
2930
}
3031

3132
crate::ui::print_ok("업데이트 완료");
3233
Ok(())
3334
}
3435

3536
fn get_local_version(app_dir: &Path) -> Result<String, String> {
36-
let uv = paths::uv_bin(app_dir);
37+
let python = paths::python_bin(app_dir);
3738

38-
let output = Command::new(&uv)
39-
.args(["run", "python", "-c", "import dartlab; print(dartlab.__version__)"])
39+
let output = Command::new(&python)
40+
.args(["-c", "import dartlab; print(dartlab.__version__)"])
4041
.current_dir(app_dir)
4142
.output()
4243
.map_err(|e| e.to_string())?;

0 commit comments

Comments
 (0)