Skip to content

Commit

Permalink
Drop .NET Core 3.1 (#1741)
Browse files Browse the repository at this point in the history
* Drop .NET Core 3.1

* Fix interop tests

* Fix sqlite3 test

* Try ubuntu-latest

* Bump to ubuntu-latest

* Update readme
  • Loading branch information
slozier authored Sep 15, 2023
1 parent 72f4268 commit f7298e5
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 96 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ dotnet_diagnostic.CA1846.severity = none # CA1846: Prefer 'AsSpan' over '
dotnet_diagnostic.CA1847.severity = none # CA1847: Use char literal for a single character lookup
dotnet_diagnostic.CA1852.severity = suggestion # CA1852: Seal internal types
dotnet_diagnostic.CA1859.severity = suggestion # CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1861.severity = suggestion # CA1861: Avoid constant arrays as arguments
dotnet_diagnostic.CA2101.severity = suggestion # CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2201.severity = none # CA2201: Do not raise reserved exception types
dotnet_diagnostic.CA2208.severity = suggestion # CA2208: Instantiate argument exceptions correctly
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-20.04, macos-latest]
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- name: Install tools
if: matrix.os == 'ubuntu-20.04'
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get -yq install mono-vbnc dos2unix
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup .NET Core 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1.x'
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
Expand All @@ -48,9 +44,6 @@ jobs:
- name: Test (net462)
run: ./make.ps1 -frameworks net462 test-all
shell: pwsh
- name: Test (netcoreapp2.1)
run: ./make.ps1 -frameworks netcoreapp2.1 test-all
shell: pwsh
- name: Test (netcoreapp3.1)
run: ./make.ps1 -frameworks netcoreapp3.1 test-all
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
displayName: Linux (Ubuntu)
timeoutInMinutes: 180
pool:
vmImage: ubuntu-20.04
vmImage: ubuntu-latest
steps:
- template: Build/steps.yml
parameters:
Expand Down
9 changes: 2 additions & 7 deletions Build/After.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
</Choose>

<PropertyGroup>
<_TargetFramework>$(TargetFramework)</_TargetFramework>
<_TargetFramework Condition=" $(TargetFramework.EndsWith('-windows')) ">$(TargetFramework.Substring(0, $(TargetFramework.IndexOf('-windows'))))</_TargetFramework>
<_TargetFramework>$(TargetFramework.Replace('-windows', ''))</_TargetFramework>
<MainStageDir>$(StageDir)\$(_TargetFramework)</MainStageDir>
<MainStageDir Condition=" '$(StoreInDLLs)' == 'true' ">$(StageDir)\$(_TargetFramework)\DLLs</MainStageDir>
<UnsignedItems>@(StageItem)</UnsignedItems>
Expand All @@ -44,9 +43,5 @@
<Copy SourceFiles="$(UnsignedItems)" DestinationFolder="$(MainStageDir)" />
</Target>

<Target Name="_StoreInDLLs" Condition=" '$(StoreInDLLs)' == 'true' ">
<Move SourceFiles="@(StageItem)" DestinationFolder="$(TargetDir)%(StageItem.RecursiveDir)DLLs" />
</Target>

<Target Name="Stage" DependsOnTargets="_LateStage;_MainStage;_StoreInDLLs" />
<Target Name="Stage" DependsOnTargets="_LateStage;_MainStage" />
</Project>
6 changes: 0 additions & 6 deletions Build/steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ steps:
Write-Host ("##vso[task.setvariable variable=PackageVersion;isSecret=false;isOutput=true;]$PackageVersion")
displayName: Grab Package Version
- task: UseDotNet@2
displayName: Install .NET Core 2.1 runtime for testing
inputs:
packageType: 'runtime'
version: '2.1.x'

