From b7a21ce4beeacc7ccf5b152dcd733656a1494ede Mon Sep 17 00:00:00 2001 From: Martin-Molinero Date: Tue, 3 May 2022 11:45:55 -0300 Subject: [PATCH] Update to net6 (#6311) * Update to net6 * Bump pythonNet to 2.0.13 --- .../QuantConnect.Algorithm.CSharp.csproj | 9 ++------- .../QuantConnect.Algorithm.Framework.csproj | 9 ++------- .../QuantConnect.Algorithm.Python.csproj | 9 ++------- Algorithm/QuantConnect.Algorithm.csproj | 9 ++------- .../QuantConnect.AlgorithmFactory.csproj | 9 ++------- Api/QuantConnect.Api.csproj | 8 +------- Brokerages/QuantConnect.Brokerages.csproj | 8 +------- Common/QuantConnect.csproj | 9 ++------- Common/Util/LinqExtensions.cs | 14 -------------- Compression/QuantConnect.Compression.csproj | 7 +------ Configuration/QuantConnect.Configuration.csproj | 7 +------ DockerfileJupyter | 2 +- DockerfileLeanFoundation | 4 ++-- DockerfileLeanFoundationARM | 2 +- Engine/QuantConnect.Lean.Engine.csproj | 9 ++------- Indicators/QuantConnect.Indicators.csproj | 9 ++------- Launcher/QuantConnect.Lean.Launcher.csproj | 7 +------ Logging/QuantConnect.Logging.csproj | 10 ++-------- Messaging/QuantConnect.Messaging.csproj | 7 +------ .../QuantConnect.Optimizer.Launcher.csproj | 7 +------ Optimizer/QuantConnect.Optimizer.csproj | 7 +------ Queues/QuantConnect.Queues.csproj | 9 ++------- Report/QuantConnect.Report.csproj | 10 ++-------- Report/ReportElements/MarketsReportElement.cs | 2 +- Research/QuantConnect.Research.csproj | 9 ++------- Tests/QuantConnect.Tests.csproj | 10 ++-------- ToolBox/QuantConnect.ToolBox.csproj | 9 ++------- 27 files changed, 41 insertions(+), 170 deletions(-) diff --git a/Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj b/Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj index ae2beb03dcea..fca5388b0b29 100644 --- a/Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj +++ b/Algorithm.CSharp/QuantConnect.Algorithm.CSharp.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Algorithm.CSharp QuantConnect.Algorithm.CSharp - net5.0 - 9 + net6.0 false bin\$(Configuration)\ AllEnabledByDefault @@ -35,7 +34,7 @@ portable - + @@ -43,10 +42,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Algorithm.Framework/QuantConnect.Algorithm.Framework.csproj b/Algorithm.Framework/QuantConnect.Algorithm.Framework.csproj index 0c5d384be230..bed63e07ce3a 100644 --- a/Algorithm.Framework/QuantConnect.Algorithm.Framework.csproj +++ b/Algorithm.Framework/QuantConnect.Algorithm.Framework.csproj @@ -4,13 +4,12 @@ AnyCPU QuantConnect.Algorithm.Framework QuantConnect.Algorithm.Framework - net5.0 + net6.0 false bin\$(Configuration)\ AllEnabledByDefault bin\$(Configuration)\QuantConnect.Algorithm.Framework.xml Library - 9 false false QuantConnect LEAN Engine: Algorithm.Framework Project - The core QCAlgorithm framework implementation @@ -30,15 +29,11 @@ LICENSE - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Algorithm.Python/QuantConnect.Algorithm.Python.csproj b/Algorithm.Python/QuantConnect.Algorithm.Python.csproj index a352e074fcfb..566506f945c9 100644 --- a/Algorithm.Python/QuantConnect.Algorithm.Python.csproj +++ b/Algorithm.Python/QuantConnect.Algorithm.Python.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Algorithm.Python QuantConnect.Algorithm.Python - net5.0 - 9 + net6.0 AllEnabledByDefault bin\$(Configuration)\ false @@ -37,11 +36,7 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Algorithm/QuantConnect.Algorithm.csproj b/Algorithm/QuantConnect.Algorithm.csproj index 3109fd8572d1..b7c8ac69ab09 100644 --- a/Algorithm/QuantConnect.Algorithm.csproj +++ b/Algorithm/QuantConnect.Algorithm.csproj @@ -4,9 +4,8 @@ AnyCPU QuantConnect.Algorithm QuantConnect.Algorithm - net5.0 + net6.0 ..\ - 9 false AllEnabledByDefault bin\$(Configuration)\ @@ -30,12 +29,8 @@ LICENSE - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj b/AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj index 4864f914b17e..c6eee05d1582 100644 --- a/AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj +++ b/AlgorithmFactory/QuantConnect.AlgorithmFactory.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.AlgorithmFactory QuantConnect.AlgorithmFactory - net5.0 - 9 + net6.0 false bin\$(Configuration)\ AllEnabledByDefault @@ -29,11 +28,7 @@ LICENSE - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Api/QuantConnect.Api.csproj b/Api/QuantConnect.Api.csproj index 8c3d84eb88a2..1adddcd80170 100644 --- a/Api/QuantConnect.Api.csproj +++ b/Api/QuantConnect.Api.csproj @@ -2,13 +2,11 @@ Debug AnyCPU - 8.0.30703 QuantConnect.Api QuantConnect.Api - net5.0 + net6.0 ..\ true - 9 AllEnabledByDefault false bin\$(Configuration)\ @@ -34,10 +32,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Brokerages/QuantConnect.Brokerages.csproj b/Brokerages/QuantConnect.Brokerages.csproj index d2899ad8e4a8..96232185f025 100644 --- a/Brokerages/QuantConnect.Brokerages.csproj +++ b/Brokerages/QuantConnect.Brokerages.csproj @@ -4,10 +4,8 @@ AnyCPU QuantConnect.Brokerages QuantConnect.Brokerages - net5.0 - 9 + net6.0 AllEnabledByDefault - NET45 false bin\$(Configuration)\ bin\$(Configuration)\QuantConnect.Brokerages.xml @@ -32,10 +30,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Common/QuantConnect.csproj b/Common/QuantConnect.csproj index 3fe01393fbb5..19418deaf138 100644 --- a/Common/QuantConnect.csproj +++ b/Common/QuantConnect.csproj @@ -2,11 +2,10 @@ Debug AnyCPU - net5.0 + net6.0 QuantConnect.Common ..\ true - 9 AllEnabledByDefault false bin\$(Configuration)\ @@ -35,14 +34,10 @@ - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Common/Util/LinqExtensions.cs b/Common/Util/LinqExtensions.cs index a4cf28f0399c..4a2745f29446 100644 --- a/Common/Util/LinqExtensions.cs +++ b/Common/Util/LinqExtensions.cs @@ -263,20 +263,6 @@ public static IEnumerable Range(T start, T end, Func incrementer, bo } } - /// - /// Creates a new enumerable that will be distinct by the specified property selector - /// - /// The enumerable item type - /// The selected property type - /// The source enumerable - /// The property selector - /// A filtered enumerable distinct on the selected property - public static IEnumerable DistinctBy(this IEnumerable enumerable, Func selector) - { - var hash = new HashSet(); - return enumerable.Where(x => hash.Add(selector(x))); - } - /// /// Groups adjacent elements of the enumerale using the specified grouper function /// diff --git a/Compression/QuantConnect.Compression.csproj b/Compression/QuantConnect.Compression.csproj index 368a93519315..3bd905eaa6b2 100644 --- a/Compression/QuantConnect.Compression.csproj +++ b/Compression/QuantConnect.Compression.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Compression QuantConnect.Compression - net5.0 - 9 + net6.0 AllEnabledByDefault false bin\$(Configuration)\ @@ -31,10 +30,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Configuration/QuantConnect.Configuration.csproj b/Configuration/QuantConnect.Configuration.csproj index db008f7037f9..f8af63e29bad 100644 --- a/Configuration/QuantConnect.Configuration.csproj +++ b/Configuration/QuantConnect.Configuration.csproj @@ -4,10 +4,9 @@ AnyCPU QuantConnect.Configuration QuantConnect.Configuration - net5.0 + net6.0 ..\ true - 9 AllEnabledByDefault false bin\$(Configuration)\ @@ -32,10 +31,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/DockerfileJupyter b/DockerfileJupyter index e4f79c1ab29d..64603d8a2019 100644 --- a/DockerfileJupyter +++ b/DockerfileJupyter @@ -28,7 +28,7 @@ ENV LD_LIBRARY_PATH=/lib/ # Install .NET Interactive to support C# in Jupyter notebooks ENV PATH="${PATH}:/root/.dotnet/tools" -RUN dotnet tool install -g --no-cache --version 1.0.255902 --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive && \ +RUN dotnet tool install -g --no-cache --version 1.0.317502 --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive && \ dotnet interactive jupyter install # Setting some environment variables diff --git a/DockerfileLeanFoundation b/DockerfileLeanFoundation index 60726df86a2d..edefbf465f5c 100644 --- a/DockerfileLeanFoundation +++ b/DockerfileLeanFoundation @@ -34,13 +34,13 @@ RUN mkdir -p /root/ibgateway && \ ./ibgateway-latest-standalone-linux-x64.v10.12.2d.sh -q -dir /root/ibgateway && \ rm ibgateway-latest-standalone-linux-x64.v10.12.2d.sh -# Install dotnet 5 sdk & runtime +# Install dotnet 6 sdk & runtime RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ dpkg -i packages-microsoft-prod.deb && \ apt-get update; \ apt-get install -y apt-transport-https && \ apt-get update && \ - apt-get install -y dotnet-sdk-5.0 && \ + apt-get install -y dotnet-sdk-6.0 && \ rm packages-microsoft-prod.deb && \ apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/* diff --git a/DockerfileLeanFoundationARM b/DockerfileLeanFoundationARM index 68e1bc903f7c..c957a9397da8 100644 --- a/DockerfileLeanFoundationARM +++ b/DockerfileLeanFoundationARM @@ -39,7 +39,7 @@ RUN mkdir -p /root/ibgateway && \ ENV PATH="/root/.dotnet:${PATH}" RUN wget https://dot.net/v1/dotnet-install.sh && \ chmod 777 dotnet-install.sh && \ - ./dotnet-install.sh -c 5.0 && \ + ./dotnet-install.sh -c 6.0 && \ rm dotnet-install.sh ENV DOTNET_ROOT="/root/.dotnet" diff --git a/Engine/QuantConnect.Lean.Engine.csproj b/Engine/QuantConnect.Lean.Engine.csproj index bd0198ebabdd..5dae4e4aa6cf 100644 --- a/Engine/QuantConnect.Lean.Engine.csproj +++ b/Engine/QuantConnect.Lean.Engine.csproj @@ -4,7 +4,7 @@ AnyCPU QuantConnect.Lean.Engine QuantConnect.Lean.Engine - net5.0 + net6.0 ..\ true publish\ @@ -16,7 +16,6 @@ false false true - 9 AllEnabledByDefault false bin\$(Configuration)\QuantConnect.Lean.Engine.xml @@ -43,14 +42,10 @@ - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Indicators/QuantConnect.Indicators.csproj b/Indicators/QuantConnect.Indicators.csproj index f47d129682cd..6f2c8f56c251 100644 --- a/Indicators/QuantConnect.Indicators.csproj +++ b/Indicators/QuantConnect.Indicators.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Indicators QuantConnect.Indicators - net5.0 - 9 + net6.0 AllEnabledByDefault false bin\$(Configuration)\ @@ -32,12 +31,8 @@ - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Launcher/QuantConnect.Lean.Launcher.csproj b/Launcher/QuantConnect.Lean.Launcher.csproj index 354f5af4b220..2e67781fdd5a 100644 --- a/Launcher/QuantConnect.Lean.Launcher.csproj +++ b/Launcher/QuantConnect.Lean.Launcher.csproj @@ -5,8 +5,7 @@ Exe QuantConnect.Lean.Launcher QuantConnect.Lean.Launcher - net5.0 - 9 + net6.0 AllEnabledByDefault false bin\$(Configuration)\ @@ -38,10 +37,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Logging/QuantConnect.Logging.csproj b/Logging/QuantConnect.Logging.csproj index df86cbb03ff7..2211d002893e 100644 --- a/Logging/QuantConnect.Logging.csproj +++ b/Logging/QuantConnect.Logging.csproj @@ -2,13 +2,11 @@ Debug AnyCPU - 8.0.30703 QuantConnect.Logging QuantConnect.Logging - net5.0 + net6.0 ..\ true - 9 AllEnabledByDefault false bin\$(Configuration)\ @@ -36,11 +34,7 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/Messaging/QuantConnect.Messaging.csproj b/Messaging/QuantConnect.Messaging.csproj index 680e7078b94e..d17729674f83 100644 --- a/Messaging/QuantConnect.Messaging.csproj +++ b/Messaging/QuantConnect.Messaging.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Messaging QuantConnect.Messaging - net5.0 - 9 + net6.0 AllEnabledByDefault false bin\$(Configuration)\ @@ -31,10 +30,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Optimizer.Launcher/QuantConnect.Optimizer.Launcher.csproj b/Optimizer.Launcher/QuantConnect.Optimizer.Launcher.csproj index 9edc225c597e..16b28ab72cad 100644 --- a/Optimizer.Launcher/QuantConnect.Optimizer.Launcher.csproj +++ b/Optimizer.Launcher/QuantConnect.Optimizer.Launcher.csproj @@ -5,7 +5,7 @@ Exe QuantConnect.Optimizer.Launcher QuantConnect.Optimizer.Launcher - net5.0 + net6.0 true false bin\$(Configuration)\ @@ -13,7 +13,6 @@ false true QuantConnect LEAN Engine: Optimizer Launcher Project - The Lean optimization engine launcher - 9 full @@ -33,10 +32,6 @@ LICENSE - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Optimizer/QuantConnect.Optimizer.csproj b/Optimizer/QuantConnect.Optimizer.csproj index ea7a92ee96d5..5af59cb43ada 100644 --- a/Optimizer/QuantConnect.Optimizer.csproj +++ b/Optimizer/QuantConnect.Optimizer.csproj @@ -4,10 +4,9 @@ AnyCPU QuantConnect.Optimizer QuantConnect.Optimizer - net5.0 + net6.0 true false - 9 bin\$(Configuration)\ AllEnabledByDefault false @@ -34,10 +33,6 @@ LICENSE - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Queues/QuantConnect.Queues.csproj b/Queues/QuantConnect.Queues.csproj index b2e5d12fc7a3..b6c5a8b5fe36 100644 --- a/Queues/QuantConnect.Queues.csproj +++ b/Queues/QuantConnect.Queues.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Queues QuantConnect.Queues - net5.0 - 9 + net6.0 false bin\$(Configuration)\ bin\$(Configuration)\QuantConnect.Queues.xml @@ -30,10 +29,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -51,4 +46,4 @@ - \ No newline at end of file + diff --git a/Report/QuantConnect.Report.csproj b/Report/QuantConnect.Report.csproj index 8c3043bbd744..319b335d11ba 100644 --- a/Report/QuantConnect.Report.csproj +++ b/Report/QuantConnect.Report.csproj @@ -5,7 +5,7 @@ Exe QuantConnect.Report QuantConnect.Report - net5.0 + net6.0 true false bin\$(Configuration)\ @@ -14,7 +14,6 @@ false true QuantConnect LEAN Engine: Report Project - Generates live and backtesting reports - 9 full @@ -42,14 +41,9 @@ LICENSE - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/Report/ReportElements/MarketsReportElement.cs b/Report/ReportElements/MarketsReportElement.cs index cb430ddeeea5..da93e03b8993 100644 --- a/Report/ReportElements/MarketsReportElement.cs +++ b/Report/ReportElements/MarketsReportElement.cs @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -using MoreLinq; + using System.Linq; using QuantConnect.Orders; using QuantConnect.Packets; diff --git a/Research/QuantConnect.Research.csproj b/Research/QuantConnect.Research.csproj index 5ccfdd9dd260..1d54a79a21f3 100644 --- a/Research/QuantConnect.Research.csproj +++ b/Research/QuantConnect.Research.csproj @@ -4,8 +4,7 @@ AnyCPU QuantConnect.Research QuantConnect.Research - net5.0 - 9 + net6.0 AllEnabledByDefault bin\$(Configuration)\ false @@ -32,11 +31,7 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Tests/QuantConnect.Tests.csproj b/Tests/QuantConnect.Tests.csproj index 1edc8f09c6e6..38aa06821752 100644 --- a/Tests/QuantConnect.Tests.csproj +++ b/Tests/QuantConnect.Tests.csproj @@ -4,9 +4,8 @@ AnyCPU QuantConnect.Tests QuantConnect.Tests - net5.0 + net6.0 ..\ - 9 AllEnabledByDefault false bin\$(Configuration)\ @@ -15,7 +14,6 @@ true true QuantConnect LEAN Engine: Tests Project - The test collection - CS0618 full @@ -34,16 +32,12 @@ - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/ToolBox/QuantConnect.ToolBox.csproj b/ToolBox/QuantConnect.ToolBox.csproj index 7af6acbe5748..a20102e48fad 100644 --- a/ToolBox/QuantConnect.ToolBox.csproj +++ b/ToolBox/QuantConnect.ToolBox.csproj @@ -5,8 +5,7 @@ Exe QuantConnect.ToolBox QuantConnect.ToolBox - net5.0 - 9 + net6.0 AllEnabledByDefault false bin\$(Configuration)\ @@ -40,17 +39,13 @@ - + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive -