Skip to content

Commit 2550801

Browse files
Use uv in CI (#21)
* Use uv in CI * Update README.md * Use - uses: actions-rust-lang/setup-rust-toolchain@v1 * Update README.md * Skip 3.7 * Skip 3.8 and add 3.13 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8781835 commit 2550801

File tree

3 files changed

+29
-33
lines changed

3 files changed

+29
-33
lines changed

.github/workflows/markdown-code-runner.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,26 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: '3.x'
22+
python-version: "3.x"
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
2326

2427
- name: Install markdown-code-runner
2528
run: |
26-
python -m pip install --upgrade pip
27-
pip install .
29+
uv venv
30+
uv pip install .
2831
2932
# Install dependencies you're using in your README.md
3033
- name: Install other Python dependencies
3134
run: |
32-
pip install pandas tabulate pytest matplotlib requests
35+
uv pip install pandas tabulate pytest matplotlib requests
3336
3437
# Rust is only needed for an example in our README.md
35-
- name: Set up Rust
36-
uses: actions-rs/toolchain@v1
37-
with:
38-
toolchain: stable
39-
profile: minimal
38+
- uses: actions-rust-lang/setup-rust-toolchain@v1
4039

4140
- name: Run update-readme.py
42-
run: markdown-code-runner --verbose README.md
41+
run: uv run markdown-code-runner --verbose README.md
4342

4443
- name: Commit updated README.md
4544
id: commit

.github/workflows/pytest.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ jobs:
88

99
strategy:
1010
matrix:
11-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
11+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1212

1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Set up Python ${{ matrix.python-version }}
1616
uses: actions/setup-python@v5
1717
with:
1818
python-version: ${{ matrix.python-version }}
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
1921
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install -e ".[test]"
23-
pip install pytest
22+
run: uv sync --all-extras
2423
- name: Run pytest
25-
run: pytest
24+
run: uv run pytest

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -266,27 +266,26 @@ jobs:
266266
- name: Set up Python
267267
uses: actions/setup-python@v5
268268
with:
269-
python-version: '3.x'
269+
python-version: "3.x"
270+
271+
- name: Install uv
272+
uses: astral-sh/setup-uv@v5
270273
271274
- name: Install markdown-code-runner
272275
run: |
273-
python -m pip install --upgrade pip
274-
pip install markdown-code-runner
276+
uv venv
277+
uv pip install markdown-code-runner
275278
276279
# Install dependencies you're using in your README.md
277280
- name: Install other Python dependencies
278281
run: |
279-
pip install pandas tabulate pytest matplotlib requests
282+
uv pip install pandas tabulate pytest matplotlib requests
280283
281284
# Rust is only needed for an example in our README.md
282-
- name: Set up Rust
283-
uses: actions-rs/toolchain@v1
284-
with:
285-
toolchain: stable
286-
profile: minimal
285+
- uses: actions-rust-lang/setup-rust-toolchain@v1
287286
288287
- name: Run update-readme.py
289-
run: markdown-code-runner --verbose README.md
288+
run: uv run markdown-code-runner --verbose README.md
290289
291290
- name: Commit updated README.md
292291
id: commit
@@ -339,15 +338,14 @@ usage: markdown-code-runner [-h] [-o OUTPUT] [-d] [-v] input
339338
Automatically update Markdown files with code block output.
340339
341340
positional arguments:
342-
input Path to the input Markdown file.
341+
input Path to the input Markdown file.
343342
344343
options:
345-
-h, --help show this help message and exit
346-
-o OUTPUT, --output OUTPUT
347-
Path to the output Markdown file. (default: overwrite
348-
input file)
349-
-d, --verbose Enable debugging mode (default: False)
350-
-v, --version show program's version number and exit
344+
-h, --help show this help message and exit
345+
-o, --output OUTPUT Path to the output Markdown file. (default: overwrite
346+
input file)
347+
-d, --verbose Enable debugging mode (default: False)
348+
-v, --version show program's version number and exit
351349
```
352350
353351
<!-- OUTPUT:END -->

0 commit comments

Comments
 (0)