Skip to content

Commit 7b31fa9

Browse files
Copilothzhangxyz
andauthored
Replace pip with uv in documentation and workflows (#43)
* Initial plan * Replace pip with uv in documentation and workflows Co-authored-by: hzhangxyz <[email protected]> * Optimize uv sync commands for specific workflow needs Co-authored-by: hzhangxyz <[email protected]> * Update README.md. * Update basic.md. * Update installation.md. * Update actions. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hzhangxyz <[email protected]> Co-authored-by: Hao Zhang <[email protected]>
1 parent a22b4ed commit 7b31fa9

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ jobs:
1717
- name: recovery tag information
1818
run: git fetch --tags --force
1919

20-
- uses: actions/setup-python@v6
20+
- uses: astral-sh/setup-uv@v7
2121
with:
2222
python-version: '3.14'
23-
cache: 'pip'
23+
enable-cache: true
2424

2525
- name: install dependencies
26-
run: pip install '.[docs]'
26+
run: uv sync --locked --extra docs
2727

2828
- name: configure git
2929
run: |
3030
git config --global user.name "github-actions[bot]"
3131
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
3232
3333
- name: build docs
34-
run: mike deploy --push --update-aliases --alias-type=redirect ${GITHUB_REF#refs/tags/} latest
34+
run: uv run mike deploy --push --update-aliases --alias-type=redirect ${GITHUB_REF#refs/tags/} latest
3535

3636
- name: set default
37-
run: mike set-default --push latest
37+
run: uv run mike set-default --push latest

.github/workflows/example.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ jobs:
4242
steps:
4343
- uses: actions/checkout@v6
4444

45-
- uses: actions/setup-python@v6
45+
- uses: astral-sh/setup-uv@v7
4646
with:
4747
python-version: ${{ matrix.python-version }}
48-
cache: 'pip'
48+
enable-cache: true
4949

5050
- name: build
51-
run: pip install .
51+
run: uv sync --locked
5252

5353
- name: run
54-
run: python examples/main.py
54+
run: uv run python examples/main.py
5555

5656
javascript:
5757
runs-on: ubuntu-latest

.github/workflows/pytest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v6
2323

24-
- uses: actions/setup-python@v6
24+
- uses: astral-sh/setup-uv@v7
2525
with:
2626
python-version: ${{ matrix.python-version }}
27-
cache: 'pip'
27+
enable-cache: true
2828

2929
- name: dependencies
30-
run: pip install '.[dev]'
30+
run: uv sync --locked --extra dev
3131

3232
- name: pytest
33-
run: pytest --cov=pyds
33+
run: uv run pytest --cov=pyds
3434

3535
wheels:
3636
runs-on: ${{ matrix.os }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ npm install
288288
npm run build
289289

290290
# Build Python package
291-
pip install -e ".[dev]"
291+
uv sync --extra dev
292292

293293
# Build C++ library
294294
cmake -B build

docs/getting-started/installation.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ To install from source with development dependencies:
6363
```bash
6464
git clone https://github.com/USTC-KnowledgeComputingLab/ds.git
6565
cd ds
66-
pip install -e ".[dev]"
66+
uv sync --extra dev
6767
```
6868

6969
## C++
@@ -112,7 +112,7 @@ npm run build
112112
### Python
113113

114114
```bash
115-
pip install -e ".[dev]"
115+
uv sync --extra dev
116116
```
117117

118118
### C++
@@ -135,8 +135,7 @@ npm test
135135
### Python Tests
136136

137137
```bash
138-
pip install pytest
139-
pytest
138+
uv run pytest
140139
```
141140

142141
### C++ Tests

0 commit comments

Comments
 (0)