Skip to content
Draft
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ dotnet_diagnostic.CA2211.severity = none # CA2211: Non-constant fields sh
dotnet_diagnostic.CA2219.severity = suggestion # CA2219: Do not raise exceptions in finally clauses
dotnet_diagnostic.CA2229.severity = suggestion # CA2229: Implement serialization constructors
dotnet_diagnostic.CA2249.severity = suggestion # CA2249: Consider using 'string.Contains' instead of 'string.IndexOf'
dotnet_diagnostic.CA2263.severity = none # CA2263: Prefer generic overload when type is known
dotnet_diagnostic.CA3075.severity = suggestion # CA3075: Insecure DTD processing in XML
dotnet_diagnostic.CA5350.severity = suggestion # CA5350: Do Not Use Weak Cryptographic Algorithms
dotnet_diagnostic.CA5351.severity = suggestion # CA5351: Do Not Use Broken Cryptographic Algorithms
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ jobs:
submodules: true

# Setup .NET
- name: Setup .NET 6.0
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '10.0.x'
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup .NET 9.0
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '6.0.x'

# CI debug information
- name: Version Information
Expand Down Expand Up @@ -61,7 +65,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04, macos-14]
framework: ['net462', 'net6.0', 'net8.0']
framework: ['net462', 'net6.0', 'net8.0', 'net10.0']

steps:
# Prerequisites
Expand All @@ -70,18 +74,22 @@ jobs:
submodules: true

# Setup .NET
- name: Setup .NET 6.0
- name: Setup .NET 10.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '10.0.x'
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup .NET 9.0
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '6.0.x'

# Build & Test
- name: Build
Expand Down
12 changes: 12 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ jobs:
osName: Windows
imageName: windows-latest
framework: net8.0
linux_net10_0:
osName: Linux
imageName: ubuntu-22.04
framework: net10.0
macos_net10_0:
osName: macOS
imageName: macOS-14
framework: net10.0
windows_net10_0:
osName: Windows
imageName: windows-latest
framework: net10.0

