Return a version number from `subject_line` `subject_line` is the `Subject` field from the output of `msiinfo suminfo `. This string sometimes contains the version number of the package contained in the MSI installer.
(subject_line)
| 103 | |
| 104 | |
| 105 | def get_version_from_subject_line(subject_line): |
| 106 | """ |
| 107 | Return a version number from `subject_line` |
| 108 | |
| 109 | `subject_line` is the `Subject` field from the output of |
| 110 | `msiinfo suminfo <msi installer file>`. This string sometimes contains |
| 111 | the version number of the package contained in the MSI installer. |
| 112 | """ |
| 113 | for pattern in VERSION_PATTERNS_REGEX(): |
| 114 | version = re.search(pattern, subject_line) |
| 115 | if version: |
| 116 | v = version.group(0) |
| 117 | # prefix with v space |
| 118 | if not v.lower().startswith('v'): |
| 119 | v = f'v {v}' |
| 120 | return v |
| 121 | |
| 122 | |
| 123 | def create_package_data_from_msiinfo_results( |
no test coverage detected