depcheck: Add functionality to disable autoupdate for packages

This commit is contained in:
2021-12-21 16:15:12 +01:00
parent a3ccea9dcb
commit 1a1231b672

View File

@@ -10,6 +10,10 @@ import tomlkit
INDEX_DIR = "crates.io-index" INDEX_DIR = "crates.io-index"
AUTOUPDATE_DISABLED = [
"clap",
]
if os.path.exists(INDEX_DIR): if os.path.exists(INDEX_DIR):
subprocess.run( subprocess.run(
["git", "pull", "--depth=1", "origin"], ["git", "pull", "--depth=1", "origin"],
@@ -53,6 +57,13 @@ for tier in ["dependencies", "dev-dependencies"]:
latest_version = version latest_version = version
if latest_version != current_version: if latest_version != current_version:
if name in AUTOUPDATE_DISABLED:
print(
f"{name} {current_version}: There is a new version available "
f"({latest_version}, current {current_version}), but autoupdating "
f"is explictly disabled for {name}"
)
continue
update_necessary = True update_necessary = True
if latest_version < current_version: if latest_version < current_version:
print( print(