displayName: Test
timeoutInMinutes: 180
Expand Down
2 changes: 2 additions & 0 deletions IronPython.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{17737ACB
eng\net8.0.props = eng\net8.0.props
eng\net9.0-windows.props = eng\net9.0-windows.props
eng\net9.0.props = eng\net9.0.props
eng\net10.0-windows.props = eng\net10.0-windows.props
eng\net10.0.props = eng\net10.0.props
eng\netstandard2.0.props = eng\netstandard2.0.props
eng\Tasks.Targets = eng\Tasks.Targets
EndProjectSection
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ See the [building document](https://github.com/IronLanguages/ironpython3/wiki/Bu

## Supported Platforms

IronPython 3 targets .NET Framework 4.6.2, .NET Standard 2.0, .NET 6.0 and .NET 8.0. The support for .NET and .NET Core follow the lifecycle defined on [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).
IronPython 3 targets .NET Framework 4.6.2, .NET Standard 2.0, .NET 6.0, .NET 8.0, and .NET 10.0. The support for .NET and .NET Core follow the lifecycle defined on [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).
9 changes: 9 additions & 0 deletions eng/net10.0-windows.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IntermediateOutputPath Condition=" '$(TargetFramework)' == 'net10.0-windows' ">$(BaseIntermediateOutputPath)$(Configuration)\net10.0</IntermediateOutputPath>
<OutputPath Condition=" '$(TargetFramework)' == 'net10.0-windows' ">$(BaseOutputPath)\net10.0</OutputPath>
</PropertyGroup>

<Import Project="net10.0.props" />
</Project>
38 changes: 38 additions & 0 deletions eng/net10.0.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsFullFramework>false</IsFullFramework>
</PropertyGroup>

<PropertyGroup>
<Features>$(Features);FEATURE_APARTMENTSTATE</Features>
<Features>$(Features);FEATURE_ASSEMBLY_GETFORWARDEDTYPES</Features>
<Features>$(Features);FEATURE_ASSEMBLY_RESOLVE</Features>
<Features>$(Features);FEATURE_ASSEMBLYBUILDER_DEFINEDYNAMICASSEMBLY</Features>
<Features>$(Features);FEATURE_CODEDOM</Features>
<Features>$(Features);FEATURE_COM</Features>
<Features>$(Features);FEATURE_CONFIGURATION</Features>
<Features>$(Features);FEATURE_CTYPES</Features>
<Features>$(Features);FEATURE_CUSTOM_TYPE_DESCRIPTOR</Features>
<Features>$(Features);FEATURE_EXCEPTION_STATE</Features>
<Features>$(Features);FEATURE_FILESYSTEM</Features>
<Features>$(Features);FEATURE_FULL_CRYPTO</Features>
<Features>$(Features);FEATURE_FULL_NET</Features>
<Features>$(Features);FEATURE_LCG</Features>
<Features>$(Features);FEATURE_LOADWITHPARTIALNAME</Features>
<Features>$(Features);FEATURE_METADATA_READER</Features>
<Features>$(Features);FEATURE_MMAP</Features>
<Features>$(Features);FEATURE_NATIVE</Features>
<Features>$(Features);FEATURE_OSPLATFORMATTRIBUTE</Features>
<Features>$(Features);FEATURE_PIPES</Features>
<Features>$(Features);FEATURE_PROCESS</Features>
<Features>$(Features);FEATURE_REFEMIT</Features>
<Features>$(Features);FEATURE_REGISTRY</Features>
<Features>$(Features);FEATURE_RUNTIMEINFORMATION</Features>
<Features>$(Features);FEATURE_SECURITY_RULES</Features>
<Features>$(Features);FEATURE_STACK_TRACE</Features>
<Features>$(Features);FEATURE_SYNC_SOCKETS</Features>
<Features>$(Features);FEATURE_THREAD</Features>
<Features>$(Features);FEATURE_XMLDOC</Features>
</PropertyGroup>
</Project>
4 changes: 4 additions & 0 deletions eng/package/nuget/IronPython.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ This package contains the IronPython interpreter engine.</description>
<dependency id="DynamicLanguageRuntime" version="1.3.5" />
<dependency id="Mono.Unix" version="7.1.0-final.1.21458.1" />
</group>
<group targetFramework="net10.0">
<dependency id="DynamicLanguageRuntime" version="1.3.5" />
<dependency id="Mono.Unix" version="7.1.0-final.1.21458.1" />
</group>
</dependencies>
</metadata>
<files>
Expand Down
2 changes: 1 addition & 1 deletion make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Param(
[Parameter(Position=1)]
[String] $target = "build",
[String] $configuration = "Release",
[String[]] $frameworks=@('net462','net6.0','net8.0'),
[String[]] $frameworks=@('net462','net6.0','net8.0','net10.0'),
[String] $platform = $null, # auto-detect
[switch] $runIgnored,
[int] $jobs = [System.Environment]::ProcessorCount
Expand Down
4 changes: 2 additions & 2 deletions src/core/IronPython.Modules/IronPython.Modules.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
<BaseAddress>885063680</BaseAddress>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
31 changes: 27 additions & 4 deletions src/core/IronPython.Modules/_ssl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ public void load_verify_locations(CodeContext context, object cafile = null, str
using IPythonBuffer buf = cabuf.GetBuffer();
var contents = buf.AsReadOnlySpan();
while (contents.Length > 0) {
#if NET
#if NET10_0_OR_GREATER
var cert = X509CertificateLoader.LoadCertificate(contents);
#elif NET
var cert = new X509Certificate2(contents);
#else
var cert = new X509Certificate2(contents.ToArray());
Expand Down Expand Up @@ -449,7 +451,12 @@ public void do_handshake() {
if (_serverSide) {
var _cert = context._cert;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
_cert = new X509Certificate2(_cert.Export(X509ContentType.Pkcs12));
byte[] certData = _cert.Export(X509ContentType.Pkcs12);
#if NET10_0_OR_GREATER
_cert = X509CertificateLoader.LoadCertificate(certData);
#else
_cert = new X509Certificate2(certData);
#endif
}
_sslStream.AuthenticateAsServer(_cert, _certsMode == PythonSsl.CERT_REQUIRED, enabledSslProtocols, false);
} else {
Expand Down Expand Up @@ -527,6 +534,8 @@ private static SslProtocols GetProtocolType(int protocol, int options) {
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5397 // Do not use deprecated SslProtocols values

#pragma warning disable SYSLIB0058 // Certain SslStream properties are obsolete

public PythonTuple cipher() {
if (_sslStream != null && _sslStream.IsAuthenticated) {
return PythonTuple.MakeTuple(
Expand All @@ -540,6 +549,8 @@ public PythonTuple cipher() {

public object compression() => null; // TODO

#pragma warning restore SYSLIB0058 // Certain SslStream properties are obsolete

#pragma warning disable CA5397 // Do not use deprecated SslProtocols values
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable SYSLIB0039 // Type or member is obsolete
Expand Down Expand Up @@ -876,7 +887,14 @@ public static PythonDictionary _test_decode_cert(CodeContext context, string pat
private static PythonDictionary CertificateToPython(CodeContext context, X509Certificate cert) {
if (cert is X509Certificate2 cert2)
return CertificateToPython(context, cert2);
return CertificateToPython(context, new X509Certificate2(cert.GetRawCertData()));

byte[] certData = cert.GetRawCertData();
#if NET10_0_OR_GREATER
cert2 = X509CertificateLoader.LoadCertificate(certData);
#else
cert2 = new X509Certificate2(certData);
#endif
return CertificateToPython(context, cert2);
}

private static PythonDictionary CertificateToPython(CodeContext context, X509Certificate2 cert) {
Expand Down Expand Up @@ -1030,7 +1048,12 @@ private static X509Certificate2 ReadCertificate(CodeContext context, string file
var certStr = ReadToEnd(lines, ref i, "-----END CERTIFICATE-----");

try {
cert = new X509Certificate2(Convert.FromBase64String(certStr.ToString()));
byte[] certData = Convert.FromBase64String(certStr.ToString());
#if NET10_0_OR_GREATER
cert = X509CertificateLoader.LoadCertificate(certData);
#else
cert = new X509Certificate2(certData);
#endif
} catch (Exception e) {
throw ErrorDecoding(context, filename, e);
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/IronPython.Modules/fcntl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ public static object fcntl(CodeContext context, object? fd, int cmd, [Optional]
//
// int ioctl(int, unsigned long, ...)
//
// but .NET, as of Jan 2025, still does not support varargs in P/Invoke [1]
// but .NET, as of Jan 2026, still does not support varargs in P/Invoke [1]
// so as a workaround, nonvararg prototypes are defined for each architecture.
// [1]: https://github.com/dotnet/runtime/issues/48796

#if NET10_0_OR_GREATER
#if NET11_0_OR_GREATER
#error Check if this version of .NET supports P/Invoke of variadic functions; if not, change the condition to recheck at next major .NET version
#endif

Expand Down
6 changes: 3 additions & 3 deletions src/core/IronPython/IronPython.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
<BaseAddress>879755264</BaseAddress>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(IsFullFramework)' == 'true' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/core/IronPython/Runtime/Importer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,9 @@ private static bool IsReflected(object module) {

private static string CreateFullName(string/*!*/ baseName, ArraySegment<string> parts) {
if (baseName == null || baseName.Length == 0 || baseName == "__main__") {
return string.Join(".", parts);
return string.Join(".", (IEnumerable<string>)parts);
}
return baseName + "." + string.Join(".", parts);
return baseName + "." + string.Join(".", (IEnumerable<string>)parts);
}

#endregion
Expand Down
4 changes: 2 additions & 2 deletions src/executables/IronPython.Console/IronPython.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net8.0;net10.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>IronPython.Console</RootNamespace>
<AssemblyName>ipy</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net8.0;net10.0</TargetFrameworks>
<PlatformTarget>x86</PlatformTarget>
<OutputType>Exe</OutputType>
<RootNamespace>IronPython.Console32</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/IronPython.SQLite/IronPython.SQLite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0;net10.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SQLiteCommon>SQLITE_DEBUG;TRUE;WIN32;_MSC_VER;SQLITE_ASCII;SQLITE_MEM_POOL;SQLITE_ENABLE_COLUMN_METADATA;SQLITE_OS_WIN;SQLITE_SYSTEM_MALLOC;VDBE_PROFILE_OFF</SQLiteCommon>
<SQLiteCommonOmit>SQLITE_OMIT_AUTHORIZATION;SQLITE_OMIT_DEPRECATED;SQLITE_OMIT_GET_TABLE;SQLITE_OMIT_INCRBLOB;SQLITE_OMIT_LOOKASIDE;SQLITE_OMIT_SHARED_CACHE;SQLITE_OMIT_UTF16;SQLITE_OMIT_WAL</SQLiteCommonOmit>
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/IronPython.Wpf/IronPython.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net462;net6.0-windows;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net462;net6.0-windows;net8.0-windows;net10.0-windows</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<StoreInDLLs>true</StoreInDLLs>
<UseWPF>true</UseWPF>
Expand Down
3 changes: 1 addition & 2 deletions tests/IronPython.Tests/AttrInjectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public static object GetBoundMember(object obj, string name) {
} else {
return n;
}

}
}
}
Expand All @@ -59,4 +58,4 @@ public static object GetBoundMember(object obj, string name) {

}
}
}
}
4 changes: 2 additions & 2 deletions tests/IronPython.Tests/IronPython.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net8.0;net10.0</TargetFrameworks>
<AssemblyName>IronPythonTest</AssemblyName>
<PreventStaging>true</PreventStaging>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/interop/net/type/test_reachtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_generic_types(self):
self.assertEqual(G2[int, int].A, 40)

self.assertRaisesRegex(ValueError,
re.compile(r"(?s)The number of generic arguments provided doesn't equal the arity of the generic type definition\..*Parameter.*instantiation", re.M),
re.compile(r"(?s)The number of generic arguments provided doesn't equal the arity of the generic type definition\..*Parameter.*", re.M),
lambda: G3[()])

if is_mono:
Expand Down
Loading