Commit 714592d
authored
fix: download upper-bound-only Python ranges (#1148)
* fix: install the highest allowed version for upper-bound-only ranges
An upper-bound-only range such as "<3.14" had no installable floor, so
--download-python could not help. Pick the highest X.Y below the
tightest upper bound, and step down past "!=" exclusions.
Assisted-by: ClaudeCode:claude-fable-5
* fix: never pick a minor whose patch releases can exceed an upper bound
An install target "X.Y" resolves to the latest X.Y patch release, so
bounds like "<3.14.4" or "<=3.14" could install an interpreter outside
the range once a newer patch exists (and discovery, which matches with
strict PEP 440 semantics, would then never find it). Always step down to
the minor below the bound, which every patch release satisfies.
Assisted-by: ClaudeCode:claude-fable-5
* refactor: simplify upper-bound target resolution
Return (major, minor) tuples from _highest_under_upper_bound instead of
strings the caller re-parses, and derive the free-threaded "t" suffix
once up front. Also fixes two edge cases: mixed specs like <3.13,<3.14t
no longer drop the "t", and clauses packaging cannot parse (<3.14,<3.12.)
return None instead of raising InvalidSpecifier.
Assisted-by: ClaudeCode:claude-fable-51 parent 22d4ada commit 714592d
3 files changed
Lines changed: 116 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
193 | 219 | | |
194 | 220 | | |
195 | 221 | | |
196 | 222 | | |
197 | 223 | | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
203 | 231 | | |
204 | 232 | | |
205 | 233 | | |
206 | 234 | | |
207 | 235 | | |
208 | 236 | | |
| 237 | + | |
| 238 | + | |
209 | 239 | | |
210 | 240 | | |
211 | | - | |
212 | | - | |
213 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
214 | 271 | | |
215 | 272 | | |
216 | 273 | | |
| |||
865 | 922 | | |
866 | 923 | | |
867 | 924 | | |
868 | | - | |
869 | | - | |
870 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
871 | 929 | | |
872 | 930 | | |
873 | 931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
1310 | | - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1311 | 1329 | | |
1312 | 1330 | | |
1313 | 1331 | | |
| |||
1816 | 1834 | | |
1817 | 1835 | | |
1818 | 1836 | | |
1819 | | - | |
1820 | | - | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1821 | 1842 | | |
1822 | 1843 | | |
1823 | 1844 | | |
1824 | 1845 | | |
1825 | 1846 | | |
1826 | 1847 | | |
1827 | 1848 | | |
1828 | | - | |
| 1849 | + | |
1829 | 1850 | | |
1830 | 1851 | | |
1831 | 1852 | | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1832 | 1874 | | |
1833 | 1875 | | |
1834 | 1876 | | |
| |||
0 commit comments