From c28ea54f49f7fdee2ec5624cf1f8d8284791acbf Mon Sep 17 00:00:00 2001 From: jbtule Date: Thu, 2 Nov 2023 11:22:30 -0500 Subject: [PATCH 01/16] dep/project upgrade, Passes tests for both runtimes --- Dynamitey.sln.DotSettings | 1 + Dynamitey/Dynamitey.csproj | 19 +----------------- SupportLibrary/SupportLibrary.csproj | 4 ++-- Tests/Invoke.cs | 2 +- Tests/Program.cs | 12 ------------ Tests/SpeedTest.cs | 2 +- Tests/Tests.csproj | 29 +++++++++++++--------------- 7 files changed, 19 insertions(+), 50 deletions(-) delete mode 100644 Tests/Program.cs diff --git a/Dynamitey.sln.DotSettings b/Dynamitey.sln.DotSettings index 61d3c50..3719ac7 100644 --- a/Dynamitey.sln.DotSettings +++ b/Dynamitey.sln.DotSettings @@ -1,6 +1,7 @@  DB SL + True <data><IncludeFilters /><ExcludeFilters /></data> <data /> True diff --git a/Dynamitey/Dynamitey.csproj b/Dynamitey/Dynamitey.csproj index eab3d20..ccea049 100644 --- a/Dynamitey/Dynamitey.csproj +++ b/Dynamitey/Dynamitey.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netstandard1.5;net40;portable-net45+sl5+win8+wp8 + netstandard2.0;net40 netstandard2.0 (pronounced dyna-mighty) flexes DLR muscle to do meta-mazing things in .net Ekon Benefits @@ -23,11 +23,6 @@ - - - - - @@ -36,10 +31,6 @@ - - - - @@ -57,9 +48,6 @@ - - - @@ -79,10 +67,5 @@ - - - - - \ No newline at end of file diff --git a/SupportLibrary/SupportLibrary.csproj b/SupportLibrary/SupportLibrary.csproj index 12d51c4..6e9c9fe 100644 --- a/SupportLibrary/SupportLibrary.csproj +++ b/SupportLibrary/SupportLibrary.csproj @@ -1,11 +1,11 @@  - netstandard1.0 + netstandard2.0 - + diff --git a/Tests/Invoke.cs b/Tests/Invoke.cs index 546a1d8..7ef3549 100644 --- a/Tests/Invoke.cs +++ b/Tests/Invoke.cs @@ -16,7 +16,7 @@ namespace Dynamitey.Tests { public class Invoke:AssertionHelper { - [TestFixtureTearDown] + [OneTimeTearDown] public void DestroyCaches() { Dynamic.ClearCaches(); diff --git a/Tests/Program.cs b/Tests/Program.cs deleted file mode 100644 index 088306b..0000000 --- a/Tests/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Dynamitey.Tests -{ -#if !NETCOREAPP2_0 - public class Program - { - public static void Main() - { - - } - } -#endif -} \ No newline at end of file diff --git a/Tests/SpeedTest.cs b/Tests/SpeedTest.cs index 3552b1d..8158faa 100644 --- a/Tests/SpeedTest.cs +++ b/Tests/SpeedTest.cs @@ -13,7 +13,7 @@ namespace Dynamitey.Tests [Category("Performance")] public class SpeedTest:AssertionHelper { - [TestFixtureSetUp] + [OneTimeSetUp] public void WarmUpDlr() { Dynamic.InvokeMember(1, "ToString"); diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 20ccaef..8e5b990 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,29 +1,26 @@  - netcoreapp2.0;net462 - netcoreapp2.0 - Exe - false + net6;net48 + net6 + false - + - - - - - - + + + + + - - - - - + + + + From 6a55014f7117aa27c34d4ae45dd0cfa8166f8937 Mon Sep 17 00:00:00 2001 From: jbtule Date: Thu, 2 Nov 2023 11:26:45 -0500 Subject: [PATCH 02/16] update versions --- Dynamitey.sln | 13 +++++++++---- Version.props | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dynamitey.sln b/Dynamitey.sln index d54a794..3023843 100644 --- a/Dynamitey.sln +++ b/Dynamitey.sln @@ -1,16 +1,21 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{691EBA79-CAA4-4670-BC8B-4537F990ADBF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{C33F07DB-7ACB-4081-92C2-BB739CB605C0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{C33F07DB-7ACB-4081-92C2-BB739CB605C0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SupportLibrary", "SupportLibrary\SupportLibrary.csproj", "{18E19833-D47E-4A7F-AE64-31E28FEF8728}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SupportLibrary", "SupportLibrary\SupportLibrary.csproj", "{18E19833-D47E-4A7F-AE64-31E28FEF8728}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dynamitey", "Dynamitey\Dynamitey.csproj", "{8902AFBA-4ACA-4880-B606-ADEC6BB21A1B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3535FA34-121F-4DEB-97C5-4A90E54AEE94}" + ProjectSection(SolutionItems) = preProject + Version.props = Version.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Version.props b/Version.props index 568a0ef..302ecdd 100644 --- a/Version.props +++ b/Version.props @@ -1,5 +1,5 @@ - 2.0.10 + 3.0.1 \ No newline at end of file From a4a98a0358753bc35a60f99924f275c33e5f7433 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 11:29:13 -0500 Subject: [PATCH 03/16] Update build .net version --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3d4c4e1..b9b27c0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - dotnet: [2.1.802] + dotnet: [ '6.0.x' ] os: [ubuntu-latest, windows-latest, macOS-latest] steps: From dcb8955c1af6a2f843733dce5ef79cf1b6bc6d5e Mon Sep 17 00:00:00 2001 From: jbtule Date: Thu, 2 Nov 2023 11:34:09 -0500 Subject: [PATCH 04/16] i think ironpython does work on .net6 --- Tests/DynamicObjects.cs | 2 +- Tests/Linq.cs | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Tests/DynamicObjects.cs b/Tests/DynamicObjects.cs index bc04615..91444cb 100644 --- a/Tests/DynamicObjects.cs +++ b/Tests/DynamicObjects.cs @@ -573,7 +573,7 @@ public void TestRecorder() } -#if !NETCOREAPP2_0 +#if !NET6 [Test] public void TestCodeDomLateTypeBind() diff --git a/Tests/Linq.cs b/Tests/Linq.cs index 137ba77..c13713a 100644 --- a/Tests/Linq.cs +++ b/Tests/Linq.cs @@ -6,10 +6,9 @@ using System.Text; using System.Threading.Tasks; using NUnit.Framework; -#if !NETCOREAPP2_0 using IronPython.Hosting; using Microsoft.Scripting; -#endif + namespace Dynamitey.Tests { [TestFixture] @@ -37,7 +36,7 @@ public void MoreGenericsDynamicLinq() Assert.AreEqual(expected, actual); } -#if !NETCOREAPP2_0 + private dynamic RunPythonHelper(object linq, string code) { @@ -53,15 +52,7 @@ private dynamic RunPythonHelper(object linq, string code) tCompiled.Execute(tScope); return tScope.GetVariable("result"); } -#else - private dynamic RunPythonHelper(object linq, string code) - { - - Assert.Ignore("Iron Python Doesn't work on .net core"); - return new object(); - } -#endif From f66a86966ffe1bedc4ea4e73d464e045caa0c9c3 Mon Sep 17 00:00:00 2001 From: jbtule Date: Thu, 2 Nov 2023 11:37:22 -0500 Subject: [PATCH 05/16] fixed ifdef --- Tests/DynamicObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/DynamicObjects.cs b/Tests/DynamicObjects.cs index 91444cb..a7d1c98 100644 --- a/Tests/DynamicObjects.cs +++ b/Tests/DynamicObjects.cs @@ -573,7 +573,7 @@ public void TestRecorder() } -#if !NET6 +#if !NET6_0_OR_GREATER [Test] public void TestCodeDomLateTypeBind() From e2ee2911af37b7f5100ba3533bbf41969d842159 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 11:55:23 -0500 Subject: [PATCH 06/16] Create dotnet48.yml attempting .net framework 4.8 tests with github actions --- .github/workflows/dotnet48.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/dotnet48.yml diff --git a/.github/workflows/dotnet48.yml b/.github/workflows/dotnet48.yml new file mode 100644 index 0000000..2818622 --- /dev/null +++ b/.github/workflows/dotnet48.yml @@ -0,0 +1,30 @@ +name: Build .net framework 48 + +on: [push] + +jobs: + build: + + runs-on: windows-2019 + steps: + + - uses: actions/checkout@v2 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 + + - name: setup-msbuild + uses: microsoft/setup-msbuild@v1.1 + + - name: Restore Packages + run: nuget restore Dynamitey.sln + + - name: Run vstests + uses: microsoft/vstest-action@v1.0.0 + with: + testAssembly: Tests.dll + searchFolder: .\Tests\bin\Debug\net48\ + runInParallel: true From 850019d2f19ee0141d9bf81ce2fd59993ea8c59e Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:01:29 -0500 Subject: [PATCH 07/16] Update dotnet48.yml --- .github/workflows/dotnet48.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet48.yml b/.github/workflows/dotnet48.yml index 2818622..b49c6b6 100644 --- a/.github/workflows/dotnet48.yml +++ b/.github/workflows/dotnet48.yml @@ -14,17 +14,18 @@ jobs: uses: microsoft/setup-msbuild@v1 - name: Setup NuGet - uses: NuGet/setup-nuget@v1.0.5 + uses: NuGet/setup-nuget@v1.2.0 - name: setup-msbuild uses: microsoft/setup-msbuild@v1.1 - name: Restore Packages run: nuget restore Dynamitey.sln - + - name: Build solution + run: msbuild Dynamitey.sln -t:rebuild -property:Configuration=Release - name: Run vstests uses: microsoft/vstest-action@v1.0.0 with: testAssembly: Tests.dll - searchFolder: .\Tests\bin\Debug\net48\ + searchFolder: .\Tests\bin\Release\net48\ runInParallel: true From 0e5288993382142a0c7191dd094e88944c5295f2 Mon Sep 17 00:00:00 2001 From: jbtule Date: Thu, 2 Nov 2023 12:13:55 -0500 Subject: [PATCH 08/16] many not need this anymore --- Dynamitey/Dynamitey.csproj | 1 - Tests/Tests.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/Dynamitey/Dynamitey.csproj b/Dynamitey/Dynamitey.csproj index ccea049..b56d710 100644 --- a/Dynamitey/Dynamitey.csproj +++ b/Dynamitey/Dynamitey.csproj @@ -2,7 +2,6 @@ netstandard2.0;net40 - netstandard2.0 (pronounced dyna-mighty) flexes DLR muscle to do meta-mazing things in .net Ekon Benefits diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 8e5b990..945d5f9 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,7 +1,6 @@  net6;net48 - net6 false From 400bef79d5c276bf2f2d79ab661ea7efdaa05c2a Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:27:03 -0500 Subject: [PATCH 09/16] Update and rename dotnet48.yml to dotnet-win.yml --- .github/workflows/{dotnet48.yml => dotnet-win.yml} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename .github/workflows/{dotnet48.yml => dotnet-win.yml} (78%) diff --git a/.github/workflows/dotnet48.yml b/.github/workflows/dotnet-win.yml similarity index 78% rename from .github/workflows/dotnet48.yml rename to .github/workflows/dotnet-win.yml index b49c6b6..b7c2061 100644 --- a/.github/workflows/dotnet48.yml +++ b/.github/workflows/dotnet-win.yml @@ -1,4 +1,4 @@ -name: Build .net framework 48 +name: Build .net Windows crosscomple on: [push] @@ -10,9 +10,6 @@ jobs: - uses: actions/checkout@v2 - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1 - - name: Setup NuGet uses: NuGet/setup-nuget@v1.2.0 @@ -27,5 +24,6 @@ jobs: uses: microsoft/vstest-action@v1.0.0 with: testAssembly: Tests.dll - searchFolder: .\Tests\bin\Release\net48\ + searchFolder: .\Tests\bin\Release\ runInParallel: true + otherConsoleOptions: /TestCaseFilter:"(TestCategory!=Performance)" From 16e9c09ce3712308d59ef2f806ec21757f8ef6d1 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:28:08 -0500 Subject: [PATCH 10/16] Update and rename dotnet.yml to dotnet-_nix.yml --- .github/workflows/{dotnet.yml => dotnet-_nix.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{dotnet.yml => dotnet-_nix.yml} (87%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet-_nix.yml similarity index 87% rename from .github/workflows/dotnet.yml rename to .github/workflows/dotnet-_nix.yml index b9b27c0..8d830d6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet-_nix.yml @@ -1,4 +1,4 @@ -name: Build .net core +name: Build .net core *nix on: [push] @@ -9,7 +9,7 @@ jobs: strategy: matrix: dotnet: [ '6.0.x' ] - os: [ubuntu-latest, windows-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest] steps: - uses: actions/checkout@v1 From c30d5333e68f4635ca0aa7f21fd80efd62f5aa7e Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:31:28 -0500 Subject: [PATCH 11/16] Update dotnet-win.yml --- .github/workflows/dotnet-win.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-win.yml b/.github/workflows/dotnet-win.yml index b7c2061..ea97380 100644 --- a/.github/workflows/dotnet-win.yml +++ b/.github/workflows/dotnet-win.yml @@ -24,6 +24,6 @@ jobs: uses: microsoft/vstest-action@v1.0.0 with: testAssembly: Tests.dll - searchFolder: .\Tests\bin\Release\ + searchFolder: .\Tests\bin\Release\**\ runInParallel: true otherConsoleOptions: /TestCaseFilter:"(TestCategory!=Performance)" From f0ab7a653c2033a0c1c0f34020c08b4676726b31 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:42:22 -0500 Subject: [PATCH 12/16] Update dotnet-win.yml --- .github/workflows/dotnet-win.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-win.yml b/.github/workflows/dotnet-win.yml index ea97380..cb0b378 100644 --- a/.github/workflows/dotnet-win.yml +++ b/.github/workflows/dotnet-win.yml @@ -4,7 +4,7 @@ on: [push] jobs: build: - + name: Test Windows .net Core and Framework runs-on: windows-2019 steps: @@ -24,6 +24,7 @@ jobs: uses: microsoft/vstest-action@v1.0.0 with: testAssembly: Tests.dll - searchFolder: .\Tests\bin\Release\**\ + searchFolder: .\Tests\bin\Release\*\ runInParallel: true otherConsoleOptions: /TestCaseFilter:"(TestCategory!=Performance)" + platform: x64 From 5bafc71e367feb7341410b3839acf3f78e5eb08a Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:49:22 -0500 Subject: [PATCH 13/16] Update and rename dotnet-win.yml to dotnet48.yml --- .github/workflows/{dotnet-win.yml => dotnet48.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{dotnet-win.yml => dotnet48.yml} (87%) diff --git a/.github/workflows/dotnet-win.yml b/.github/workflows/dotnet48.yml similarity index 87% rename from .github/workflows/dotnet-win.yml rename to .github/workflows/dotnet48.yml index cb0b378..8c7980e 100644 --- a/.github/workflows/dotnet-win.yml +++ b/.github/workflows/dotnet48.yml @@ -1,10 +1,10 @@ -name: Build .net Windows crosscomple +name: Build CrossComple .net core/.net framework Windows on: [push] jobs: build: - name: Test Windows .net Core and Framework + name: Test Windows .net Framework Only runs-on: windows-2019 steps: From 4b01bbca126a434c9bb89607327374db3004d560 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:49:44 -0500 Subject: [PATCH 14/16] Update and rename dotnet-_nix.yml to dotnet.yml --- .github/workflows/{dotnet-_nix.yml => dotnet.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{dotnet-_nix.yml => dotnet.yml} (91%) diff --git a/.github/workflows/dotnet-_nix.yml b/.github/workflows/dotnet.yml similarity index 91% rename from .github/workflows/dotnet-_nix.yml rename to .github/workflows/dotnet.yml index 8d830d6..9ea6e86 100644 --- a/.github/workflows/dotnet-_nix.yml +++ b/.github/workflows/dotnet.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: dotnet: [ '6.0.x' ] - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 From 8c29229e029ba0d0da8ec80fb288057637ca43a9 Mon Sep 17 00:00:00 2001 From: Jay Tuley Date: Thu, 2 Nov 2023 12:51:26 -0500 Subject: [PATCH 15/16] Update dotnet.yml --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9ea6e86..b9b27c0 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,4 +1,4 @@ -name: Build .net core *nix +name: Build .net core on: [push] From f7737ca31ed480571b7940bd77ef575051aeded7 Mon Sep 17 00:00:00 2001 From: jbtule Date: Fri, 3 Nov 2023 16:21:38 -0500 Subject: [PATCH 16/16] Fallback to get type arguments --- .../DynamicObjects/ExtensionToInstanceProxy.cs | 17 ++++++++++++++++- Version.props | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dynamitey/DynamicObjects/ExtensionToInstanceProxy.cs b/Dynamitey/DynamicObjects/ExtensionToInstanceProxy.cs index 2995c25..a0097f5 100644 --- a/Dynamitey/DynamicObjects/ExtensionToInstanceProxy.cs +++ b/Dynamitey/DynamicObjects/ExtensionToInstanceProxy.cs @@ -293,7 +293,22 @@ public override bool TryInvokeMember(System.Dynamic.InvokeMemberBinder binder, o }catch(RuntimeBinderException) { - types = null; + try + { + IList typeList = Dynamic.InvokeGet(binder, + "TypeArguments"); + if (typeList != null) + { + + types = typeList.ToArray(); + + } + + } + catch (RuntimeBinderException) + { + types = null; + } } var name=InvokeMemberName.Create; diff --git a/Version.props b/Version.props index 302ecdd..6d87896 100644 --- a/Version.props +++ b/Version.props @@ -1,5 +1,5 @@ - 3.0.1 + 3.0.2 \ No newline at end of file