Skip to content

Commit 816970c

Browse files
authored
Add dependabot file and update CI (#83)
* Add dependabot file and update CI * Add typed marker * Type tests, use newer pytest tmp_path, use net8.0 * Adjust target images * Reorder and explicitly switch mono * Fix type hint and adjust test * Downgrade to last version that has mono installed * Remove currently not working platforms
1 parent cf0ba00 commit 816970c

File tree

10 files changed

+283
-179
lines changed

10 files changed

+283
-179
lines changed

.github/workflows/ci-arm.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
15-
- uses: actions/setup-dotnet@v1
15+
- uses: actions/setup-dotnet@v5
1616
- uses: astral-sh/setup-uv@v6
1717
- name: Build
1818
run: uv build
@@ -41,17 +41,27 @@ jobs:
4141
runs-on: ${{ matrix.os }}
4242
needs: build
4343
strategy:
44+
fail-fast: false
4445
matrix:
45-
os: [ubuntu-22.04, windows-latest, macos-13]
46-
python: ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] # pypy3
46+
# macos-13-arm64, windows-11-arm
47+
# TODO:
48+
# - Install mono via install-package action
49+
# - Update macos images to at least 14 as 13 is retired
50+
# - Update ubuntu images
51+
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-13]
52+
python: ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8'] # pypy3
4753

4854
steps:
49-
- uses: actions/checkout@v4
55+
- name: Set Environment on macOS
56+
uses: maxim-lobanov/setup-xamarin@v1
57+
if: ${{ matrix.os.category == 'macos' }}
58+
with:
59+
mono-version: latest
5060

5161
- name: Setup .NET
52-
uses: actions/setup-dotnet@v1
62+
uses: actions/setup-dotnet@v5
5363
with:
54-
dotnet-version: '6.0.x'
64+
dotnet-version: '8.0.x'
5565

5666
- name: Set up Python ${{ matrix.python }}
5767
uses: astral-sh/setup-uv@v6
@@ -70,6 +80,8 @@ jobs:
7080
run: |
7181
choco install -y mono ${{ matrix.python == 'pypy3' && '--x86' || '' }}
7282
83+
- uses: actions/checkout@v4
84+
7385
- name: Install dependencies
7486
run: |
7587
uv venv

clr_loader/py.typed

Whitespace-only changes.

clr_loader/util/find.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def find_runtimes() -> Iterator[DotnetCoreRuntimeSpec]:
105105
return find_runtimes_in_root(dotnet_root)
106106

107107

108-
def find_libmono(*, assembly_dir: str = None, sgen: bool = True) -> Path:
108+
def find_libmono(*, assembly_dir: Optional[str] = None, sgen: bool = True) -> Path:
109109
"""Find a suitable libmono dynamic library
110110
111111
On Windows and macOS, we check the default installation directories.

dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "nuget"
14+
directory: "netfx_loader/"
15+
schedule:
16+
interval: "weekly"

example/example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net60;netstandard20</TargetFrameworks>
3+
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
44
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
55
</PropertyGroup>
66
<ItemGroup>

netfx_loader/ClrLoader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net47</TargetFrameworks>
3+
<TargetFrameworks>net472</TargetFrameworks>
44
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
55
</PropertyGroup>
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Documentation = "https://pythonnet.github.io/clr-loader/"
3737

3838
[dependency-groups]
3939
dev = [
40-
"pytest"
40+
"pytest>=7.0"
4141
]
4242

4343
[tool.setuptools]

tests/test_common.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77

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

1212

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

1717

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

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

80-
mono = get_mono(assembly_dir="/usr/lib", config_dir="/etc")
80+
mono = get_mono(assembly_dir="/usr", config_dir="/etc")
8181
asm = mono.get_assembly(example_netstandard / "example.dll")
8282

8383
run_tests(asm)
@@ -96,7 +96,7 @@ def test_coreclr_command_line(example_netcore: Path):
9696
run_in_subprocess(_do_test_coreclr_command_line, example_netcore)
9797

9898

99-
def _do_test_coreclr_command_line(example_netcore):
99+
def _do_test_coreclr_command_line(example_netcore: Path):
100100
from clr_loader import get_coreclr_command_line
101101

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

119119

120120
def _do_test_coreclr_autogenerated_runtimeconfig(
121-
example_netstandard: Path, **properties
121+
example_netstandard: Path, **properties: str
122122
):
123123
from clr_loader import get_coreclr
124124

0 commit comments

Comments
 (0)