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