mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
update-python-libraries: Allow packages to deny bulk updates
By settings `passthru.skipBulkUpdate = true` in a python package, it will be excluded from bulk update runs. This is useful in case of fragile packages, that require special attention during updates.
This commit is contained in:
parent
706cae6532
commit
4ba1db9876
@ -33,6 +33,8 @@ EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip', '.whl']
|
||||
|
||||
PRERELEASES = False
|
||||
|
||||
BULK_UPDATE = False
|
||||
|
||||
GIT = "git"
|
||||
|
||||
NIXPKGS_ROOT = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode('utf-8').strip()
|
||||
@ -152,6 +154,13 @@ def _hash_to_sri(algorithm, value):
|
||||
value
|
||||
]).decode().strip()
|
||||
|
||||
|
||||
def _skip_bulk_update(attr_name: str) -> bool:
|
||||
return bool(_get_attr_value(
|
||||
f"{attr_name}.skipBulkUpdate"
|
||||
))
|
||||
|
||||
|
||||
SEMVER = {
|
||||
'major' : 0,
|
||||
'minor' : 1,
|
||||
@ -369,6 +378,8 @@ def _update_package(path, target):
|
||||
# Attempt a fetch using each pname, e.g. backports-zoneinfo vs backports.zoneinfo
|
||||
successful_fetch = False
|
||||
for pname in pnames:
|
||||
if BULK_UPDATE and _skip_bulk_update(f"python3Packages.{pname}"):
|
||||
raise ValueError(f"Bulk update skipped for {pname}")
|
||||
try:
|
||||
new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target)
|
||||
successful_fetch = True
|
||||
@ -489,6 +500,10 @@ environment variables:
|
||||
|
||||
packages = list(map(os.path.abspath, args.package))
|
||||
|
||||
if len(packages) > 1:
|
||||
global BULK_UPDATE
|
||||
BULK_UPDATE = true
|
||||
|
||||
logging.info("Updating packages...")
|
||||
|
||||
# Use threads to update packages concurrently
|
||||
|
Loading…
Reference in New Issue
Block a user