Skip to content

Commit 1eb06ab

Browse files
committed
chore: update justfile
1 parent 415e2c2 commit 1eb06ab

2 files changed

Lines changed: 239 additions & 227 deletions

File tree

justfile

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ system-info:
1111

1212
# Use powershell for Windows so that 'Git Bash' and 'PyCharm Terminal' get the same result
1313
set windows-powershell := true
14-
VENV_CREATE := "pdm venv create"
14+
VENV_CREATE := "pdm venv create --with uv --with-pip"
1515
UV_PIP := "uv pip"
1616
UV_PIP_I := UV_PIP + " install"
1717
UV_PIP_L := UV_PIP + " list"
@@ -28,38 +28,50 @@ WARN_OS := "echo 'WARNING: This command only support Linux!'"
2828

2929
[unix]
3030
venv *args:
31-
@if test ! -e .venv; then {{ VENV_CREATE }} --with uv {{ args }}; fi
31+
@if test ! -e .venv; then {{ VENV_CREATE }} {{ args }}; fi
3232
[windows]
3333
venv *args:
34-
@if (-Not (Test-Path '.venv')) { {{ VENV_CREATE }} --with-pip {{ args }} }
34+
@if (-Not (Test-Path '.venv')) { {{ VENV_CREATE }} {{ args }} }
3535

3636
venv313:
3737
{{ VENV_CREATE }} 3.13
3838

39-
deps *args: venv
40-
{{ INSTALL_DEPS }} {{args}}
39+
uv_deps *args:
40+
{{ UV_DEPS }} {{args}}
4141
@just install_me
4242
@uv run --no-sync fast pypi --quiet
4343

4444
[unix]
45-
lock *args:
45+
deps *args: venv
46+
@just uv_deps {{args}}
47+
[windows]
48+
deps *args: venv
49+
if (-Not (Test-Path '~/AppData/Roaming/uv/tools/rust-just')) { echo 'Using pdm ...'; {{ PDM_DEPS }} {{ args }} } else { echo 'uv sync...'; just uv_deps {{ args }} }
50+
51+
uv_lock *args:
4652
uv lock {{args}}
4753
@just deps --frozen
54+
55+
[unix]
56+
lock *args:
57+
@just uv_lock {{args}}
4858
[windows]
4959
lock *args:
50-
@{{WARN_OS}}
60+
if (-Not (Test-Path '~/AppData/Roaming/uv/tools/rust-just')) { echo 'Using pdm ...'; pdm lock -G :all {{ args }} } else { echo 'uv lock...'; just uv_lock {{ args }} }
61+
5162

5263
up:
5364
@just lock --upgrade
5465

66+
uv_clear *args:
67+
{{ UV_DEPS }} {{args}}
68+
5569
[unix]
5670
clear *args:
57-
uv sync --all-extras --all-groups {{args}}
71+
@just uv_clear {{args}}
5872
[windows]
5973
clear *args:
60-
@echo "WARNING: It may cost 10 minutes! You can enter Crtl-C to exit."
61-
@if (-Not (Test-Path 'pdm.lock')) { pdm lock -G :all }
62-
pdm sync -G :all --clean {{args}}
74+
@if (-Not (Test-Path 'pdm.lock')) { just uv_clear {{args}} } else { pdm sync -G :all --clean {{args}} }
6375

6476
run *args: venv
6577
.venv/{{BIN_DIR}}/{{args}}

0 commit comments

Comments
 (0)