-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users/oakeredolu/newpipservice (#683)
Created new PythonResolver for SimplePypiClient
- Loading branch information
Showing
6 changed files
with
807 additions
and
13 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/Microsoft.ComponentDetection.Detectors/pip/ISimplePythonResolver.cs
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,16 @@ | ||
namespace Microsoft.ComponentDetection.Detectors.Pip; | ||
|
||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Microsoft.ComponentDetection.Contracts; | ||
|
||
public interface ISimplePythonResolver | ||
{ | ||
/// <summary> | ||
/// Resolves the root Python packages from the initial list of packages. | ||
/// </summary> | ||
/// <param name="singleFileComponentRecorder">The component recorder for file that is been processed.</param> | ||
/// <param name="initialPackages">The initial list of packages.</param> | ||
/// <returns>The root packages, with dependencies associated as children.</returns> | ||
Task<IList<PipGraphNode>> ResolveRootsAsync(ISingleFileComponentRecorder singleFileComponentRecorder, IList<PipDependencySpecification> initialPackages); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/Microsoft.ComponentDetection.Detectors/pip/PythonResolverState.cs
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,16 @@ | ||
namespace Microsoft.ComponentDetection.Detectors.Pip; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
public class PythonResolverState | ||
{ | ||
public IDictionary<string, SortedDictionary<string, IList<PythonProjectRelease>>> ValidVersionMap { get; } | ||
= new Dictionary<string, SortedDictionary<string, IList<PythonProjectRelease>>>(StringComparer.OrdinalIgnoreCase); | ||
|
||
public Queue<(string PackageName, PipDependencySpecification Package)> ProcessingQueue { get; } = new Queue<(string, PipDependencySpecification)>(); | ||
|
||
public IDictionary<string, PipGraphNode> NodeReferences { get; } = new Dictionary<string, PipGraphNode>(StringComparer.OrdinalIgnoreCase); | ||
|
||
public IList<PipGraphNode> Roots { get; } = new List<PipGraphNode>(); | ||
} |
Oops, something went wrong.