aboutcode-org / aboutcode-org/univers

NuGet isn't strictly SemVer

Đang mở
#38 5 bình luận 3 reaction 0 người được giao Xem trên GitHub
2-next bug easy good first issue
Ngôn ngữ chính
Python
Star
50
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Similar to #5 (thank you so much for fixing it!!), it looks like NuGet is also assumed to be SemVer: https://github.com/nexB/univers/blob/21864169341c4949bd40c931cd8450488de24d64/src/univers/versions.py#L266

However, [NuGet's documentation](https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#where-nugetversion-diverges-from-semantic-versioning) shows list important differences:

> NuGetVersion supports a 4th version segment, Revision, to be compatible with, or a superset of, [System.Version](https://docs.microsoft.com/en-us/dotnet/api/system.version). Therefore, excluding prerelease and metadata labels, a version string is Major.Minor.Patch.Revision. As per version normalization described above, if Revision is zero, it is omit from the normalized version string.
>
> NuGetVersion only requires the major segment to be defined. All others are optional, and are equivalent to zero. This means that 1, 1.0, 1.0.0, and 1.0.0.0 are all accepted and equal.
>
> NuGetVersion uses case insenstive string comparisons for pre-release components. This means that 1.0.0-alpha and 1.0.0-Alpha are equal.

The current implementation does not follow these rules:
```
> NugetVersion('1.0.0.0') < 'NugetVersion('1.0.0.1')
> False
```

```
>>> NugetVersion('1.0.0-Alpha') == NugetVersion('1.0.0-alpha')
False
```

Nuget's implementation appears to be here: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Versioning/NuGetVersion.cs

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.