From 4983ab42c8d833205977bc350d2beefca307e5df Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 11:20:35 +0100 Subject: [PATCH 01/13] Use uv in CI to speed-up requirements install --- .github/workflows/python-quality.yml | 4 ++-- .github/workflows/python-tests.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 3d400487f3..10831ad45f 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -25,8 +25,8 @@ jobs: python-version: 3.9 - name: Install dependencies run: | - pip install --upgrade pip - pip install .[dev] + pip install --upgrade uv + uv pip install ".[dev]" - run: ruff check tests src contrib # linter - run: ruff format --check tests src contrib # formatter - run: python utils/check_contrib_list.py diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 618a5a934e..c4b37962db 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -47,8 +47,8 @@ jobs: # Install dependencies - name: Configure and install dependencies run: | - pip install --upgrade pip - pip install .[testing] + pip install --upgrade uv + uv pip install ".[testing]" case "${{ matrix.test_name }}" in @@ -63,13 +63,13 @@ jobs: ;; fastai | torch) - pip install .[${{ matrix.test_name }}] + uv pip install .[${{ matrix.test_name }}] ;; tensorflow) sudo apt update sudo apt install -y graphviz - pip install .[tensorflow] + uv pip install .[tensorflow] ;; esac @@ -151,8 +151,8 @@ jobs: # Install dependencies - name: Configure and install dependencies run: | - pip install --upgrade pip - pip install .[testing] + pip install --upgrade uv + uv pip install ".[testing]" # Easy debugging if CI is broken - name: Pip freeze From b22aa37f359a4c309911507a75b997454ed4f1d3 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 11:29:57 +0100 Subject: [PATCH 02/13] fix commands --- .github/workflows/python-quality.yml | 2 +- .github/workflows/python-tests.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 10831ad45f..dd9682c907 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | pip install --upgrade uv - uv pip install ".[dev]" + uv pip install "huggingface_hub[dev] @ ." - run: ruff check tests src contrib # linter - run: ruff format --check tests src contrib # formatter - run: python utils/check_contrib_list.py diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index c4b37962db..afa9b85506 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -48,7 +48,7 @@ jobs: - name: Configure and install dependencies run: | pip install --upgrade uv - uv pip install ".[testing]" + uv pip install "huggingface_hub[testing] @ ." case "${{ matrix.test_name }}" in @@ -63,13 +63,13 @@ jobs: ;; fastai | torch) - uv pip install .[${{ matrix.test_name }}] + uv pip install "huggingface_hub[${{ matrix.test_name }}] @ ." ;; tensorflow) sudo apt update sudo apt install -y graphviz - uv pip install .[tensorflow] + uv pip install "huggingface_hub[tensorflow] @ ." ;; esac @@ -152,7 +152,7 @@ jobs: - name: Configure and install dependencies run: | pip install --upgrade uv - uv pip install ".[testing]" + uv pip install "huggingface_hub[testing] @ ." # Easy debugging if CI is broken - name: Pip freeze From f566a00d01dad04b014920c94c28456d18db8d45 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 11:45:13 +0100 Subject: [PATCH 03/13] run in venv --- .github/workflows/python-quality.yml | 10 ++++++++-- .github/workflows/python-tests.yml | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index dd9682c907..c7f694d573 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -23,10 +23,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.9 - - name: Install dependencies + + # Setup venv + - name: Setup venv + uv run: | pip install --upgrade uv - uv pip install "huggingface_hub[dev] @ ." + uv venv + source .venv/bin/activate + + - name: Install dependencies + run: uv pip install "huggingface_hub[dev] @ ." - run: ruff check tests src contrib # linter - run: ruff format --check tests src contrib # formatter - run: python utils/check_contrib_list.py diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index afa9b85506..2363576c75 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -44,10 +44,16 @@ jobs: with: python-version: ${{ matrix.python-version }} - # Install dependencies - - name: Configure and install dependencies + # Setup venv + - name: Setup venv + uv run: | pip install --upgrade uv + uv venv + source .venv/bin/activate + + # Install dependencies + - name: Install dependencies + run: | uv pip install "huggingface_hub[testing] @ ." case "${{ matrix.test_name }}" in @@ -148,11 +154,16 @@ jobs: with: python-version: ${{ matrix.python-version }} - # Install dependencies - - name: Configure and install dependencies + # Setup venv + - name: Setup venv + uv run: | pip install --upgrade uv - uv pip install "huggingface_hub[testing] @ ." + uv venv + .venv\Scripts\activate + + # Install dependencies + - name: Install dependencies + run: uv pip install "huggingface_hub[testing] @ ." # Easy debugging if CI is broken - name: Pip freeze From 000a18b2d9fd8a3790f4f9c4711b9c7468148d59 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 11:59:40 +0100 Subject: [PATCH 04/13] echo --- .github/workflows/python-quality.yml | 1 + .github/workflows/python-tests.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index c7f694d573..3f8f5d2db2 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -30,6 +30,7 @@ jobs: pip install --upgrade uv uv venv source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV # See https://stackoverflow.com/a/74669486 - name: Install dependencies run: uv pip install "huggingface_hub[dev] @ ." diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 2363576c75..abb7b1105c 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -50,6 +50,7 @@ jobs: pip install --upgrade uv uv venv source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV # See https://stackoverflow.com/a/74669486 # Install dependencies - name: Install dependencies @@ -160,6 +161,7 @@ jobs: pip install --upgrade uv uv venv .venv\Scripts\activate + echo PATH=$PATH >> $env:GITHUB_ENV # See https://stackoverflow.com/a/74669486 # Install dependencies - name: Install dependencies From 2f88d94991feebe9473e2a7521ddd00bd898a6ee Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 12:03:33 +0100 Subject: [PATCH 05/13] try something else --- .github/workflows/python-quality.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 3f8f5d2db2..3a61170420 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -29,21 +29,19 @@ jobs: run: | pip install --upgrade uv uv venv - source .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV # See https://stackoverflow.com/a/74669486 - name: Install dependencies run: uv pip install "huggingface_hub[dev] @ ." - - run: ruff check tests src contrib # linter - - run: ruff format --check tests src contrib # formatter - - run: python utils/check_contrib_list.py - - run: python utils/check_static_imports.py - - run: python utils/generate_async_inference_client.py - - run: python utils/generate_inference_types.py + - run: .venv/bin/ruff check tests src contrib # linter + - run: .venv/bin/ruff format --check tests src contrib # formatter + - run: .venv/bin/python utils/check_contrib_list.py + - run: .venv/bin/python utils/check_static_imports.py + - run: .venv/bin/python utils/generate_async_inference_client.py + - run: .venv/bin/python utils/generate_inference_types.py # Run type checking at least on huggingface_hub root file to check all modules # that can be lazy-loaded actually exist. - - run: mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback + - run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback # Run mypy on full package - - run: mypy src + - run: .venv/bin/mypy src From 038d0e331cae36d6a3f68e05aaea36258fe32248 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 12:11:53 +0100 Subject: [PATCH 06/13] hack --- .github/workflows/python-quality.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 3a61170420..6317471ca8 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -31,17 +31,19 @@ jobs: uv venv - name: Install dependencies - run: uv pip install "huggingface_hub[dev] @ ." - - run: .venv/bin/ruff check tests src contrib # linter - - run: .venv/bin/ruff format --check tests src contrib # formatter - - run: .venv/bin/python utils/check_contrib_list.py - - run: .venv/bin/python utils/check_static_imports.py - - run: .venv/bin/python utils/generate_async_inference_client.py - - run: .venv/bin/python utils/generate_inference_types.py + # Hack: set VIRTUAL_ENV= to trick uv. TODO: remove this at some point. + # See https://github.com/astral-sh/uv/pull/2000 + run: VIRTUAL_ENV= uv pip install "huggingface_hub[dev] @ ." + - run: ruff check tests src contrib # linter + - run: ruff format --check tests src contrib # formatter + - run: python utils/check_contrib_list.py + - run: python utils/check_static_imports.py + - run: python utils/generate_async_inference_client.py + - run: python utils/generate_inference_types.py # Run type checking at least on huggingface_hub root file to check all modules # that can be lazy-loaded actually exist. - - run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback + - run: mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback # Run mypy on full package - - run: .venv/bin/mypy src + - run: mypy src From 2a9e61dcc44ce40c533e3c8316c02704126c26da Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 12:15:27 +0100 Subject: [PATCH 07/13] better? --- .github/workflows/python-quality.yml | 22 +++++++++++----------- .github/workflows/python-tests.yml | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 6317471ca8..30602cb8aa 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -25,25 +25,25 @@ jobs: python-version: 3.9 # Setup venv + # TODO: remove this once uv is available in the default environment + # See https://github.com/astral-sh/uv/pull/2000 - name: Setup venv + uv run: | pip install --upgrade uv uv venv - name: Install dependencies - # Hack: set VIRTUAL_ENV= to trick uv. TODO: remove this at some point. - # See https://github.com/astral-sh/uv/pull/2000 - run: VIRTUAL_ENV= uv pip install "huggingface_hub[dev] @ ." - - run: ruff check tests src contrib # linter - - run: ruff format --check tests src contrib # formatter - - run: python utils/check_contrib_list.py - - run: python utils/check_static_imports.py - - run: python utils/generate_async_inference_client.py - - run: python utils/generate_inference_types.py + run: uv pip install "huggingface_hub[dev] @ ." + - run: .venv/bin/ruff check tests src contrib # linter + - run: .venv/bin/ruff format --check tests src contrib # formatter + - run: .venv/bin/python utils/check_contrib_list.py + - run: .venv/bin/python utils/check_static_imports.py + - run: .venv/bin/python utils/generate_async_inference_client.py + - run: .venv/bin/python utils/generate_inference_types.py # Run type checking at least on huggingface_hub root file to check all modules # that can be lazy-loaded actually exist. - - run: mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback + - run: .venv/bin/mypy src/huggingface_hub/__init__.py --follow-imports=silent --show-traceback # Run mypy on full package - - run: mypy src + - run: .venv/bin/mypy src diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index abb7b1105c..9b6b033086 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -45,12 +45,12 @@ jobs: python-version: ${{ matrix.python-version }} # Setup venv + # TODO: remove this once uv is available in the default environment + # See https://github.com/astral-sh/uv/pull/2000 - name: Setup venv + uv run: | pip install --upgrade uv uv venv - source .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV # See https://stackoverflow.com/a/74669486 # Install dependencies - name: Install dependencies @@ -83,13 +83,13 @@ jobs: # Easy debugging if CI is broken - name: Pip freeze - run: pip freeze + run: .venv/bin/pip freeze # Run tests - name: Run tests working-directory: ./src # For code coverage to work run: | - PYTEST="python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" + PYTEST=".venv/bin/python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" case "${{ matrix.test_name }}" in @@ -156,12 +156,12 @@ jobs: python-version: ${{ matrix.python-version }} # Setup venv + # TODO: remove this once uv is available in the default environment + # See https://github.com/astral-sh/uv/pull/2000 - name: Setup venv + uv run: | pip install --upgrade uv uv venv - .venv\Scripts\activate - echo PATH=$PATH >> $env:GITHUB_ENV # See https://stackoverflow.com/a/74669486 # Install dependencies - name: Install dependencies @@ -169,12 +169,12 @@ jobs: # Easy debugging if CI is broken - name: Pip freeze - run: pip freeze + run: .venv\Scripts\pip freeze # Run tests - name: Run tests working-directory: ./src # For code coverage to work - run: python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests + run: .venv\Scripts\python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests # Upload code coverage - name: Upload coverage reports to Codecov with GitHub Action From 8b8e9ac545810f40560e665efbd982e4e5d53dd4 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 12:17:14 +0100 Subject: [PATCH 08/13] remove pip freeze --- .github/workflows/python-tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 9b6b033086..55e0a3a8bc 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -81,10 +81,6 @@ jobs: esac - # Easy debugging if CI is broken - - name: Pip freeze - run: .venv/bin/pip freeze - # Run tests - name: Run tests working-directory: ./src # For code coverage to work @@ -167,10 +163,6 @@ jobs: - name: Install dependencies run: uv pip install "huggingface_hub[testing] @ ." - # Easy debugging if CI is broken - - name: Pip freeze - run: .venv\Scripts\pip freeze - # Run tests - name: Run tests working-directory: ./src # For code coverage to work From 1d9edc77fe8d466fb8cc767df2edab1cf7dae28c Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 12:19:04 +0100 Subject: [PATCH 09/13] fix --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 55e0a3a8bc..19e3ed1f1a 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -85,7 +85,7 @@ jobs: - name: Run tests working-directory: ./src # For code coverage to work run: | - PYTEST=".venv/bin/python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" + PYTEST="../.venv/bin/python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" case "${{ matrix.test_name }}" in From 1547e68557695ab91c68c1c83e001cc5a1474bd3 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 13:21:28 +0100 Subject: [PATCH 10/13] better --- .github/workflows/python-tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 19e3ed1f1a..67ba6374a4 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -85,7 +85,8 @@ jobs: - name: Run tests working-directory: ./src # For code coverage to work run: | - PYTEST="../.venv/bin/python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" + source ../venv/bin/activate + PYTEST="python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" case "${{ matrix.test_name }}" in @@ -166,7 +167,9 @@ jobs: # Run tests - name: Run tests working-directory: ./src # For code coverage to work - run: .venv\Scripts\python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests + run: | + .venv\Scripts\activate + python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests # Upload code coverage - name: Upload coverage reports to Codecov with GitHub Action From eda73a5481c4b03c23a65d461b7689054710aa84 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 13:24:48 +0100 Subject: [PATCH 11/13] fixed --- .github/workflows/python-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 67ba6374a4..fcd913e453 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -85,7 +85,7 @@ jobs: - name: Run tests working-directory: ./src # For code coverage to work run: | - source ../venv/bin/activate + source ../.venv/bin/activate PYTEST="python -m pytest --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504||not less than or equal to 0.01)'" case "${{ matrix.test_name }}" in @@ -168,7 +168,7 @@ jobs: - name: Run tests working-directory: ./src # For code coverage to work run: | - .venv\Scripts\activate + .venv/bin/activate python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests # Upload code coverage From ab7e0510de102b25181ac0186fa336ba26797510 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 13:29:14 +0100 Subject: [PATCH 12/13] comments --- .github/workflows/python-quality.yml | 3 +-- .github/workflows/python-tests.yml | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-quality.yml b/.github/workflows/python-quality.yml index 30602cb8aa..97be22d052 100644 --- a/.github/workflows/python-quality.yml +++ b/.github/workflows/python-quality.yml @@ -25,8 +25,7 @@ jobs: python-version: 3.9 # Setup venv - # TODO: remove this once uv is available in the default environment - # See https://github.com/astral-sh/uv/pull/2000 + # TODO: revisit when https://github.com/astral-sh/uv/issues/1526 is addressed. - name: Setup venv + uv run: | pip install --upgrade uv diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index fcd913e453..ebe7e8382e 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -45,8 +45,7 @@ jobs: python-version: ${{ matrix.python-version }} # Setup venv - # TODO: remove this once uv is available in the default environment - # See https://github.com/astral-sh/uv/pull/2000 + # TODO: revisit when https://github.com/astral-sh/uv/issues/1526 is addressed. - name: Setup venv + uv run: | pip install --upgrade uv @@ -153,8 +152,7 @@ jobs: python-version: ${{ matrix.python-version }} # Setup venv - # TODO: remove this once uv is available in the default environment - # See https://github.com/astral-sh/uv/pull/2000 + # TODO: revisit when https://github.com/astral-sh/uv/issues/1526 is addressed. - name: Setup venv + uv run: | pip install --upgrade uv From 209a9ecd5553993c574b460e6fe1aefed4bcd795 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Fri, 1 Mar 2024 13:30:23 +0100 Subject: [PATCH 13/13] windows --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index ebe7e8382e..d04939e273 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -166,7 +166,7 @@ jobs: - name: Run tests working-directory: ./src # For code coverage to work run: | - .venv/bin/activate + ..\.venv\Scripts\activate python -m pytest -n 4 --cov=./huggingface_hub --cov-report=xml:../coverage.xml --vcr-record=none --reruns 5 --reruns-delay 1 --only-rerun '(OSError|Timeout|HTTPError.*502|HTTPError.*504|not less than or equal to 0.01)' ../tests # Upload code coverage