From ec5bc55caf3b49beafed71fc3c8484050b25b898 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Sat, 14 Sep 2024 14:59:01 +0200 Subject: [PATCH] Stop installing into CI's system (#1346) * Stop installing into CI's system We're starting to get permission denied errors when installing with --system. * Pin Pyright * Simplify * Fix typo --- .github/workflows/ci.yml | 31 +++++++++++++------------------ tox.ini | 2 +- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49af4e54..4e4d79eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,18 +70,17 @@ jobs: echo DO_MYPY=$DO_MYPY >>$GITHUB_ENV echo TOX_PYTHON=py$(echo $V | tr -d .) >>$GITHUB_ENV - uv pip install --system tox - - - run: uv pip install --system tox-uv - - - run: python -Im tox run -e ${{ env.TOX_PYTHON }}-mypy + - run: > + uvx --with=tox-uv + tox run + -e ${{ env.TOX_PYTHON }}-mypy if: env.DO_MYPY == '1' - name: Remove src to ensure tests run against wheel run: rm -rf src - run: > - python -Im + uvx --with=tox-uv tox run --installpkg dist/*.whl -e ${{ env.TOX_PYTHON }}-tests @@ -121,10 +120,8 @@ jobs: allow-prereleases: true - uses: hynek/setup-cached-uv@v2 - - run: uv pip install --system tox-uv - - run: > - python -Im + uvx --with=tox-uv tox run --installpkg dist/*.whl -e pypy3-tests @@ -154,16 +151,16 @@ jobs: - name: Combine coverage & fail if it's <100%. run: | - uv pip install --system coverage[toml] + uv tool install 'coverage[toml]' - python -Im coverage combine - python -Im coverage html --skip-covered --skip-empty + coverage combine + coverage html --skip-covered --skip-empty # Report and write to summary. - python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY + coverage report --format=markdown >> $GITHUB_STEP_SUMMARY # Report again and fail if under 100%. - python -Im coverage report --fail-under=100 + coverage report --fail-under=100 - name: Upload HTML report if check failed. uses: actions/upload-artifact@v4 @@ -189,8 +186,7 @@ jobs: python-version: "3.12" - uses: hynek/setup-cached-uv@v2 - - run: uv pip install --system tox-uv - - run: python -Im tox run -e docs,changelog + - run: uvx --with=tox-uv tox run -e docs,changelog pyright: name: Check types using pyright @@ -202,8 +198,7 @@ jobs: python-version-file: .python-version-default - uses: hynek/setup-cached-uv@v2 - - run: uv pip install --system tox-uv - - run: python -Im tox run -e pyright + - run: uvx --with=tox-uv tox run -e pyright install-dev: name: Verify dev env diff --git a/tox.ini b/tox.ini index 3b51dbeb..84cc22c0 100644 --- a/tox.ini +++ b/tox.ini @@ -113,7 +113,7 @@ commands = [testenv:pyright] extras = tests -deps = pyright +deps = pyright<1.1.380 commands = pytest tests/test_pyright.py -vv