From 7f220fa2b6b2d694c72df01232925373fd76bcfa Mon Sep 17 00:00:00 2001 From: Jonathan Daniel Date: Thu, 12 Sep 2024 23:57:44 +0300 Subject: [PATCH] Remove the `--offline` flag from `uv python install` See: https://github.com/astral-sh/uv/issues/7340 --- .github/workflows/pre-commit.yml | 4 ++-- .github/workflows/tests.yml | 10 +++++----- pyproject.toml | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 4ca2c6e..9d54562 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -36,7 +36,7 @@ jobs: - name: Install Python run: uv python install - name: Install dependencies - run: uv sync + run: uv sync --offline - name: Set PY id: set-py run: echo "PY=$(python -VV | sha256sum | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT @@ -47,4 +47,4 @@ jobs: - name: Run pre-commit env: PRE_COMMIT_COLOR: always - run: uv run pre-commit run --all-files + run: uv run --offline pre-commit run --all-files diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e7a1c8..618cdef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,20 +51,20 @@ jobs: - name: Install Python run: uv python install ${{ matrix.python-version }} - name: Install dependencies - run: uv sync + run: uv sync --offline - name: Run live tests (needing an internet connection) - run: uv run coverage run -m pytest -m live + run: uv run --offline coverage run -m pytest -m live - name: Run offline tests if: github.event_name != 'schedule' - run: uv run coverage run -am pytest -m "not live" --disable-network + run: uv run --offline coverage run -am pytest -m "not live" --disable-network --offline - name: Report coverage if: github.event_name != 'schedule' - run: uv run coverage report + run: uv run --offline coverage report # The following step will be removed when all the project is covered with tests - name: Maintain 100% coverage on tested modules if: github.event_name != 'schedule' run: | - uv run coverage report --fail-under 100 \ + uv run --offline coverage report --fail-under 100 \ xil/_currencies.py \ xil/_headers.py \ xil/_df_normalizer.py \ diff --git a/pyproject.toml b/pyproject.toml index 3d5c72a..3a006dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,6 @@ dev-dependencies = [ "mypy>=1.11.2", "pandas-stubs>=2.2.2.240807", ] -offline = true [tool.ruff] target-version = "py311"