| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,25 +9,35 @@ on: | |||
| 9 | 9 | jobs: | |
| 10 | 10 | build-test: | |
| 11 | 11 | name: Build and Test | |
| 12 | - runs-on: ${{ matrix.os }}-latest | ||
| 12 | + runs-on: ${{ matrix.os.instance }} | ||
| 13 | 13 | timeout-minutes: 15 | |
| 14 | 14 | ||
| 15 | 15 | strategy: | |
| 16 | 16 | fail-fast: false | |
| 17 | 17 | matrix: | |
| 18 | - os: [windows, ubuntu, macos] | ||
| 19 | - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 20 | - platform: [x64, x86] | ||
| 21 | - exclude: | ||
| 22 | - - os: ubuntu | ||
| 23 | - platform: x86 | ||
| 24 | - - os: macos | ||
| 18 | + os: | ||
| 19 | + - category: windows | ||
| 25 | 20 | platform: x86 | |
| 21 | + instance: windows-latest | ||
| 22 | + | ||
| 23 | + - category: windows | ||
| 24 | + platform: x64 | ||
| 25 | + instance: windows-latest | ||
| 26 | + | ||
| 27 | + - category: ubuntu | ||
| 28 | + platform: x64 | ||
| 29 | + instance: ubuntu-latest | ||
| 30 | + | ||
| 31 | + - category: macos | ||
| 32 | + platform: x64 | ||
| 33 | + instance: macos-13 | ||
| 34 | + | ||
| 35 | + python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| 26 | 36 | ||
| 27 | 37 | steps: | |
| 28 | 38 | - name: Set Environment on macOS | |
| 29 | 39 | uses: maxim-lobanov/setup-xamarin@v1 | |
| 30 | - if: ${{ matrix.os == 'macos' }} | ||
| 40 | + if: ${{ matrix.os.category == 'macos' }} | ||
| 31 | 41 | with: | |
| 32 | 42 | mono-version: latest | |
| 33 | 43 | ||
@@ -43,7 +53,7 @@ jobs: | |||
| 43 | 53 | uses: actions/setup-python@v2 | |
| 44 | 54 | with: | |
| 45 | 55 | python-version: ${{ matrix.python }} | |
| 46 | - architecture: ${{ matrix.platform }} | ||
| 56 | + architecture: ${{ matrix.os.platform }} | ||
| 47 | 57 | ||
| 48 | 58 | - name: Install dependencies | |
| 49 | 59 | run: | | |
@@ -55,42 +65,42 @@ jobs: | |||
| 55 | 65 | pip install -v . | |
| 56 | 66 | ||
| 57 | 67 | - name: Set Python DLL path and PYTHONHOME (non Windows) | |
| 58 | - if: ${{ matrix.os != 'windows' }} | ||
| 68 | + if: ${{ matrix.os.category != 'windows' }} | ||
| 59 | 69 | run: | | |
| 60 | 70 | echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV | |
| 61 | 71 | echo PYTHONHOME=$(python -c 'import sys; print(sys.prefix)') >> $GITHUB_ENV | |
| 62 | 72 | ||
| 63 | 73 | - name: Set Python DLL path and PYTHONHOME (Windows) | |
| 64 | - if: ${{ matrix.os == 'windows' }} | ||
| 74 | + if: ${{ matrix.os.category == 'windows' }} | ||
| 65 | 75 | run: | | |
| 66 | 76 | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)" | |
| 67 | 77 | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONHOME=$(python -c 'import sys; print(sys.prefix)')" | |
| 68 | 78 | ||
| 69 | 79 | - name: Embedding tests | |
| 70 | - run: dotnet test --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/embed_tests/ | ||
| 80 | + run: dotnet test --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/embed_tests/ | ||
| 71 | 81 | env: | |
| 72 | 82 | MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466 | |
| 73 | 83 | ||
| 74 | 84 | - name: Python Tests (Mono) | |
| 75 | - if: ${{ matrix.os != 'windows' }} | ||
| 85 | + if: ${{ matrix.os.category != 'windows' }} | ||
| 76 | 86 | run: pytest --runtime mono | |
| 77 | 87 | ||
| 78 | 88 | # TODO: Run these tests on Windows x86 | |
| 79 | 89 | - name: Python Tests (.NET Core) | |
| 80 | - if: ${{ matrix.platform == 'x64' }} | ||
| 90 | + if: ${{ matrix.os.platform == 'x64' }} | ||
| 81 | 91 | run: pytest --runtime coreclr | |
| 82 | 92 | ||
| 83 | 93 | - name: Python Tests (.NET Framework) | |
| 84 | - if: ${{ matrix.os == 'windows' }} | ||
| 94 | + if: ${{ matrix.os.category == 'windows' }} | ||
| 85 | 95 | run: pytest --runtime netfx | |
| 86 | 96 | ||
| 87 | 97 | - name: Python tests run from .NET | |
| 88 | - run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/ | ||
| 98 | + run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/ | ||
| 89 | 99 | ||
| 90 | 100 | - name: Perf tests | |
| 91 | - if: ${{ (matrix.python == '3.8') && (matrix.platform == 'x64') }} | ||
| 101 | + if: ${{ (matrix.python == '3.8') && (matrix.os.platform == 'x64') }} | ||
| 92 | 102 | run: | | |
| 93 | 103 | pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2 | |
| 94 | - dotnet test --configuration Release --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/perf_tests/ | ||
| 104 | + dotnet test --configuration Release --runtime any-${{ matrix.os.platform }} --logger "console;verbosity=detailed" src/perf_tests/ | ||
| 95 | 105 | ||
| 96 | 106 | # TODO: Run mono tests on Windows? | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,3 +86,4 @@ | |||
| 86 | 86 | - ([@gpetrou](https://github.com/gpetrou)) | |
| 87 | 87 | - Ehsan Iran-Nejad ([@eirannejad](https://github.com/eirannejad)) | |
| 88 | 88 | - ([@legomanww](https://github.com/legomanww)) | |
| 89 | + - ([@gertdreyer](https://github.com/gertdreyer)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,10 +9,21 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 9 | 9 | ||
| 10 | 10 | ### Added | |
| 11 | 11 | ||
| 12 | + - Added `ToPythonAs<T>()` extension method to allow for explicit conversion using a specific type. ([#2311][i2311]) | ||
| 13 | + | ||
| 14 | + - Added `IComparable` and `IEquatable` implementations to `PyInt`, `PyFloat`, and `PyString` | ||
| 15 | + to compare with primitive .NET types like `long`. | ||
| 16 | + | ||
| 12 | 17 | ### Changed | |
| 18 | + - Added a `FormatterFactory` member in RuntimeData to create formatters with parameters. For compatibility, the `FormatterType` member is still present and has precedence when defining both `FormatterFactory` and `FormatterType` | ||
| 19 | + - Added a post-serialization and a pre-deserialization step callbacks to extend (de)serialization process | ||
| 20 | + - Added an API to stash serialized data on Python capsules | ||
| 13 | 21 | ||
| 14 | 22 | ### Fixed | |
| 15 | 23 | ||
| 24 | + - Fixed RecursionError for reverse operators on C# operable types from python. See #2240 | ||
| 25 | + - Fixed crash when .NET event has no `AddMethod` | ||
| 26 | + - Fixed probing for assemblies in `sys.path` failing when a path in `sys.path` has invalid characters. See #2376 | ||
| 16 | 27 | ||
| 17 | 28 | ## [3.0.3](https://github.com/pythonnet/pythonnet/releases/tag/v3.0.3) - 2023-10-11 | |
| 18 | 29 | ||
@@ -959,3 +970,4 @@ This version improves performance on benchmarks significantly compared to 2.3. | |||
| 959 | 970 | [i238]: https://github.com/pythonnet/pythonnet/issues/238 | |
| 960 | 971 | [i1481]: https://github.com/pythonnet/pythonnet/issues/1481 | |
| 961 | 972 | [i1672]: https://github.com/pythonnet/pythonnet/pull/1672 | |
| 973 | + [i2311]: https://github.com/pythonnet/pythonnet/issues/2311 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,6 +185,15 @@ public void RawPyObjectProxy() | |||
| 185 | 185 | Assert.AreEqual(pyObject.DangerousGetAddressOrNull(), proxiedHandle); | |
| 186 | 186 | } | |
| 187 | 187 | ||
| 188 | + [Test] | ||
| 189 | + public void GenericToPython() | ||
| 190 | + { | ||
| 191 | + int i = 42; | ||
| 192 | + var pyObject = i.ToPythonAs<IConvertible>(); | ||
| 193 | + var type = pyObject.GetPythonType(); | ||
| 194 | + Assert.AreEqual(nameof(IConvertible), type.Name); | ||
| 195 | + } | ||
| 196 | + | ||
| 188 | 197 | // regression for https://github.com/pythonnet/pythonnet/issues/451 | |
| 189 | 198 | [Test] | |
| 190 | 199 | public void CanGetListFromDerivedClass() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments