Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 0 additions & 41 deletions .github/workflows/ci-arm.yml

This file was deleted.

24 changes: 18 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
- uses: actions/setup-dotnet@v5
- uses: astral-sh/setup-uv@v6
- name: Build
run: uv build
Expand Down Expand Up @@ -41,17 +41,27 @@ jobs:
runs-on: ${{ matrix.os }}
needs: build
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-13]
python: ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] # pypy3
# macos-13-arm64, windows-11-arm
# TODO:
# - Install mono via install-package action
# - Update macos images to at least 14 as 13 is retired
# - Update ubuntu images
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-13]
python: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] # pypy3

steps:
- uses: actions/checkout@v4
- name: Set Environment on macOS
uses: maxim-lobanov/setup-xamarin@v1
if: ${{ matrix.os.category == 'macos' }}
with:
mono-version: latest

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v5
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'

- name: Set up Python ${{ matrix.python }}
uses: astral-sh/setup-uv@v6
Expand All @@ -70,6 +80,8 @@ jobs:
run: |
choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }}

- uses: actions/checkout@v4

- name: Install dependencies
run: |
uv venv
Expand Down
Empty file added clr_loader/py.typed
Empty file.
2 changes: 1 addition & 1 deletion clr_loader/util/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def find_runtimes() -> Iterator[DotnetCoreRuntimeSpec]:
return find_runtimes_in_root(dotnet_root)


def find_libmono(*, assembly_dir: str = None, sgen: bool = True) -> Path:
def find_libmono(*, assembly_dir: Optional[str] = None, sgen: bool = True) -> Path:
"""Find a suitable libmono dynamic library

On Windows and macOS, we check the default installation directories.
Expand Down
16 changes: 16 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "nuget"
directory: "netfx_loader/"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion example/example.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net60;netstandard20</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion netfx_loader/ClrLoader.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net47</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Documentation = "https://pythonnet.github.io/clr-loader/"

[dependency-groups]
dev = [
"pytest"
"pytest>=7.0"
]

[tool.setuptools]
Expand Down
18 changes: 9 additions & 9 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@


@pytest.fixture(scope="session")
def example_netstandard(tmpdir_factory):
return build_example(tmpdir_factory, "netstandard20")
def example_netstandard(tmp_path_factory: pytest.TempPathFactory) -> Path:
return build_example(tmp_path_factory, "netstandard2.0")


@pytest.fixture(scope="session")
def example_netcore(tmpdir_factory):
return build_example(tmpdir_factory, "net60")
def example_netcore(tmp_path_factory: pytest.TempPathFactory) -> Path:
return build_example(tmp_path_factory, "net8.0")


def build_example(tmpdir_factory, framework):
out = Path(tmpdir_factory.mktemp(f"example-{framework}"))
def build_example(tmp_path_factory: pytest.TempPathFactory, framework: str) -> Path:
out = tmp_path_factory.mktemp(f"example-{framework}")
proj_path = Path(__file__).parent.parent / "example" / "example.csproj"

check_call(["dotnet", "build", str(proj_path), "-o", str(out), "-f", framework])
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_mono_trace_level(example_netstandard: Path):
def test_mono_set_dir(example_netstandard: Path):
from clr_loader import get_mono

mono = get_mono(assembly_dir="/usr/lib", config_dir="/etc")
mono = get_mono(assembly_dir="/usr", config_dir="/etc")
asm = mono.get_assembly(example_netstandard / "example.dll")

run_tests(asm)
Expand All @@ -96,7 +96,7 @@ def test_coreclr_command_line(example_netcore: Path):
run_in_subprocess(_do_test_coreclr_command_line, example_netcore)


def _do_test_coreclr_command_line(example_netcore):
def _do_test_coreclr_command_line(example_netcore: Path):
from clr_loader import get_coreclr_command_line

coreclr = get_coreclr_command_line(entry_dll=example_netcore / "example.dll")
Expand All @@ -118,7 +118,7 @@ def test_coreclr_autogenerated_runtimeconfig(example_netstandard: Path):


def _do_test_coreclr_autogenerated_runtimeconfig(
example_netstandard: Path, **properties
example_netstandard: Path, **properties: str
):
from clr_loader import get_coreclr

Expand Down
Loading
Loading