|
140 | 140 | f"then update {_package_label}.", |
141 | 141 | FutureWarning) |
142 | 142 |
|
143 | | - def parse_version_to_tuple(version_string: str) -> ParsedVersion: # pragma: NO COVER |
144 | | - """Safely converts a semantic version string to a comparable tuple of integers. |
145 | | - Example: "4.25.8" -> (4, 25, 8) |
146 | | - Ignores non-numeric parts and handles common version formats. |
147 | | - Args: |
148 | | - version_string: Version string in the format "x.y.z" or "x.y.z<suffix>" |
149 | | - Returns: |
150 | | - Tuple of integers for the parsed version string. |
151 | | - """ |
152 | | - parts = [] |
153 | | - for part in version_string.split("."): |
154 | | - try: |
155 | | - parts.append(int(part)) |
156 | | - except ValueError: |
157 | | - # If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here. |
158 | | - # This is a simplification compared to 'packaging.parse_version', but sufficient |
159 | | - # for comparing strictly numeric semantic versions. |
160 | | - break |
161 | | - return tuple(parts) |
| 143 | + def parse_version_to_tuple(version_string: str) -> ParsedVersion: # pragma: NO COVER |
| 144 | + """Safely converts a semantic version string to a comparable tuple of integers. |
| 145 | + Example: "4.25.8" -> (4, 25, 8) |
| 146 | + Ignores non-numeric parts and handles common version formats. |
| 147 | + Args: |
| 148 | + version_string: Version string in the format "x.y.z" or "x.y.z<suffix>" |
| 149 | + Returns: |
| 150 | + Tuple of integers for the parsed version string. |
| 151 | + """ |
| 152 | + parts = [] |
| 153 | + for part in version_string.split("."): |
| 154 | + try: |
| 155 | + parts.append(int(part)) |
| 156 | + except ValueError: |
| 157 | + # If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here. |
| 158 | + # This is a simplification compared to 'packaging.parse_version', but sufficient |
| 159 | + # for comparing strictly numeric semantic versions. |
| 160 | + break |
| 161 | + return tuple(parts) |
162 | 162 |
|
163 | 163 | def _get_version(dependency_name): |
164 | 164 | try: |
|
0 commit comments