🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Next Next commit
Use uv
  • Loading branch information
filmor committed Oct 25, 2025
commit 8d8bf26245d8c4803de64670b75c948396a9b7c6
25 changes: 7 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,24 @@ jobs:
dotnet-version: '8.0.x'

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.os.platform }}

- name: Install dependencies
run: |
pip install --upgrade -r requirements.txt
pip install numpy # for tests

- name: Build and Install
run: |
pip install -v .
python-version: ${{ matrix.python }}
activate-environment: true
enable-cache: true

- name: Set Python DLL path and PYTHONHOME (non Windows)
if: ${{ matrix.os.category != 'windows' }}
run: |
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV
echo PYTHONNET_PYDLL=$(uv run find_libpython) >> $GITHUB_ENV

- name: Set Python DLL path and PYTHONHOME (Windows)
if: ${{ matrix.os.category == 'windows' }}
run: |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')"
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(uv run find_libpython)"

- name: Embedding tests
if: ${{ matrix.python != '3.13' }}
run: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/
env:
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466
Expand All @@ -108,7 +98,6 @@ jobs:
run: pytest --runtime netfx

- name: Python tests run from .NET
if: ${{ matrix.python != '3.13' }}
run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
run: uv run dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/

# TODO: Run mono tests on Windows?
7 changes: 4 additions & 3 deletions tools/geninterop/geninterop.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#!/usr/bin/env uv run
# /// script
# dependencies = ["pycparser"]
# ///
"""
TypeOffset is a C# class that mirrors the in-memory layout of heap
allocated Python objects.
Expand Down
Loading