|
1 | | -# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved. |
| 1 | +# Copyright (c) 2024 - 2025, Oracle and/or its affiliates. All rights reserved. |
2 | 2 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. |
3 | 3 |
|
4 | 4 | """The heuristic analyzer to check for an anomalistic package version.""" |
@@ -27,11 +27,32 @@ class AnomalisticVersionAnalyzer(BaseHeuristicAnalyzer): |
27 | 27 | If the version does not adhere to PyPI standards (PEP 440, as per the 'packaging' module), this heuristic |
28 | 28 | cannot analyze it. |
29 | 29 |
|
30 | | - Calendar versioning is detected as version numbers with the major value as the year (either yyyy or yy), |
31 | | - the minor as the month, and the micro as the day (+/- 2 days), with no further values. |
| 30 | + Calendar versioning is detected as version numbers with the year, month and day present in the following combinations: |
| 31 | + (using the example 11th October 2016) |
| 32 | + - YYYY.MM.DD, e.g. 2016.10.11 |
| 33 | + - YYYY.DD.MM, e.g. 2016.11.10 |
| 34 | + - YY.DD.MM, e.g. 16.11.10 |
| 35 | + - YY.MM.DD, e.g. 16.10.11 |
| 36 | + - MM.DD.YYYY, e.g. 10.11.2016 |
| 37 | + - DD.MM.YYYY, e.g. 11.10.2016 |
| 38 | + - DD.MM.YY, e.g. 11.10.16 |
| 39 | + - MM.DD.YY, e.g. 10.11.16 |
| 40 | + - YYYYMMDD, e.g. 20161011 |
| 41 | + - YYYYDDMM, e.g. 20161110 |
| 42 | + - YYDDMM, e.g. 161110 |
| 43 | + - YYMMDD, e.g. 161011 |
| 44 | + - MMDDYYYY, e.g. 10112016 |
| 45 | + - DDMMYYYY, e.g. 11102016 |
| 46 | + - DDMMYY, e.g. 111016 |
| 47 | + - MMDDYY, e.g. 101116 |
| 48 | + This may be followed by further versioning (e.g. 2016.10.11.5.6.2). This type of versioning is detected based on the |
| 49 | + date of the upload time for the release within a threshold of a number of days (in the defaults file). |
32 | 50 |
|
33 | 51 | Calendar-semantic versioning is detected as version numbers with the major value as the year (either yyyy or yy), |
34 | | - and any other series of numbers following it. |
| 52 | + and any other series of numbers following it: |
| 53 | + - 2016.7.1 woud be version 7.1 of 2016 |
| 54 | + - 16.1.4 would be version 1.4 of 2016 |
| 55 | + This type of versioning is detected based on the exact year of the upload time for the release. |
35 | 56 |
|
36 | 57 | All other versionings are detected as semantic versioning. |
37 | 58 | """ |
|
0 commit comments