Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Drop .NET 5.0 support, add .NET 9.0 support #584

Merged
merged 11 commits into from
Nov 22, 2024
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
33 changes: 17 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Set up dotnet tools
run: make install install-styleguide
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Set up dotnet tools
run: make install install-styleguide
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Set up dotnet tools and dependencies
run: make install
Expand All @@ -67,7 +67,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Set up dotnet tools and dependencies
run: make install
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Install docfx
run: make install-tools
Expand All @@ -124,21 +124,21 @@ jobs:
EASYPOST_PROD_API_KEY: "123"
strategy:
matrix:
name: [ 'NetStandard20', 'Net50', 'Net60', 'Net70', 'Net80' ]
name: [ 'NetStandard20', 'Net60', 'Net70', 'Net80', 'Net90' ]
include:
- name: NetStandard20
# can't run tests on .NET Standard, it's just a bridge between .NET Framework and .NET.
# So we'll target .NET Framework 4.6.2
# More notes at the bottom of this file
framework: net462
- name: Net50
framework: net5.0
- name: Net60
framework: net6.0
- name: Net70
framework: net7.0
- name: Net80
framework: net8.0
- name: Net90
framework: net9.0
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -147,10 +147,11 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
# .NET 5.0 is deprecated and removed from GitHub Actions, we need to manually install it
dotnet-version: |
5.x.x
6.x.x
7.x.x
8.x.x
9.x.x

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand All @@ -207,7 +208,7 @@ jobs:

# Run the integration tests
- name: Run Tests
run: make integration-test fw=net7.0 # Always run integration tests on the latest framework
run: make integration-test fw=net9.0 # Always run integration tests on the latest framework

FSharp_Compatibility_Tests:
runs-on: windows-2022
Expand All @@ -219,7 +220,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand All @@ -239,7 +240,7 @@ jobs:

# Run the compatibility tests
- name: Run Tests
run: make fs-compat-test fw=net7.0 # Always run compatibility tests on the latest framework
run: make fs-compat-test fw=net9.0 # Always run compatibility tests on the latest framework

Visual_Basic_Compatibility_Test:
runs-on: windows-2022
Expand All @@ -252,7 +253,7 @@ jobs:
- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
dotnet-version: 9.x.x

- name: Setup MSBuild
uses: microsoft/[email protected]
Expand All @@ -272,7 +273,7 @@ jobs:

# Run the compatibility tests
- name: Run Tests
run: make vb-compat-test fw=net7.0 # Always run compatibility tests on the latest framework
run: make vb-compat-test fw=net9.0 # Always run compatibility tests on the latest framework


