From 9f34d76b4a297aa31d6f95858f77e1c5f8ee8569 Mon Sep 17 00:00:00 2001 From: Rebai Mohamed Date: Tue, 5 Aug 2025 20:40:05 +0100 Subject: [PATCH] Revert "ci(pre-commit): enforce presence of 'upload-time' field in uv.lock" This reverts commit e99bf60288d12cbdcacff2d849dcb71aa970a98c. --- .pre-commit-config.yaml | 8 -------- scripts/check-upload-time.py | 37 ------------------------------------ 2 files changed, 45 deletions(-) delete mode 100644 scripts/check-upload-time.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b1b9cd79..a1acdbe84 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -155,14 +155,6 @@ repos: require_serial: true files: ^.github/workflows/.*$ -- repo: local - hooks: - - id: check-uv-upload-time - name: Check upload-time in uv.lock - entry: python3 ./scripts/check_uv_upload_time.py - language: system - files: ^uv\.lock$ - ci: autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate diff --git a/scripts/check-upload-time.py b/scripts/check-upload-time.py deleted file mode 100644 index b0c3f74ea..000000000 --- a/scripts/check-upload-time.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import re -import sys - - -def check_upload_time_regex(file_content): - sdist_pattern = re.compile(r'sdist\s*=\s*\{[^}]*upload-time\s*=\s*".*?"[^}]*\}', re.DOTALL) - sdist_found = bool(sdist_pattern.search(file_content)) - return sdist_found - - -def main(): - try: - with open("uv.lock", encoding="utf-8") as f: - content = f.read() - except Exception as e: - print(f"Error reading uv.lock: {e}") - sys.exit(1) - - if not check_upload_time_regex(content): - print( - "It looks like you're using an old version of uv. " - "The lock file does not include upload-time fields for the packages. " - "Please update uv and regenerate the lock file" - ) - sys.exit(1) - - sys.exit(0) - - -if __name__ == "__main__": - main()