Lock versions of sqlfluffrs to versions of the main package. (#7218)

Co-authored-by: Alan Cruickshank <alan+git@a14k.co.uk>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Alan Cruickshank
2025-10-27 00:32:28 +00:00
committed by GitHub
parent a5fd826340
commit 366a260e08
3 changed files with 17 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ dependencies = [
]
[project.optional-dependencies]
rs = ["sqlfluffrs~=0.1.0"]
rs = ["sqlfluffrs==3.5.0"]
[project.urls]
Homepage = "https://www.sqlfluff.com"

View File

@@ -1,6 +1,6 @@
[package]
name = "sqlfluffrs"
version = "0.1.0"
version = "3.5.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

15
util.py
View File

@@ -216,6 +216,18 @@ def release(new_version_num):
write_file.write(line)
write_file.close()
click.echo("Updating sqlfluffrs/Cargo.toml")
filename = "sqlfluffrs/Cargo.toml"
# NOTE: Toml files are always encoded in UTF-8.
input_file = open(filename, "r", encoding="utf-8").readlines()
# Regardless of platform, write newlines as \n
write_file = open(filename, "w", encoding="utf-8", newline="\n")
for line in input_file:
if line.startswith("version"):
line = f'version = "{new_version_num}"\n'
write_file.write(line)
write_file.close()
keys = ["version"]
if not is_pre_release:
# Only update stable_version if it's not a pre-release.
@@ -232,6 +244,9 @@ def release(new_version_num):
# For pyproject.toml we quote the version identifier.
line = f'{key} = "{new_version_num}"\n'
break
# Update sqlfluffrs dependency version
if line.startswith('rs = ["sqlfluffrs'):
line = f'rs = ["sqlfluffrs=={new_version_num}"]\n'
write_file.write(line)
write_file.close()