diff --git a/check.sh b/check.sh index d6efb8749..6c3aac388 100755 --- a/check.sh +++ b/check.sh @@ -112,7 +112,7 @@ if [ $EXIT_STATUS -ne 0 ]; then Problems were found by static analysis (listed above). To fix formatting and see remaining errors, run - pip install -r test-requirements.txt + uv pip install -r test-requirements.txt black src/trio ruff check src/trio ./check.sh diff --git a/ci.sh b/ci.sh index 1134b5745..ef3dee55c 100755 --- a/ci.sh +++ b/ci.sh @@ -37,25 +37,29 @@ python -c "import sys, struct, ssl; print('python:', sys.version); print('versio echo "::endgroup::" echo "::group::Install dependencies" -python -m pip install -U pip build +python -m pip install -U pip uv -c test-requirements.txt python -m pip --version +python -m uv --version + +python -m uv pip install build python -m build -python -m pip install dist/*.whl -c test-requirements.txt +wheel_package=$(ls dist/*.whl) +python -m uv pip install "trio @ $wheel_package" -c test-requirements.txt if [ "$CHECK_FORMATTING" = "1" ]; then - python -m pip install -r test-requirements.txt exceptiongroup + python -m uv pip install -r test-requirements.txt exceptiongroup echo "::endgroup::" source check.sh else # Actual tests # expands to 0 != 1 if NO_TEST_REQUIREMENTS is not set, if set the `-0` has no effect # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 - if [ ${NO_TEST_REQUIREMENTS-0} == 1 ]; then - python -m pip install pytest coverage -c test-requirements.txt + if [ "${NO_TEST_REQUIREMENTS-0}" == 1 ]; then + python -m uv pip install pytest coverage -c test-requirements.txt flags="--skip-optional-imports" else - python -m pip install -r test-requirements.txt + python -m uv pip install -r test-requirements.txt flags="" fi @@ -118,7 +122,7 @@ else cd empty INSTALLDIR=$(python -c "import os, trio; print(os.path.dirname(trio.__file__))") - cp ../pyproject.toml $INSTALLDIR + cp ../pyproject.toml "$INSTALLDIR" # get mypy tests a nice cache MYPYPATH=".." mypy --config-file= --cache-dir=./.mypy_cache -c "import trio" >/dev/null 2>/dev/null || true @@ -128,7 +132,7 @@ else echo "::endgroup::" echo "::group:: Run Tests" - if COVERAGE_PROCESS_START=$(pwd)/../pyproject.toml coverage run --rcfile=../pyproject.toml -m pytest -ra --junitxml=../test-results.xml --run-slow ${INSTALLDIR} --verbose --durations=10 $flags; then + if COVERAGE_PROCESS_START=$(pwd)/../pyproject.toml coverage run --rcfile=../pyproject.toml -m pytest -ra --junitxml=../test-results.xml --run-slow "${INSTALLDIR}" --verbose --durations=10 $flags; then PASSED=true else PASSED=false