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
31 changes: 20 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04, macos-14]
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
# Prerequisites
- name: Install tools
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get -yq install mono-vbnc dos2unix
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -yq install dos2unix
- uses: actions/checkout@v6
with:
submodules: true
Expand All @@ -32,11 +32,7 @@ jobs:

# CI debug information
- name: Version Information
run: |
dotnet --info
try { msbuild -version } catch { }
try { mono --version } catch { }
shell: pwsh
run: dotnet --info

# Build & package
- name: Build
Expand All @@ -56,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04, macos-14]
os: [windows-latest, ubuntu-latest, macos-latest]
framework: ['net462', 'net8.0', 'net10.0']
stdlib: ['3.4', '3.6']

Expand Down Expand Up @@ -86,6 +82,16 @@ jobs:
with:
dotnet-version: '8.0.x'

# Setup Mono (the runner images no longer include it)
- name: Install Mono
if: matrix.os != 'windows-latest' && matrix.framework == 'net462'
run: |
if [ "$RUNNER_OS" = Linux ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "$HOMEBREW_PREFIX/bin" >> "$GITHUB_PATH"
fi
brew install mono

# Build & Test
- name: Build
run: pwsh make.ps1
Expand All @@ -101,8 +107,11 @@ jobs:
run: |
$ipy = "bin/Release/${{ matrix.framework }}/ipy"
if ('${{ matrix.framework }}' -ne 'net462') { dotnet "$ipy.dll" -VV }
elseif ($IsWindows) { & "$ipy.exe" -VV }
else { mono "$ipy.exe" -VV }
elseif ('${{ matrix.os }}' -eq 'windows-latest') { & "$ipy.exe" -VV }
else {
mono --version
mono "$ipy.exe" -VV
}
shell: pwsh
- name: Test (${{ matrix.framework }})
run: ./make.ps1 -frameworks ${{ matrix.framework }} test-all
Expand Down
43 changes: 28 additions & 15 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ jobs:
matrix:
linux:
osName: 'Linux'
imageName: 'ubuntu-22.04'
imageName: 'ubuntu-latest'
mac:
osName: 'macOS'
imageName: 'macOS-14'
imageName: 'macOS-latest'
windows:
osName: 'Windows'
imageName: 'windows-latest'
Expand Down Expand Up @@ -38,14 +38,8 @@ jobs:
version: '10.0.x'

# Display version info
- task: PowerShell@2
- script: dotnet --info
displayName: Version Information
inputs:
targetType: inline
script: |
dotnet --info
try { msbuild -version } catch { }
try { mono --version } catch { }

# Build & Package
- powershell: ./make.ps1
Expand Down Expand Up @@ -86,19 +80,19 @@ jobs:
matrix:
linux_net462:
osName: Linux
imageName: ubuntu-22.04
imageName: ubuntu-latest
framework: net462
linux_net8_0:
osName: Linux
imageName: ubuntu-22.04
imageName: ubuntu-latest
framework: net8.0
macos_net462:
osName: macOS
imageName: macOS-14
imageName: macOS-latest
framework: net462
macos_net8_0:
osName: macOS
imageName: macOS-14
imageName: macOS-latest
framework: net8.0
windows_net462:
osName: Windows
Expand All @@ -110,11 +104,11 @@ jobs:
framework: net8.0
linux_net10_0:
osName: Linux
imageName: ubuntu-22.04
imageName: ubuntu-latest
framework: net10.0
macos_net10_0:
osName: macOS
imageName: macOS-14
imageName: macOS-latest
framework: net10.0
windows_net10_0:
osName: Windows
Expand Down Expand Up @@ -144,6 +138,16 @@ jobs:
version: '8.0.x'
condition: eq(variables.framework, 'net8.0')

# Setup Mono (the runner images no longer include it)
- bash: |
if [ "$(osName)" = Linux ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "##vso[task.prependpath]$HOMEBREW_PREFIX/bin"
fi
brew install mono
displayName: Install Mono
condition: and(ne(variables.osName, 'Windows'), eq(variables.framework, 'net462'))

# Build & Test
- powershell: ./make.ps1
displayName: Build
Expand All @@ -153,6 +157,15 @@ jobs:
- powershell: ./make.ps1 -frameworks $(framework) readytorun
displayName: ReadyToRun
condition: and(succeeded(), ne(variables.framework, 'net462'))
- powershell: |
$ipy = "bin/Release/$(framework)/ipy"
if ('$(framework)' -ne 'net462') { dotnet "$ipy.dll" -VV }
elseif ('$(osName)' -eq 'Windows') { & "$ipy.exe" -VV }
else {
mono --version
mono "$ipy.exe" -VV
}
displayName: Version Information ($(framework))
- powershell: ./make.ps1 -frameworks $(framework) test-all
displayName: Test ($(framework))

Expand Down
27 changes: 15 additions & 12 deletions src/core/IronPython/Lib/iptest/process_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,30 @@ def has_ilasm(self):
self.__has_ilasm = True
return self.__has_ilasm

def run_csc(self, args):
def find_mono_tool(self, name):
import shutil
path = shutil.which(name)
if path:
return path
if is_osx:
return self.run_tool("/Library/Frameworks/Mono.framework/Versions/Current/Commands/mcs", args)
elif is_posix:
return self.run_tool("/usr/bin/mcs", args)
return os.path.join("/Library/Frameworks/Mono.framework/Versions/Current/Commands", name)
return os.path.join("/usr/bin", name)

def run_csc(self, args):
if is_posix:
return self.run_tool(self.find_mono_tool("mcs"), args)
else:
return self.run_tool(os.path.join(self.get_clr_dir(),"csc.exe"), args)

def run_vbc(self, args):
if is_osx:
return self.run_tool("/Library/Frameworks/Mono.framework/Versions/Current/Commands/vbnc", args)
elif is_posix:
return self.run_tool("/usr/bin/vbnc", args)
if is_posix:
return self.run_tool(self.find_mono_tool("vbnc"), args)
else:
return self.run_tool(os.path.join(self.get_clr_dir(),"vbc.exe"), args)

def run_ilasm(self, args):
if is_osx:
return self.run_tool("/Library/Frameworks/Mono.framework/Versions/Current/Commands/ilasm", args)
elif is_posix:
return self.run_tool("/usr/bin/ilasm", args)
if is_posix:
return self.run_tool(self.find_mono_tool("ilasm"), args)
else:
return self.run_tool(os.path.join(self.get_clr_dir(),"ilasm.exe"), args)

Expand Down
6 changes: 2 additions & 4 deletions tests/suite/test_clrload.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ def test_gac(self):
import System
def get_gac():
process = System.Diagnostics.Process()
if is_osx:
process.StartInfo.FileName = "/Library/Frameworks/Mono.framework/Versions/Current/Commands/gacutil"
elif is_posix:
process.StartInfo.FileName = "/usr/bin/gacutil"
if is_posix:
process.StartInfo.FileName = self.find_mono_tool("gacutil")
else:
process.StartInfo.FileName = System.IO.Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), "gacutil.exe")
process.StartInfo.Arguments = "/nologo /l"
Expand Down
6 changes: 5 additions & 1 deletion tests/suite/test_methoddispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,13 @@ def test_enumerator_conversions(self):
self.assertRaises(TypeError, cd.ObjectEnumerator, seq)
self.assertRaises(TypeError, cd.NonGenericEnumerator, seq)

def test_property_conversions(self):
def test_property_conversions_cp24802(self):
# cp24802: assigning a float to a Single property narrows like a method call
import System
from IronPythonTest import Dispatch
d = Dispatch()
d.P01 = System.Single(3.14)
self.assertEqual(d.P01, System.Single(3.14))
d.P01 = 2.0
self.assertEqual(d.P01, 2.0)

Expand Down
12 changes: 0 additions & 12 deletions tests/suite/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,6 @@ def f(a=None):
self.assertRaisesRegex(TypeError, "f\(\) got multiple values for keyword argument 'a'",
lambda: f(a=1, **{"a": 3}))

@unittest.skipIf(is_netcoreapp, 'requires System.Drawing.Common dependency')
@skipUnlessIronPython()
def test_cp24802(self):
import clr
clr.AddReference('System.Drawing')
import System
p = System.Drawing.Pen(System.Drawing.Color.Blue)
p.Width = System.Single(3.14)
self.assertEqual(p.Width, System.Single(3.14))
p.Width = 4.0
self.assertEqual(p.Width, 4.0)


def test_cp23822(self):
from copy import deepcopy
Expand Down
Loading