Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Update dependencies #81

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ variables:

jobs:
- job: Windows
pool: 'Hosted VS2017'
pool:
vmImage: 'windows-2019'
steps:
- template: steps-build-core.yml
- template: steps-build-samples.yml
Expand Down
3 changes: 2 additions & 1 deletion ci/signed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ variables:

jobs:
- job: Windows
pool: 'Hosted VS2017'
pool:
vmImage: 'windows-2019'
steps:
- template: steps-build-core.yml
- template: steps-build-samples.yml
Expand Down
4 changes: 2 additions & 2 deletions ci/steps-build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

steps:
- task: DotNetCoreInstaller@1
displayName: 'Install .NET Core SDK 3.1.300'
displayName: 'Install .NET Core SDK 6.0.201'
inputs:
version: 3.1.100
version: 6.0.201

- task: DotNetCoreCLI@2
displayName: "Build and run unit tests on Core library"
Expand Down
2 changes: 1 addition & 1 deletion ci/steps-build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
displayName: 'Create conda environment for hosting Jupyter kernels'
inputs:
environmentName: core_tests
packageSpecs: python=3.6 notebook jupyter_client pytest nose pip>=18.1
packageSpecs: python=3.7 notebook jupyter_client pytest nose pip>=18.1

- script: |
echo $PATH
Expand Down
2 changes: 1 addition & 1 deletion examples/echo-kernel/echo-kernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackAsTool>True</PackAsTool>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<!--
NB: We need for the tool command name to match the pattern dotnet-*,
Expand Down
2 changes: 1 addition & 1 deletion examples/moon-kernel/moon-kernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ToolCommandName>dotnet-imoon</ToolCommandName>
<PackAsTool>True</PackAsTool>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Version>1.0</Version>
</PropertyGroup>

Expand Down
51 changes: 45 additions & 6 deletions src/Data/Protocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class Message
public MessageHeader ParentHeader { get; set; }

// FIXME: make not just an object.
public object Metadata { get; set; }
public object Metadata { get; set; } = new Dictionary<string, object>();

// FIXME: make not just an object.
public MessageContent Content { get; set; }
Expand All @@ -87,6 +87,11 @@ public Message AsReplyTo(Message parent)

}

public interface IHasStatus<TStatus>
{
public TStatus Status { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
public class MessageContent
{
Expand Down Expand Up @@ -129,8 +134,11 @@ public Dictionary<string, object> Data
}

[JsonObject(MemberSerialization.OptIn)]
public class KernelInfoReplyContent : MessageContent
public class KernelInfoReplyContent : MessageContent, IHasStatus<ExecuteStatus>
{
[JsonProperty("status")]
public ExecuteStatus Status { get; set; } = ExecuteStatus.Ok;

[JsonProperty("protocol_version")]
public string ProtocolVersion { get => "5.2.0"; }

Expand Down Expand Up @@ -215,10 +223,25 @@ public class ExecuteInputContent : MessageContent
}

[JsonObject(MemberSerialization.OptIn)]
public class ExecuteReplyContent : MessageContent
public class ExecuteReplyContent : MessageContent, IHasStatus<ExecuteStatus>
{
[JsonProperty("status")]
public ExecuteStatus ExecuteStatus { get; set; }
public ExecuteStatus Status { get; set; }

// For backwards compatability, also define ExecuteStatus as forwarding
// to status.
[Obsolete("Please use Status.")]
public ExecuteStatus ExecuteStatus
{
get
{
return Status;
}
set
{
Status = value;
}
}

[JsonProperty("execution_count")]
public int? ExecutionCount { get; set; }
Expand All @@ -232,10 +255,26 @@ public class ExecuteReplyContent : MessageContent
}

[JsonObject(MemberSerialization.OptIn)]
public class CompleteReplyContent : MessageContent
public class CompleteReplyContent : MessageContent, IHasStatus<CompleteStatus>
{
[JsonProperty("status")]
public CompleteStatus CompleteStatus { get; set; }
public CompleteStatus Status { get; set; }


// For backwards compatability, also define ExecuteStatus as forwarding
// to status.
[Obsolete("Please use Status.")]
public CompleteStatus CompleteStatus
{
get
{
return Status;
}
set
{
Status = value;
}
}

[JsonProperty("matches")]
public List<string> Matches { get; set; } = new List<string>();
Expand Down
2 changes: 2 additions & 0 deletions src/Engines/CompletionResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#nullable enable

using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
4 changes: 3 additions & 1 deletion src/Extensions/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public static void SendMessage(this IOutgoingSocket socket, KernelContext contex
{
message.Header,
message.ParentHeader,
message.Metadata,
// Make sure that metadata is never null when going out
// over the wire.
message.Metadata ?? new Dictionary<string, object>(),
message.Content
}
.Select(frame => JsonConvert.SerializeObject(frame))
Expand Down
4 changes: 2 additions & 2 deletions src/jupyter-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<LangVersion>10.0</LangVersion>

<AssemblyName>Microsoft.Jupyter.Core</AssemblyName>
<Version Condition=" '$(BUILD_MAJOR)' != '' ">$(BUILD_MAJOR).$(BUILD_MINOR).0.0</Version>
Expand Down Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="NetMQ" Version="4.0.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />

<PackageReference Include="System.Net.Security" Version="4.3.1" />
Expand Down
16 changes: 3 additions & 13 deletions tests/core/InputParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@

namespace Microsoft.Jupyter.Core
{
internal class MundaneSymbol : ISymbol
{
public string Name { get; set; }

public SymbolKind Kind { get; set; }
}
internal record MundaneSymbol(string Name, SymbolKind Kind) : ISymbol;

internal class MockSymbolResolver : ISymbolResolver
{
Expand All @@ -32,13 +27,8 @@ internal class MockSymbolResolver : ISymbolResolver
} as ISymbol
:
this.otherSymbols.Contains(symbolName)
? new MundaneSymbol
{
Name = symbolName,
Kind = SymbolKind.Callable
} as ISymbol
:
null;
? new MundaneSymbol(symbolName, SymbolKind.Callable) as ISymbol
: null;
}

[TestClass]
Expand Down
2 changes: 1 addition & 1 deletion tests/core/core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand Down