From b397b85a3649177c4462a35f7994f8ef6b58d57b Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 28 Mar 2025 09:45:55 -0700 Subject: [PATCH 1/6] Use uv in CI --- .github/workflows/markdown-code-runner.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/markdown-code-runner.yml b/.github/workflows/markdown-code-runner.yml index 24fd47a..8f71ad5 100644 --- a/.github/workflows/markdown-code-runner.yml +++ b/.github/workflows/markdown-code-runner.yml @@ -19,17 +19,20 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" + + - name: Install uv + uses: astral-sh/setup-uv@v5 - name: Install markdown-code-runner run: | - python -m pip install --upgrade pip - pip install . + uv venv + uv pip install . # Install dependencies you're using in your README.md - name: Install other Python dependencies run: | - pip install pandas tabulate pytest matplotlib requests + uv pip install pandas tabulate pytest matplotlib requests # Rust is only needed for an example in our README.md - name: Set up Rust @@ -39,7 +42,7 @@ jobs: profile: minimal - name: Run update-readme.py - run: markdown-code-runner --verbose README.md + run: uv run markdown-code-runner --verbose README.md - name: Commit updated README.md id: commit From a0cb857da807fda5c4ce882a6249bb33a7e134e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 28 Mar 2025 16:46:30 +0000 Subject: [PATCH 2/6] Update README.md --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8a3b4eb..b1fa5e7 100644 --- a/README.md +++ b/README.md @@ -266,17 +266,20 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" + + - name: Install uv + uses: astral-sh/setup-uv@v5 - name: Install markdown-code-runner run: | - python -m pip install --upgrade pip - pip install markdown-code-runner + uv venv + uv pip install markdown-code-runner # Install dependencies you're using in your README.md - name: Install other Python dependencies run: | - pip install pandas tabulate pytest matplotlib requests + uv pip install pandas tabulate pytest matplotlib requests # Rust is only needed for an example in our README.md - name: Set up Rust @@ -286,7 +289,7 @@ jobs: profile: minimal - name: Run update-readme.py - run: markdown-code-runner --verbose README.md + run: uv run markdown-code-runner --verbose README.md - name: Commit updated README.md id: commit @@ -339,15 +342,14 @@ usage: markdown-code-runner [-h] [-o OUTPUT] [-d] [-v] input Automatically update Markdown files with code block output. positional arguments: - input Path to the input Markdown file. + input Path to the input Markdown file. options: - -h, --help show this help message and exit - -o OUTPUT, --output OUTPUT - Path to the output Markdown file. (default: overwrite - input file) - -d, --verbose Enable debugging mode (default: False) - -v, --version show program's version number and exit + -h, --help show this help message and exit + -o, --output OUTPUT Path to the output Markdown file. (default: overwrite + input file) + -d, --verbose Enable debugging mode (default: False) + -v, --version show program's version number and exit ``` From 43c16c12022da716277c800b2cc5c04a51555ffe Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 28 Mar 2025 09:47:22 -0700 Subject: [PATCH 3/6] Use - uses: actions-rust-lang/setup-rust-toolchain@v1 --- .github/workflows/markdown-code-runner.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/markdown-code-runner.yml b/.github/workflows/markdown-code-runner.yml index 8f71ad5..1a09d18 100644 --- a/.github/workflows/markdown-code-runner.yml +++ b/.github/workflows/markdown-code-runner.yml @@ -35,11 +35,7 @@ jobs: uv pip install pandas tabulate pytest matplotlib requests # Rust is only needed for an example in our README.md - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Run update-readme.py run: uv run markdown-code-runner --verbose README.md From 43f8ee0a752d17a27de462b03bdcf6ab97218d40 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 28 Mar 2025 16:47:53 +0000 Subject: [PATCH 4/6] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index b1fa5e7..f044ad1 100644 --- a/README.md +++ b/README.md @@ -282,11 +282,7 @@ jobs: uv pip install pandas tabulate pytest matplotlib requests # Rust is only needed for an example in our README.md - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + - uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Run update-readme.py run: uv run markdown-code-runner --verbose README.md From 23bddf13c5e8f0a45b6d1a7e76551fcbb3ce2641 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 28 Mar 2025 09:49:01 -0700 Subject: [PATCH 5/6] Skip 3.7 --- .github/workflows/pytest.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 5ca3a2a..c0c13c3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -16,10 +16,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v5 - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e ".[test]" - pip install pytest + run: uv sync --all-extras - name: Run pytest - run: pytest + run: uv run pytest From 942d9778f9cea36e601f860b7d5125e0fab9669a Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 28 Mar 2025 09:50:21 -0700 Subject: [PATCH 6/6] Skip 3.8 and add 3.13 --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c0c13c3..d368437 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4