-
Notifications
You must be signed in to change notification settings - Fork 385
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
move namedpipe connector to separate #3332
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bf34d20
moving namedpipeconnetor to separate project
colombod dcab606
address CA1416
colombod 5e610c6
<TargetFramework>net7.0-windows</TargetFramework>
colombod 34ab5f9
update api contract
colombod f0e07d2
skip namedpipe tests on linux
colombod 2020b1f
fix namespaces
colombod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Microsoft.DotNet.Interactive.NamedPipeConnector.Tests/Directory.Build.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<UseBetaVersion>true</UseBetaVersion> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
|
||
</Project> |
56 changes: 56 additions & 0 deletions
56
...ive.NamedPipeConnector.Tests/Microsoft.DotNet.Interactive.NamedPipeConnector.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
<NoWarn>$(NoWarn);8002</NoWarn><!-- Assent isn't strongly signed --> | ||
<NoWarn>$(NoWarn);CS8524</NoWarn><!-- The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value. --> | ||
<NoWarn>$(NoWarn);VSTHRD002</NoWarn><!-- Ignore: Avoid problematic synchronous waits --> | ||
<NoWarn>$(NoWarn);VSTHRD003</NoWarn><!-- Ignore: Avoid awaiting foreign Tasks --> | ||
<NoWarn>$(NoWarn);VSTHRD103</NoWarn><!-- Ignore: Call async methods when in an async method --> | ||
<NoWarn>$(NoWarn);VSTHRD105</NoWarn><!-- Ignore: Avoid method overloads that assume TaskScheduler.Current --> | ||
<NoWarn>$(NoWarn);VSTHRD110</NoWarn><!-- Ignore: Observe result of async calls --> | ||
<NoWarn>$(NoWarn);VSTHRD200</NoWarn><!-- Ignore: Use "Async" suffix for async methods --> | ||
<NoWarn>$(NoWarn);CS0219</NoWarn><!-- Ignore: The variable is assigned but its value is never used --> | ||
<NoWarn>$(NoWarn);CA1416</NoWarn><!-- Ignore: This call site is reachable on all platforms. 'PipeTransmissionMode.Message' is supported on: 'windows'. --> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="TestResults\**" /> | ||
<EmbeddedResource Remove="TestResults\**" /> | ||
<None Remove="TestResults\**" /> | ||
</ItemGroup> | ||
|
||
|
||
|
||
<ItemGroup> | ||
<PackageReference Include="Pocket.Disposable" Version="1.1.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="PocketLogger" Version="0.8.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="PocketLogger.For.Xunit" Version="0.6.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="PocketLogger.Subscribe" Version="0.8.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\dotnet-interactive\dotnet-interactive.csproj" /> | ||
<ProjectReference Include="..\Microsoft.DotNet.Interactive.NamedPipeConnector\Microsoft.DotNet.Interactive.NamedPipeConnector.csproj" /> | ||
<ProjectReference Include="..\Microsoft.DotNet.Interactive.Tests\Microsoft.DotNet.Interactive.Tests.csproj" /> | ||
<ProjectReference Include="..\Microsoft.DotNet.Interactive\Microsoft.DotNet.Interactive.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="xunit.runner.visualstudio" Version="$(xunitrunnervisualstudioVersion)"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,8 +5,9 @@ | |||||
using System.CommandLine; | ||||||
using System.CommandLine.Invocation; | ||||||
using System.Threading.Tasks; | ||||||
using Microsoft.DotNet.Interactive.Connection; | ||||||
|
||||||
namespace Microsoft.DotNet.Interactive.Connection; | ||||||
namespace Microsoft.DotNet.Interactive.NamedPipeConnectorConnector; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
public class ConnectNamedPipeCommand : ConnectKernelCommand | ||||||
{ | ||||||
|
@@ -15,6 +16,12 @@ public class ConnectNamedPipeCommand : ConnectKernelCommand | |||||
AddOption(PipeNameOption); | ||||||
} | ||||||
|
||||||
public static void AddToRootKernel() | ||||||
{ | ||||||
var compositeKernel = Kernel.Root as CompositeKernel; | ||||||
compositeKernel!.AddKernelConnector(new ConnectNamedPipeCommand()); | ||||||
} | ||||||
|
||||||
public Option<string> PipeNameOption { get; } = | ||||||
new("--pipe-name", "The name of the named pipe") | ||||||
{ | ||||||
|
@@ -27,12 +34,12 @@ public override async Task<IEnumerable<Kernel>> ConnectKernelsAsync( | |||||
{ | ||||||
var pipeName = commandLineContext.ParseResult.GetValueForOption(PipeNameOption); | ||||||
|
||||||
var connector = new NamedPipeKernelConnector(pipeName); | ||||||
var connector = new NamedPipeKernelConnector(pipeName!); | ||||||
|
||||||
var localName = commandLineContext.ParseResult.GetValueForOption(KernelNameOption); | ||||||
|
||||||
var proxyKernel = await connector.CreateKernelAsync(localName); | ||||||
var proxyKernel = await connector.CreateKernelAsync(localName!); | ||||||
|
||||||
return new [] {proxyKernel}; | ||||||
return new Kernel[] {proxyKernel}; | ||||||
} | ||||||
} |
9 changes: 9 additions & 0 deletions
9
src/Microsoft.DotNet.Interactive.NamedPipeConnector/Directory.Build.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<UseBetaVersion>true</UseBetaVersion> | ||
</PropertyGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
|
||
</Project> |
32 changes: 32 additions & 0 deletions
32
...Net.Interactive.NamedPipeConnector/Microsoft.DotNet.Interactive.NamedPipeConnector.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<PackageId Condition="'$(PackageId)'==''">Microsoft.DotNet.Interactive.NamedPipeConnectorConnector</PackageId> | ||
<NoWarn>$(NoWarn);8002;CS8002</NoWarn> | ||
<NoWarn>$(NoWarn);CA1416</NoWarn> <!-- Ignore: This call site is reachable on all platforms. 'PipeTransmissionMode.Message' is supported on: 'windows'. --> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<IsPackable>true</IsPackable> | ||
<PackageDescription Condition="'$(PackageDescription)'==''">Extension that allows connecting via namedpaipes</PackageDescription> | ||
<PackageTags Condition="'$(PackageTags)'==''">polyglot notebook dotnet interactive namedpipe</PackageTags> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.DotNet.Interactive\Microsoft.DotNet.Interactive.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="PocketLogger" Version="0.8.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="extension.dib" Pack="true" PackagePath="interactive-extensions/dotnet" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/Microsoft.DotNet.Interactive.NamedPipeConnector/extension.dib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!csharp | ||
|
||
Microsoft.DotNet.Interactive.NamedPipeConnector.ConnectNamedPipeCommand.AddToRootKernel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.