Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to use uv pip install #2957

Merged
merged 39 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
45bfc35
Switch to use `uv`. Closes #2956
CoolCat467 Feb 16, 2024
395331d
Attempt to fix venv issue
CoolCat467 Feb 16, 2024
060b9ae
Attempt to fix venv install on windows
CoolCat467 Feb 16, 2024
61c1887
Fix windows check
CoolCat467 Feb 16, 2024
861788e
Should have checked, extra parens syntax error
CoolCat467 Feb 16, 2024
48f8503
Try to get windows venv activate to work
CoolCat467 Feb 16, 2024
71a2e53
Windows venv try #3
CoolCat467 Feb 16, 2024
e300d26
Windows venv try 4
CoolCat467 Feb 16, 2024
386c251
Windows venv 5
CoolCat467 Feb 16, 2024
868022a
Windows venv 6 (forgot `.`)
CoolCat467 Feb 16, 2024
7f654d4
Windows venv 7
CoolCat467 Feb 16, 2024
11af40d
Source the windows activate
CoolCat467 Feb 16, 2024
161be94
Revert installing `build` with `uv`
CoolCat467 Feb 16, 2024
4a5e8ef
Attempt to fix missing `build` errors
CoolCat467 Feb 16, 2024
5ac75fc
Revert pip-compile changes
CoolCat467 Feb 16, 2024
249f7d7
Add uv 0.1.3
CoolCat467 Feb 17, 2024
06064ac
Attempt to fix alpine not finding `uv` by making sure uv is installed…
CoolCat467 Feb 17, 2024
a0a059a
Only use pip for venv installing of `uv`
CoolCat467 Feb 17, 2024
779e872
Ensure pip is installed in venv (pypy failure)
CoolCat467 Feb 17, 2024
be9755f
Merge branch 'python-trio:master' into switch-to-UV
CoolCat467 Mar 11, 2024
bb1ba35
Merge branch 'master' into switch-to-UV
CoolCat467 May 7, 2024
7a614b8
Merge branch 'master' into switch-to-UV
CoolCat467 Jun 27, 2024
da5e997
Update uv version
CoolCat467 Jun 27, 2024
fbe01b5
Update ci.sh
jakkdl Jun 27, 2024
c4f9891
Revert changing wheel version to be lower
CoolCat467 Jun 27, 2024
13cd881
Move using virtual environment behind `MAKE_VENV` flag
CoolCat467 Jun 27, 2024
ada0e84
Make sure running without a venv works
CoolCat467 Jun 27, 2024
f57943d
Try to fix getting python executable on windows
CoolCat467 Jun 27, 2024
a359dac
Make `PYTHON_PATH` work on both windows and linux
CoolCat467 Jun 27, 2024
9561fc7
Merge branch 'main' into switch-to-UV
CoolCat467 Jul 8, 2024
8c1ac6e
Add comment about python path variable
CoolCat467 Jul 8, 2024
a80e435
Merge branch 'main' into switch-to-UV
CoolCat467 Aug 4, 2024
57b8d2f
Detect if on Github CI and use system python if so
CoolCat467 Aug 4, 2024
da9f361
Try invoking with `python -m uv`
CoolCat467 Aug 4, 2024
5b8f40b
Install pinned uv version from the start
CoolCat467 Aug 4, 2024
d7381b5
Follow shellcheck suggestions
CoolCat467 Aug 13, 2024
bc3a94e
Use constraints instead of grep
CoolCat467 Aug 13, 2024
af258f3
Merge branch 'main' into switch-to-UV
CoolCat467 Aug 13, 2024
3933ce2
Merge branch 'main' into switch-to-UV
CoolCat467 Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 12 additions & 8 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading