@@ -63,6 +63,9 @@ def _only_major_version(version: str) -> str:
63
63
WASM_PACK_GA_VERSION = ReplaceRegex (r"wasm-pack-version: [0-9.]+" , "wasm-pack-version: {version}" )
64
64
PYTHON_DOCKER_VERSION = ReplaceRegex (r"python:\d.\d+" , hide_patch_version ("python:{version}" ))
65
65
PYTHON_SMALL_VERSION = ReplaceRegex (r"python\d.\d+" , hide_patch_version ("python{version}" ))
66
+ PYPROJECT_PYTHON_VERSION = ReplaceRegex (
67
+ r'requires-python = "~=.*"' , 'requires-python = "~={version}"'
68
+ )
66
69
TOML_LICENSE_FIELD = ReplaceRegex (r'license = ".*"' , 'license = "{version}"' )
67
70
TOML_VERSION_FIELD = ReplaceRegex (r'version = ".*"' , 'version = "{version}"' )
68
71
JSON_LICENSE_FIELD = ReplaceRegex (r'"license": ".*"' , '"license": "{version}"' )
@@ -326,16 +329,11 @@ def set_tool_version(tool: Tool, version: str) -> None:
326
329
ReplaceRegex (r"Rust v[0-9.]+" , "Rust v{version}" ),
327
330
RUSTUP_INSTALL ,
328
331
],
329
- Tool .Python : [
330
- ReplaceRegex (r"python v[0-9.]+" , hide_patch_version ("python v{version}" )),
331
- ReplaceRegex (r"pyenv install [0-9.]+" , "pyenv install {version}" ),
332
- ReplaceRegex (r"pyenv prefix [0-9.]+" , "pyenv prefix {version}" ),
333
- ],
334
332
Tool .Uv : [
335
333
ReplaceRegex (r"uv >=[0-9.]+" , "uv >={version}" ),
336
334
ReplaceRegex (
337
- r"curl -LsSf https://astral\.sh/uv/.*/install\.sh | sh" ,
338
- "curl -LsSf https://astral.sh/uv/{version}/install.sh" ,
335
+ r"https://astral\.sh/uv/.*/install\.sh" ,
336
+ "https://astral.sh/uv/{version}/install.sh" ,
339
337
),
340
338
],
341
339
Tool .Node : [
@@ -399,9 +397,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
399
397
ROOT_DIR / "docs/conf.py" : {
400
398
Tool .Parsec : [ReplaceRegex (r'version = ".*"' , 'version = "{version}"' )]
401
399
},
402
- ROOT_DIR / "docs/pyproject.toml" : {
403
- Tool .Python : [ReplaceRegex (r'^python = "\^[0-9.]+"$' , 'python = "^{version}"' )]
404
- },
400
+ ROOT_DIR / "docs/pyproject.toml" : {Tool .Python : [PYPROJECT_PYTHON_VERSION ]},
405
401
ROOT_DIR / "libparsec/version" : {Tool .Parsec : [ReplaceRegex (r"^.*$" , "{version}" )]},
406
402
ROOT_DIR / "LICENSE" : {
407
403
Tool .Parsec : [
@@ -419,8 +415,8 @@ def set_tool_version(tool: Tool, version: str) -> None:
419
415
Tool .Rust : [RUSTUP_INSTALL ],
420
416
Tool .Uv : [
421
417
ReplaceRegex (
422
- r"curl -LsSf https://astral\.sh/uv/.*/install\.sh | sh" ,
423
- "curl -LsSf https://astral.sh/uv/{version}/install.sh" ,
418
+ r"https://astral\.sh/uv/.*/install\.sh" ,
419
+ "https://astral.sh/uv/{version}/install.sh" ,
424
420
)
425
421
],
426
422
},
@@ -430,8 +426,8 @@ def set_tool_version(tool: Tool, version: str) -> None:
430
426
Tool .Python : [PYTHON_SMALL_VERSION ],
431
427
Tool .Uv : [
432
428
ReplaceRegex (
433
- r"curl -LsSf https://astral\.sh/uv/.*/install\.sh | sh" ,
434
- "curl -LsSf https://astral.sh/uv/{version}/install.sh" ,
429
+ r"https://astral\.sh/uv/.*/install\.sh" ,
430
+ "https://astral.sh/uv/{version}/install.sh" ,
435
431
)
436
432
],
437
433
},
@@ -450,7 +446,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
450
446
r'"Programming Language :: Python :: .*"' ,
451
447
hide_patch_version ('"Programming Language :: Python :: {version}"' ),
452
448
),
453
- ReplaceRegex ( r'python = "~.*"' , 'python = "~{version}"' ) ,
449
+ PYPROJECT_PYTHON_VERSION ,
454
450
ReplaceRegex (
455
451
r'build = "cp\d+-{manylinux,macos,win}\*"' ,
456
452
hide_patch_version ('build = "cp{version}-{{manylinux,macos,win}}*"' , separator = "" ),
0 commit comments