- task: UseDotNet@2
displayName: Install .NET Core 3.1 runtime for testing
inputs:
Expand Down
2 changes: 0 additions & 2 deletions IronPython.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{17737ACB
Build\net462.props = Build\net462.props
Build\net6.0-windows.props = Build\net6.0-windows.props
Build\net6.0.props = Build\net6.0.props
Build\netcoreapp2.1.props = Build\netcoreapp2.1.props
Build\netcoreapp3.1.props = Build\netcoreapp3.1.props
Build\netstandard2.0.props = Build\netstandard2.0.props
Build\steps.yml = Build\steps.yml
Build\Tasks.Targets = Build\Tasks.Targets
Expand Down
13 changes: 4 additions & 9 deletions Package/nuget/IronPython.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ This package contains the IronPython interpreter engine.</description>
<group targetFramework="netstandard2.0">
<dependency id="DynamicLanguageRuntime" version="1.3.4" />
<dependency id="System.Memory" version="4.5.5" />
<dependency id="System.Text.Encoding.CodePages" version="4.6.0" />
<dependency id="Microsoft.Win32.Registry" version="4.5.0" />
<dependency id="Mono.Unix" version="7.1.0-final.1.21458.1" />
</group>
<group targetFramework="netcoreapp3.1">
<dependency id="DynamicLanguageRuntime" version="1.3.4" />
<dependency id="System.Text.Encoding.CodePages" version="4.7.0" />
<dependency id="Microsoft.Win32.Registry" version="4.7.0" />
<dependency id="Mono.Unix" version="7.1.0-final.1.21458.1" />
</group>
Expand All @@ -41,9 +36,9 @@ This package contains the IronPython interpreter engine.</description>
</dependencies>
</metadata>
<files>
<file src="**\IronPython*.dll" target="lib" exclude="**\IronPythonTest.dll;**\DLLs\*.dll;netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\IronPython*.pdb" target="lib" exclude="**\IronPythonTest.pdb;**\DLLs\*.pdb;netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\IronPython*.xml" target="lib" exclude="**\IronPythonTest.xml;**\DLLs\*.xml;netcoreapp2.1\**\*;net7.0*\**\*" />
<file src="**\IronPython*.dll" target="lib" exclude="**\IronPythonTest.dll;**\DLLs\*.dll;netcoreapp3.1\**\*;net7.0*\**\*;net8.0*\**\*" />
<file src="**\IronPython*.pdb" target="lib" exclude="**\IronPythonTest.pdb;**\DLLs\*.pdb;netcoreapp3.1\**\*;net7.0*\**\*;net8.0*\**\*" />
<file src="**\IronPython*.xml" target="lib" exclude="**\IronPythonTest.xml;**\DLLs\*.xml;netcoreapp3.1\**\*;net7.0*\**\*;net8.0*\**\*" />
<file src="LICENSE" />
<file src="..\..\..\nuget\README.md" target="" />
<file src="..\..\..\..\Documentation\logo.png" target="" />
Expand Down
2 changes: 1 addition & 1 deletion Package/zip/Zip.Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')"/>

<ItemGroup>
<ZipFiles Include="$(StageDir)\**\*.*" Exclude="$(StageDir)\README.md;$(StageDir)\**\*.pdb;$(StageDir)\netstandard2.0\**\*;$(StageDir)\netcoreapp2.1\**\*;$(StageDir)\net7.0*\**\*" />
<ZipFiles Include="$(StageDir)\**\*.*" Exclude="$(StageDir)\README.md;$(StageDir)\**\*.pdb;$(StageDir)\netstandard2.0\**\*;$(StageDir)\netcoreapp3.1\**\*;$(StageDir)\net7.0*\**\*;$(StageDir)\net8.0*\**\*" />
<ZipFiles Include="README.md" Link="$(MSBuildThisFileDirectory)README.md" />
<ZipFiles Include="scripts/Enter-IronPythonEnvironment.ps1" Link="$(RootDir)Src\Scripts\Enter-IronPythonEnvironment.ps1" />
<ZipFiles Include="scripts/Install-IronPython.ps1" Link="$(RootDir)Src\Scripts\Install-IronPython.ps1" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ Binaries of IronPython 3 can be downloaded from the [release page](https://githu
See the [building document](Documentation/building.md). Since the main development is on Windows, bugs on other platforms may inadvertently be introduced - please report them!

## Supported Platforms
IronPython 3 targets .NET Framework 4.6.2, .NET Standard 2.0, .NET Core 3.1 and .NET 6.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 and .NET 6.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).
6 changes: 1 addition & 5 deletions Src/IronPython.Modules/IronPython.Modules.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
<BaseAddress>885063680</BaseAddress>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -33,10 +33,6 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions Src/IronPython.Modules/signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ public static object getsignal(CodeContext/*!*/ context, int signalnum) {
//Negative Scenarios
if (signalnum < 1 || signalnum > 22) {
throw PythonOps.ValueError("signal number out of range");
} else if (!GetPythonSignalState(context).PySignalToPyHandler.ContainsKey(signalnum)) {
} else if (GetPythonSignalState(context).PySignalToPyHandler.TryGetValue(signalnum, out object value)) {
//Default
return value;
} else {
//Handles the special case of SIG_IGN. This is not really a signal,
//but CPython returns null for it any ways
return null;
} else {
//Default
return GetPythonSignalState(context).PySignalToPyHandler[signalnum];
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions Src/IronPython.SQLite/IronPython.SQLite.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.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>
<NoWarn>$(NoWarn);0168;0169;0414;0618;0649;1587;219;1570</NoWarn>
<StoreInDLLs>true</StoreInDLLs>

<!-- output to DLLs folder -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\DLLs</IntermediateOutputPath>
<OutputPath>$(BaseOutputPath)\$(TargetFramework)\DLLs</OutputPath>
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -18,7 +24,9 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IronPython\IronPython.csproj" />
<ProjectReference Include="..\IronPython\IronPython.csproj" Private="false" />
<ProjectReference Include="..\DLR\Src\Microsoft.Scripting\Microsoft.Scripting.csproj" Private="false" />
<ProjectReference Include="..\DLR\Src\Microsoft.Dynamic\Microsoft.Dynamic.csproj" Private="false" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 9 additions & 2 deletions Src/IronPython.Wpf/IronPython.Wpf.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net462;net6.0-windows</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<StoreInDLLs>true</StoreInDLLs>
<UseWPF>true</UseWPF>

<!-- output to DLLs folder -->
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(BaseOutputPath)\$(TargetFramework.Replace('-windows', ''))\DLLs</OutputPath>
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\IronPython\IronPython.csproj" />
<ProjectReference Include="..\IronPython\IronPython.csproj" Private="false" />
<ProjectReference Include="..\DLR\Src\Microsoft.Scripting\Microsoft.Scripting.csproj" Private="false" />
<ProjectReference Include="..\DLR\Src\Microsoft.Dynamic\Microsoft.Dynamic.csproj" Private="false" />
</ItemGroup>

<ItemGroup Condition=" '$(IsFullFramework)' == 'true' ">
Expand Down
15 changes: 8 additions & 7 deletions Src/IronPython/Hosting/PythonCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public PythonCommandLine() {
protected override string Logo => PythonContext.PythonOptions.Quiet ? null : GetLogoDisplay();

/// <summary>
/// Returns the display look for IronPython.
///
/// The returned string uses This \n instead of Environment.NewLine for it's line seperator
/// Returns the display look for IronPython.
///
/// The returned string uses This \n instead of Environment.NewLine for it's line seperator
/// because it is intended to be outputted through the Python I/O system.
/// </summary>
public static string GetLogoDisplay() {
Expand Down Expand Up @@ -265,6 +265,7 @@ private void InitializeModules() {
if (File.Exists(runner)) {
executable = runner;
} else {
// TODO: was for .NET Core 2.1, can we drop this?
runner = Path.Combine(prefix, name + ".bat");
if (File.Exists(runner)) executable = runner;
}
Expand Down Expand Up @@ -312,7 +313,7 @@ private void InitializeModules() {

/// <summary>
/// Loads any extension DLLs present in sys.prefix\DLLs directory and adds references to them.
///
///
/// This provides an easy drop-in location for .NET assemblies which should be automatically referenced
/// (exposed via import), COM libraries, and pre-compiled Python code.
/// </summary>
Expand Down Expand Up @@ -433,7 +434,7 @@ private void RunStartup() {
/// Attempts to run a single interaction and handle any language-specific
/// exceptions. Base classes can override this and call the base implementation
/// surrounded with their own exception handling.
///
///
/// Returns null if successful and execution should continue, or an exit code.
/// </summary>
private int? TryInteractiveActionWorker() {
Expand All @@ -457,8 +458,8 @@ private void RunStartup() {
}

/// <summary>
/// Parses a single interactive command and executes it.
///
/// Parses a single interactive command and executes it.
///
/// Returns null if successful and execution should continue, or the appropiate exit code.
/// </summary>
private int? RunOneInteraction() {
Expand Down
4 changes: 2 additions & 2 deletions Src/IronPython/IronPython.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0</TargetFrameworks>
<BaseAddress>879755264</BaseAddress>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -65,7 +65,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.0" />
</ItemGroup>

<Import Project="$(AfterTargetFiles)" />
Expand Down
10 changes: 1 addition & 9 deletions Src/IronPython/Runtime/ConversionWrappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ IEnumerator IEnumerable.GetEnumerator() {
#endregion
}

#if NETCOREAPP3_1 // In netcoreapp3.1, IDictionary<K, V> has constraint where K : notnull
#nullable disable warnings
#endif

public class DictionaryGenericWrapper<K, V> : IDictionary<K, V> {
private readonly IDictionary<object?, object?> self;
// PEP 237: int/long unification (GH #52)
Expand Down Expand Up @@ -303,10 +299,6 @@ private static bool IsValidKey32(K key, [NotNullWhen(true)] out object? key32) {
}
}

#if NETCOREAPP3_1
#nullable enable
#endif

public class IEnumeratorOfTWrapper<T> : IEnumerator<T> {
private readonly IEnumerator enumerable;
// PEP 237: int/long unification (GH #52)
Expand All @@ -327,7 +319,7 @@ public T Current {
try {
return (T)current!;
} catch (NullReferenceException nex) {
throw new InvalidCastException(string.Format("Error in IEnumeratorOfTWrapper.Current. Could not cast: from null to {0}", typeof(T).ToString()), nex);
throw new InvalidCastException(string.Format("Error in IEnumeratorOfTWrapper.Current. Could not cast: from null to {0}", typeof(T).ToString()), nex);
} catch (InvalidCastException iex) {
throw new InvalidCastException(string.Format("Error in IEnumeratorOfTWrapper.Current. Could not cast: from {1} to {0}", typeof(T).ToString(), current!.GetType().ToString()), iex);
}
Expand Down
18 changes: 7 additions & 11 deletions Src/IronPythonConsole/IronPythonConsole.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1;net6.0</TargetFrameworks>
<!-- EOL netcoreapp2.1 is used to test netstandard2.0 assemblies -->
<TargetFrameworks>net462;netcoreapp3.1;net6.0</TargetFrameworks>
<!-- EOL netcoreapp3.1 is used to test netstandard2.0 assemblies -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>IronPythonConsole</RootNamespace>
Expand All @@ -20,15 +20,12 @@
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</ProjectReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<Content Include="ipy.bat" Condition=" '$(OS)' == 'Windows_NT' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ipy.sh" Condition=" '$(OS)' == 'Unix' ">
<!-- add reference so it gets copied to the netcoreapp3.1 folder for testing -->
<ProjectReference Include="..\IronPython.SQLite\IronPython.SQLite.csproj" Condition="$(TargetFramework) == 'netcoreapp3.1'">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Content</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ProjectReference>
</ItemGroup>

<ItemGroup Condition=" '$(IsFullFramework)' == 'true' AND !$([MSBuild]::IsOSPlatform('WINDOWS')) ">
Expand All @@ -38,7 +35,6 @@
</ItemGroup>

<ItemGroup Condition=" '$(IsFullFramework)' != 'true' ">
<StageItem Include="ipy.bat" />
<StageItem Include="ipy.sh" />
</ItemGroup>

Expand Down
2 changes: 0 additions & 2 deletions Src/IronPythonConsole/ipy.bat

This file was deleted.

Loading

0 comments on commit f7298e5

Please sign in to comment.