Skip to content

Commit 3c5c5b5

Browse files
authored
* .NET 7.0 * Get test_int passing * Get test_methodbinder1 passing * Get test_cliclass passing * Disable SYSLIB warnings * Add IsolationLevel=PROCESS to test_re_stdlib * Update to .NET 7.0 release * Add checked for CA2020 * Don't include preview releases
1 parent b821600 commit 3c5c5b5

21 files changed

Lines changed: 108 additions & 30 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ dotnet_diagnostic.CA5350.severity = suggestion # CA5350: Do Not Use Weak Crypto
9595
dotnet_diagnostic.CA5351.severity = suggestion # CA5351: Do Not Use Broken Cryptographic Algorithms
9696
dotnet_diagnostic.CA5359.severity = suggestion # CA5359: Do Not Disable Certificate Validation
9797
dotnet_diagnostic.CA5372.severity = suggestion # CA5372: Use XmlReader For XPathDocument
98+
99+
dotnet_diagnostic.SYSLIB1045.severity = suggestion # SYSLIB1045: Use 'RegexGeneratorAttribute' to generate the regular expression implementation at compile-time
100+
dotnet_diagnostic.SYSLIB1054.severity = suggestion # SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
uses: actions/setup-dotnet@v1
2828
with:
2929
dotnet-version: '6.0.x'
30+
- name: Setup .NET 7.0
31+
uses: actions/setup-dotnet@v1
32+
with:
33+
dotnet-version: '7.0.x'
3034
- name: Version Information
3135
run: |
3236
dotnet --info
@@ -50,3 +54,6 @@ jobs:
5054
- name: Test (net6.0)
5155
run: ./make.ps1 -frameworks net6.0 test-all
5256
shell: pwsh
57+
- name: Test (net7.0)
58+
run: ./make.ps1 -frameworks net7.0 test-all
59+
shell: pwsh

Build/net7.0-windows.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
4+
<IntermediateOutputPath Condition=" '$(TargetFramework)' == 'net7.0-windows' ">$(BaseIntermediateOutputPath)$(Configuration)\net7.0</IntermediateOutputPath>
5+
<OutputPath Condition=" '$(TargetFramework)' == 'net7.0-windows' ">$(BaseOutputPath)\net7.0</OutputPath>
6+
</PropertyGroup>
7+
8+
<Import Project="net7.0.props" />
9+
</Project>

Build/net7.0.props

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<IsFullFramework>false</IsFullFramework>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<Features>$(Features);FEATURE_APARTMENTSTATE</Features>
9+
<Features>$(Features);FEATURE_ASSEMBLY_GETFORWARDEDTYPES</Features>
10+
<Features>$(Features);FEATURE_ASSEMBLY_RESOLVE</Features>
11+
<Features>$(Features);FEATURE_ASSEMBLYBUILDER_DEFINEDYNAMICASSEMBLY</Features>
12+
<Features>$(Features);FEATURE_BASIC_CONSOLE</Features>
13+
<Features>$(Features);FEATURE_CODEDOM</Features>
14+
<Features>$(Features);FEATURE_COM</Features>
15+
<Features>$(Features);FEATURE_CONFIGURATION</Features>
16+
<Features>$(Features);FEATURE_CTYPES</Features>
17+
<Features>$(Features);FEATURE_CUSTOM_TYPE_DESCRIPTOR</Features>
18+
<Features>$(Features);FEATURE_EXCEPTION_STATE</Features>
19+
<Features>$(Features);FEATURE_FILESYSTEM</Features>
20+
<Features>$(Features);FEATURE_FULL_CONSOLE</Features>
21+
<Features>$(Features);FEATURE_FULL_CRYPTO</Features>
22+
<Features>$(Features);FEATURE_FULL_NET</Features>
23+
<Features>$(Features);FEATURE_LCG</Features>
24+
<Features>$(Features);FEATURE_LOADWITHPARTIALNAME</Features>
25+
<Features>$(Features);FEATURE_METADATA_READER</Features>
26+
<Features>$(Features);FEATURE_MMAP</Features>
27+
<Features>$(Features);FEATURE_NATIVE</Features>
28+
<Features>$(Features);FEATURE_OSPLATFORMATTRIBUTE</Features>
29+
<Features>$(Features);FEATURE_PIPES</Features>
30+
<Features>$(Features);FEATURE_PROCESS</Features>
31+
<Features>$(Features);FEATURE_REFEMIT</Features>
32+
<Features>$(Features);FEATURE_REGISTRY</Features>
33+
<Features>$(Features);FEATURE_RUNTIMEINFORMATION</Features>
34+
<Features>$(Features);FEATURE_SECURITY_RULES</Features>
35+
<Features>$(Features);FEATURE_SERIALIZATION</Features>
36+
<Features>$(Features);FEATURE_STACK_TRACE</Features>
37+
<Features>$(Features);FEATURE_SYNC_SOCKETS</Features>
38+
<Features>$(Features);FEATURE_THREAD</Features>
39+
<Features>$(Features);FEATURE_XMLDOC</Features>
40+
</PropertyGroup>
41+
</Project>

