| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ jobs: | |||
| 37 | 37 | # This fails in pytest with: | |
| 38 | 38 | # CSC : error CS4023: /platform:anycpu32bitpreferred can only be used with /t:exe, /t:winexe and /t:appcontainerexe [D:\a\pythonnet\pythonnet\src\runtime\Python.Runtime.csproj] | |
| 39 | 39 | exclude: | |
| 40 | - - os: | ||
| 40 | + - os: | ||
| 41 | 41 | category: windows | |
| 42 | 42 | platform: x86 | |
| 43 | 43 | python: "3.13" | |
@@ -57,60 +57,53 @@ 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@v4 | ||
| 62 | 62 | with: | |
| 63 | - python-version: ${{ matrix.python }} | ||
| 64 | 63 | architecture: ${{ matrix.os.platform }} | |
| 64 | + python-version: ${{ matrix.python }} | ||
| 65 | + enable-cache: true | ||
| 65 | 66 | ||
| 66 | 67 | - name: Install dependencies | |
| 67 | 68 | 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 . | ||
| 69 | + uv venv --python ${{ matrix.python }} | ||
| 70 | + uv sync | ||
| 74 | 71 | ||
| 75 | 72 | - name: Set Python DLL path and PYTHONHOME (non Windows) | |
| 76 | 73 | if: ${{ matrix.os.category != 'windows' }} | |
| 77 | 74 | run: | | |
| 78 | - echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV | ||
| 79 | - echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV | ||
| 75 | + echo PYTHONNET_PYDLL=$(uv run python -m find_libpython) >> $GITHUB_ENV | ||
| 80 | 76 | ||
| 81 | 77 | - name: Set Python DLL path and PYTHONHOME (Windows) | |
| 82 | 78 | if: ${{ matrix.os.category == 'windows' }} | |
| 83 | 79 | 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)')" | ||
| 80 | + Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(uv run python -m find_libpython)" | ||
| 86 | 81 | ||
| 87 | 82 | - name: Embedding tests | |
| 88 | - if: ${{ matrix.python != '3.13' }} | ||
| 89 | - run: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/ | ||
| 83 | + run: uv run dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/ | ||
| 90 | 84 | env: | |
| 91 | 85 | MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466 | |
| 92 | 86 | ||
| 93 | 87 | - name: Python Tests (Mono) | |
| 94 | 88 | if: ${{ matrix.os.category != 'windows' }} | |
| 95 | - run: pytest --runtime mono | ||
| 89 | + run: uv run python -m pytest --runtime mono | ||
| 96 | 90 | ||
| 97 | 91 | # TODO: Run these tests on Windows x86 | |
| 98 | 92 | - name: Python Tests (.NET Core) | |
| 99 | 93 | if: ${{ matrix.os.platform == 'x64' }} | |
| 100 | - run: pytest --runtime coreclr | ||
| 94 | + run: uv run python -m pytest --runtime coreclr | ||
| 101 | 95 | ||
| 102 | 96 | - name: Python Tests (.NET Framework) | |
| 103 | 97 | if: ${{ matrix.os.category == 'windows' }} | |
| 104 | - run: pytest --runtime netfx | ||
| 98 | + run: uv run python -m pytest --runtime netfx | ||
| 105 | 99 | ||
| 106 | 100 | - name: Python tests run from .NET | |
| 107 | - if: ${{ matrix.python != '3.13' }} | ||
| 108 | - run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/ | ||
| 109 | - | ||
| 110 | - - name: Perf tests | ||
| 111 | - if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }} | ||
| 112 | - run: | | ||
| 113 | - pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2 | ||
| 114 | - dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/ | ||
| 115 | - | ||
| 101 | + run: uv run dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/ | ||
| 102 | + | ||
| 103 | + # - name: Perf tests | ||
| 104 | + # if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }} | ||
| 105 | + # run: | | ||
| 106 | + # uv pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2 | ||
| 107 | + # uv run dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/ | ||
| 108 | + # | ||
| 116 | 109 | # TODO: Run mono tests on Windows? | |
| Original file line number | Diff line number | Diff 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 | + # /// | ||
| 4 | 5 | """ | |
| 5 | 6 | TypeOffset is a C# class that mirrors the in-memory layout of heap | |
| 6 | 7 | allocated Python objects. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments