🌐 AI搜索 & 代理 主页
Skip to content

Commit d304d7f

Browse files
committed
Merge uv changes
2 parents 6b99b22 + 0ced4e6 commit d304d7f

File tree

3 files changed

+688
-19
lines changed

3 files changed

+688
-19
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,23 @@ jobs:
5959
8.0.x
6060
9.0.x
6161
62-
- name: Set up Python ${{ matrix.python }}
63-
uses: actions/setup-python@v6
62+
- name: Install the latest version of uv
63+
uses: astral-sh/setup-uv@v6
6464
with:
65-
python-version: ${{ matrix.python }}
6665
architecture: ${{ matrix.os.platform }}
67-
68-
- name: Install dependencies
69-
run: |
70-
pip install --upgrade -r requirements.txt
71-
pip install numpy # for tests
72-
73-
- name: Build and Install
74-
run: |
75-
pip install -v .
66+
python-version: ${{ matrix.python }}
67+
activate-environment: true
68+
enable-cache: true
7669

7770
- name: Set Python DLL path and PYTHONHOME (non Windows)
7871
if: ${{ matrix.os.category != 'windows' }}
7972
run: |
80-
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
81-
echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
73+
echo PYTHONNET_PYDLL=$(uv run find_libpython) >> $GITHUB_ENV
8274
8375
- name: Set Python DLL path and PYTHONHOME (Windows)
8476
if: ${{ matrix.os.category == 'windows' }}
8577
run: |
86-
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
87-
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"
78+
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(uv run find_libpython)"
8879
8980
- name: Embedding tests
9081
run: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/
@@ -105,4 +96,15 @@ jobs:
10596
run: pytest --runtime netfx
10697

10798
- name: Python tests run from .NET
99+
<<<<<<< HEAD
108100
run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
101+
=======
102+
run: uv run dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
103+
104+
- name: Perf tests
105+
if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }}
106+
run: |
107+
uv pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
108+
uv run dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/
109+
# TODO: Run mono tests on Windows?
110+
>>>>>>> uv

tools/geninterop/geninterop.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
3-
1+
#!/usr/bin/env uv run
2+
# /// script
3+
# dependencies = ["pycparser"]
4+
# ///
45
"""
56
TypeOffset is a C# class that mirrors the in-memory layout of heap
67
allocated Python objects.

0 commit comments

Comments
 (0)