@@ -49,26 +49,21 @@ jobs:
49
49
with :
50
50
dotnet-version :' 6.0.x'
51
51
52
- -name :Set up Python ${{ matrix.python }}
53
- uses :actions /setup-python@v2
52
+ -name :Install the latest version of uv
53
+ uses :astral-sh /setup-uv@v3
54
54
with :
55
- python-version :${{ matrix.python }}
56
- architecture :${{ matrix.os.platform }}
55
+ enable-cache :true
57
56
58
57
-name :Install dependencies
59
58
run :|
60
- pip install --upgrade -r requirements.txt
61
- pip install numpy # for tests
62
-
63
- -name :Build and Install
64
- run :|
65
- pip install -v .
59
+ uv venv --python ${{ matrix.python }}
60
+ uv sync
66
61
67
62
-name :Set Python DLL path and PYTHONHOME (non Windows)
68
63
if :${{ matrix.os.category != 'windows' }}
69
64
run :|
70
- echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
71
- echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
65
+ echo PYTHONNET_PYDLL=$(uv run find_libpython) >> $GITHUB_ENV
66
+ echo PYTHONHOME=$(uv run python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
72
67
73
68
-name :Set Python DLL path and PYTHONHOME (Windows)
74
69
if :${{ matrix.os.category == 'windows' }}
@@ -83,24 +78,24 @@ jobs:
83
78
84
79
-name :Python Tests (Mono)
85
80
if :${{ matrix.os.category != 'windows' }}
86
- run :pytest --runtime mono
81
+ run :uv run pytest --runtime mono
87
82
88
83
# TODO: Run these tests on Windows x86
89
84
-name :Python Tests (.NET Core)
90
85
if :${{ matrix.os.platform == 'x64' }}
91
- run :pytest --runtime coreclr
86
+ run :uv run pytest --runtime coreclr
92
87
93
88
-name :Python Tests (.NET Framework)
94
89
if :${{ matrix.os.category == 'windows' }}
95
- run :pytest --runtime netfx
90
+ run :uv run pytest --runtime netfx
96
91
97
92
-name :Python tests run from .NET
98
93
run :dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
99
94
100
95
-name :Perf tests
101
96
if :${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }}
102
97
run :|
103
- pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
98
+ uv pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
104
99
dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/
105
100
106
101
# TODO: Run mono tests on Windows?