Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public async Task<SortedDictionary<string, IList<PythonProjectRelease>>> GetRele
}
catch (ArgumentException ae)
{
Logger.LogError($"Component {release.Key} : {JsonConvert.SerializeObject(release.Value)} could not be added to the sorted list of pip components. Error details follow:");
Logger.LogError($"Component {release.Key} : {JsonConvert.SerializeObject(release.Value)} could not be added to the sorted list of pip components for spec={spec.Name}. Usually this happens with unexpected PyPi version formats (e.g. prerelease/dev versions). Error details follow:");
Logger.LogException(ae, true);
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PipComponentDetector : FileComponentDetector

public override IEnumerable<ComponentType> SupportedComponentTypes { get; } = new[] { ComponentType.Pip };

public override int Version { get; } = 4;
public override int Version { get; } = 5;

[Import]
public IPythonCommandService PythonCommandService { get; set; }
Expand Down Expand Up @@ -68,7 +68,7 @@ protected override async Task OnFileFound(ProcessRequest processRequest, IDictio
.Select(tuple => new DetectedComponent(tuple.Item2))
.ToList()
.ForEach(gitComponent => singleFileComponentRecorder.RegisterUsage(gitComponent, isExplicitReferencedDependency: true));
}
}
catch (Exception e)
{
Logger.LogFailedReadingFile(file.Location, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class PythonVersion : IComparable<PythonVersion>

public int? PostNumber { get; set; }

public string DevLabel { get; set; }

public int? DevNumber { get; set; }

public bool Floating { get; set; } = false;
Expand Down Expand Up @@ -81,6 +83,12 @@ public PythonVersion(string version)
PostNumber = postRelease2;
}

if (groups["dev_l"].Success)
{
DevLabel = groups["dev_l"].Value;
DevNumber = 0;
}

if (groups["dev_n"].Success && int.TryParse(groups["dev_n"].Value, out int devNumber))
{
DevNumber = devNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public void TestPythonVersionComplexComparisons()
// This is a list of versions supplied by PEP440 for testing (minus local versions)
var versions = new List<string>
{
"1.0.dev",
"1.0.dev456",
"1.0a1",
"1.0a2.dev456",
Expand All @@ -41,12 +42,15 @@ public void TestPythonVersionComplexComparisons()
"1.0b2",
"1.0b2.post345.dev456",
"1.0b2.post345",
"1.0rc1.dev",
"1.0rc1.dev456",
"1.0rc1",
"1.0",
"1.0.post456.dev34",
"1.0.post456",
"1.1.dev",
"1.1.dev1",
"1.1",
}.Select(x => new PythonVersion(x)).ToList();

for (int i = 1; i < versions.Count; i++)
Expand Down