Build/steps.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ steps:
3131
version: '3.1.x'
3232

3333
- task: UseDotNet@2
34-
displayName: Install .NET 6.0 SDK for build
34+
displayName: Install .NET 6.0 runtime for testing
3535
inputs:
36-
packageType: 'sdk'
36+
packageType: 'runtime'
3737
version: '6.0.x'
3838

39+
- task: UseDotNet@2
40+
displayName: Install .NET 7.0 SDK for build
41+
inputs:
42+
packageType: 'sdk'
43+
version: '7.0.x'
44+
3945
# Set Mono version on macOS
4046
- ${{ if eq(parameters.os, 'macOS') }}:
4147
- task: Bash@3

IronPython.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{17737ACB
3737
Build\net462.props = Build\net462.props
3838
Build\net6.0-windows.props = Build\net6.0-windows.props
3939
Build\net6.0.props = Build\net6.0.props
40+
Build\net7.0-windows.props = Build\net7.0-windows.props
41+
Build\net7.0.props = Build\net7.0.props
42+
Build\netcoreapp3.1.props = Build\netcoreapp3.1.props
4043
Build\netstandard2.0.props = Build\netstandard2.0.props
4144
Build\steps.yml = Build\steps.yml
4245
Build\Tasks.Targets = Build\Tasks.Targets

Src/IronPython.Modules/IronPython.Modules.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0</TargetFrameworks>
55
<BaseAddress>885063680</BaseAddress>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

Src/IronPython.Modules/_overlapped.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static class PythonOverlapped {
2222
private static extern IntPtr _CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, uint NumberOfConcurrentThreads);
2323

2424
public static BigInteger CreateIoCompletionPort(BigInteger handle, BigInteger port, BigInteger key, int concurrency) {
25-
var res = _CreateIoCompletionPort((IntPtr)(long)handle, (IntPtr)(long)port, (UIntPtr)(ulong)key, (uint)concurrency);
25+
var res = _CreateIoCompletionPort(checked((IntPtr)(long)handle), checked((IntPtr)(long)port), checked((UIntPtr)(ulong)key), (uint)concurrency);
2626
if (res == IntPtr.Zero) {
2727
throw PythonNT.GetLastWin32Error();
2828
}

Src/IronPython.Modules/_socket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ public string __repr__(CodeContext context) {
862862
/// </summary>
863863
internal static Socket? HandleToSocket(Int64 handle) {
864864
lock (_handleToSocket) {
865-
if (_handleToSocket.TryGetValue((IntPtr)handle, out WeakReference? weakref)) {
865+
if (_handleToSocket.TryGetValue(checked((IntPtr)handle), out WeakReference? weakref)) {
866866
return weakref.Target as Socket;
867867
}
868868
}

Src/IronPython.Modules/_winapi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static class PythonWinApi {
2626
throw new NotImplementedException();
2727
}
2828
else {
29-
var result = ConnectNamedPipe((IntPtr)(long)handle, IntPtr.Zero);
29+
var result = ConnectNamedPipe(checked((IntPtr)(long)handle), IntPtr.Zero);
3030

3131
if (!result) throw PythonNT.GetLastWin32Error();
3232

0 commit comments

Comments
 (0)