@@ -63,6 +63,9 @@ def _only_major_version(version: str) -> str:
6363WASM_PACK_GA_VERSION = ReplaceRegex (r"wasm-pack-version: [0-9.]+" , "wasm-pack-version: {version}" )
6464PYTHON_DOCKER_VERSION = ReplaceRegex (r"python:\d.\d+" , hide_patch_version ("python:{version}" ))
6565PYTHON_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+ )
6669TOML_LICENSE_FIELD = ReplaceRegex (r'license = ".*"' , 'license = "{version}"' )
6770TOML_VERSION_FIELD = ReplaceRegex (r'version = ".*"' , 'version = "{version}"' )
6871JSON_LICENSE_FIELD = ReplaceRegex (r'"license": ".*"' , '"license": "{version}"' )
@@ -326,16 +329,11 @@ def set_tool_version(tool: Tool, version: str) -> None:
326329 ReplaceRegex (r"Rust v[0-9.]+" , "Rust v{version}" ),
327330 RUSTUP_INSTALL ,
328331 ],
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- ],
334332 Tool .Uv : [
335333 ReplaceRegex (r"uv >=[0-9.]+" , "uv >={version}" ),
336334 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" ,
339337 ),
340338 ],
341339 Tool .Node : [
@@ -399,9 +397,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
399397 ROOT_DIR / "docs/conf.py" : {
400398 Tool .Parsec : [ReplaceRegex (r'version = ".*"' , 'version = "{version}"' )]
401399 },
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 ]},
405401 ROOT_DIR / "libparsec/version" : {Tool .Parsec : [ReplaceRegex (r"^.*$" , "{version}" )]},
406402 ROOT_DIR / "LICENSE" : {
407403 Tool .Parsec : [
@@ -419,8 +415,8 @@ def set_tool_version(tool: Tool, version: str) -> None:
419415 Tool .Rust : [RUSTUP_INSTALL ],
420416 Tool .Uv : [
421417 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" ,
424420 )
425421 ],
426422 },
@@ -430,8 +426,8 @@ def set_tool_version(tool: Tool, version: str) -> None:
430426 Tool .Python : [PYTHON_SMALL_VERSION ],
431427 Tool .Uv : [
432428 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" ,
435431 )
436432 ],
437433 },
@@ -450,7 +446,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
450446 r'"Programming Language :: Python :: .*"' ,
451447 hide_patch_version ('"Programming Language :: Python :: {version}"' ),
452448 ),
453- ReplaceRegex ( r'python = "~.*"' , 'python = "~{version}"' ) ,
449+ PYPROJECT_PYTHON_VERSION ,
454450 ReplaceRegex (
455451 r'build = "cp\d+-{manylinux,macos,win}\*"' ,
456452 hide_patch_version ('build = "cp{version}-{{manylinux,macos,win}}*"' , separator = "" ),
0 commit comments