# .NET Standard notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RootNamespace>EasyPost.Compatibility.FSharp</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.Compatibility.FSharp/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net8.0": {
"net9.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>EasyPost.Compatibility.VB</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion EasyPost.Compatibility.VB/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"dependencies": {
"net8.0": {
"net9.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.Integration/EasyPost.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion EasyPost.Tests/EasyPost.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>

<IsPackable>false</IsPackable>

Expand Down
3 changes: 3 additions & 0 deletions EasyPost.Tests/ExceptionsTests/ExceptionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

namespace EasyPost.Tests.ExceptionsTests
{
#pragma warning disable CA2263
public class ExceptionsTests : UnitTest
{
public ExceptionsTests() : base("exceptions")
Expand All @@ -31,6 +32,7 @@ public async Task TestApiExceptionPrettyPrint()

// Generate a dummy HttpResponseMessage with the given status code to parse
HttpStatusCode httpStatusCode = (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), statusCode.ToString(CultureInfo.InvariantCulture));

HttpResponseMessage response = new() { StatusCode = httpStatusCode };

ApiError generatedError = await ApiError.FromErrorResponse(response);
Expand Down Expand Up @@ -480,4 +482,5 @@ public async Task TestHTTPTimeoutFriendlyException()

#endregion
}
#pragma warning restore CA2263
}
24 changes: 5 additions & 19 deletions EasyPost.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
}
}
},
".NETCoreApp,Version=v5.0": {
"net6.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down Expand Up @@ -375,11 +375,7 @@
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==",
"dependencies": {
"System.Buffers": "4.5.1",
"System.Memory": "4.5.4"
}
"contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
Expand Down Expand Up @@ -426,11 +422,6 @@
"resolved": "5.11.0",
"contentHash": "eaiXkUjC4NPcquGWzAGMXjuxvLwc6XGKMptSyOGQeT0X70BUZObuybJFZLA0OfTdueLd3US23NBPTBb6iF3V1Q=="
},
"System.Buffers": {
"type": "Transitive",
"resolved": "4.5.1",
"contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg=="
},
"System.Diagnostics.DiagnosticSource": {
"type": "Transitive",
"resolved": "6.0.0",
Expand All @@ -439,11 +430,6 @@
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "1.6.0",
Expand Down Expand Up @@ -506,7 +492,7 @@
}
}
},
"net6.0": {
"net7.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down Expand Up @@ -734,7 +720,7 @@
}
}
},
"net7.0": {
"net8.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down Expand Up @@ -962,7 +948,7 @@
}
}
},
"net8.0": {
"net9.0": {
"coverlet.collector": {
"type": "Direct",
"requested": "[3.1.2, 4.0.0)",
Expand Down
14 changes: 7 additions & 7 deletions EasyPost.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
<projectUrl>https://www.easypost.com</projectUrl>
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>EasyPost Shipping API Client Library for .NET https://easypost.com/docs</description>
<tags>EasyPost ShippingAPI USPS UPS FedEx</tags>
<description>EasyPost Shipping API Client Library for .NET https://docs.easypost.com</description>
<tags>EasyPost shipping API USPS UPS FedEx DHL CanadaPost RoyalMail mail package logistics rate insurance</tags>
<readme>docs\README.md</readme>
<releaseNotes>See Release Notes at https://github.com/EasyPost/easypost-csharp/releases</releaseNotes>
<icon>images\icon.png</icon>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="Newtonsoft.Json" version="[13.0.1, 14.0.0)" />
</group>
<group targetFramework="net5.0">
<dependency id="Newtonsoft.Json" version="[13.0.1, 14.0.0)" />
</group>
<group targetFramework="net6.0">
<dependency id="Newtonsoft.Json" version="[13.0.1, 14.0.0)" />
</group>
Expand All @@ -30,19 +27,22 @@
<group targetFramework="net8.0">
<dependency id="Newtonsoft.Json" version="[13.0.1, 14.0.0)" />
</group>
<group targetFramework="net9.0">
<dependency id="Newtonsoft.Json" version="[13.0.1, 14.0.0)" />
</group>
</dependencies>
</metadata>
<files>
<file src="lib\net\netstandard2.0\EasyPost.dll" target="lib\netstandard2.0" />
<file src="lib\net\netstandard2.0\EasyPost.XML" target="lib\netstandard2.0" />
<file src="lib\net\net5.0\EasyPost.dll" target="lib\net5.0" />
<file src="lib\net\net5.0\EasyPost.XML" target="lib\net5.0" />
<file src="lib\net\net6.0\EasyPost.dll" target="lib\net6.0" />
<file src="lib\net\net6.0\EasyPost.XML" target="lib\net6.0" />
<file src="lib\net\net7.0\EasyPost.dll" target="lib\net7.0" />
<file src="lib\net\net7.0\EasyPost.XML" target="lib\net7.0" />
<file src="lib\net\net8.0\EasyPost.dll" target="lib\net8.0" />
<file src="lib\net\net8.0\EasyPost.XML" target="lib\net8.0" />
<file src="lib\net\net9.0\EasyPost.dll" target="lib\net9.0" />
<file src="lib\net\net9.0\EasyPost.XML" target="lib\net9.0" />
<file src="README.md" target="docs\" />
<file src="icon.png" target="images\" />
</files>
Expand Down
2 changes: 1 addition & 1 deletion EasyPost/EasyPost.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Library</OutputType>
Expand Down
7 changes: 5 additions & 2 deletions EasyPost/Parameters/Tracker/CreateList.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
nwithan8 marked this conversation as resolved.
Show resolved Hide resolved
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
Expand All @@ -6,9 +7,10 @@
namespace EasyPost.Parameters.Tracker
{
/// <summary>
/// Parameters for <see cref="EasyPost.Services.TrackerService.CreateList(CreateList, System.Threading.CancellationToken)"/> API calls.
/// This parameter set is no longer used.
/// </summary>
[ExcludeFromCodeCoverage]
[Obsolete("This parameter set is no longer used.")]
public class CreateList : BaseParameters<Models.API.Tracker>, ITrackerParameter
{
#region Request Parameters
Expand Down Expand Up @@ -67,8 +69,9 @@ public override Dictionary<string, object> ToDictionary()
}

/// <summary>
/// Internal class used to construct a <see cref="CreateList"/> parameter set.
/// This class is no longer used.
/// </summary>
[Obsolete("This class is no longer used.")]
internal sealed class CreateListTracker
{
/// <summary>
Expand Down
Loading
Loading