From d47fe4915ead7d9295980aae5c61e62fe5baf109 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 9 Jan 2025 15:28:38 +0100 Subject: [PATCH 1/5] python313Packages.standard-imghdr: init at 3.13.0 --- .../standard-imghdr/default.nix | 35 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/python-modules/standard-imghdr/default.nix diff --git a/pkgs/development/python-modules/standard-imghdr/default.nix b/pkgs/development/python-modules/standard-imghdr/default.nix new file mode 100644 index 000000000000..e0b40d72d731 --- /dev/null +++ b/pkgs/development/python-modules/standard-imghdr/default.nix @@ -0,0 +1,35 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "standard-imghdr"; + version = "3.13.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "youknowone"; + repo = "python-deadlib"; + tag = "v${version}"; + hash = "sha256-vhGFTd1yXL4Frqli5D1GwOatwByDjvcP8sxgkdu6Jqg="; + }; + + sourceRoot = "${src.name}/imghdr"; + + build-system = [ setuptools ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "imghdr" ]; + + meta = { + description = "Python dead batteries. See PEP 594"; + homepage = "https://github.com/youknowone/python-deadlib"; + license = lib.licenses.psfl; + maintainers = with lib.maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0dfe1d12fb37..64ad3a159d49 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15538,6 +15538,8 @@ self: super: with self; { standard-chunk = callPackage ../development/python-modules/standard-chunk { }; + standard-imghdr = callPackage ../development/python-modules/standard-imghdr { }; + standard-telnetlib = callPackage ../development/python-modules/standard-telnetlib { }; stone = callPackage ../development/python-modules/stone { }; From 7a15743b54c6ce1a6691d9b1699d37066fb88933 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 11 Jan 2025 16:59:20 +0100 Subject: [PATCH 2/5] python3Packages: make dead batteries null on incompatible releases --- pkgs/top-level/python-packages.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 64ad3a159d49..5646b264d9ba 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1004,7 +1004,7 @@ self: super: with self; { audio-metadata = callPackage ../development/python-modules/audio-metadata { }; - audioop-lts = callPackage ../development/python-modules/audioop-lts { }; + audioop-lts = if pythonAtLeast "3.13" then callPackage ../development/python-modules/audioop-lts { } else null; audioread = callPackage ../development/python-modules/audioread { }; @@ -15534,13 +15534,13 @@ self: super: with self; { stm32loader = callPackage ../development/python-modules/stm32loader { }; - standard-aifc = callPackage ../development/python-modules/standard-aifc { }; + standard-aifc = if pythonAtLeast "3.13" then callPackage ../development/python-modules/standard-aifc { } else null; - standard-chunk = callPackage ../development/python-modules/standard-chunk { }; + standard-chunk = if pythonAtLeast "3.13" then callPackage ../development/python-modules/standard-chunk { } else null; - standard-imghdr = callPackage ../development/python-modules/standard-imghdr { }; + standard-imghdr = if pythonAtLeast "3.13" then callPackage ../development/python-modules/standard-imghdr { } else null; - standard-telnetlib = callPackage ../development/python-modules/standard-telnetlib { }; + standard-telnetlib = if pythonAtLeast "3.13" then callPackage ../development/python-modules/standard-telnetlib { } else null; stone = callPackage ../development/python-modules/stone { }; From 8f24cd47fc4f7f4f1bde0132be193a4465b98ead Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 9 Jan 2025 16:27:17 +0100 Subject: [PATCH 3/5] python313Packages.tensorboard: fix build Provides the dead battery imghdr. --- pkgs/development/python-modules/tensorboard/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/tensorboard/default.nix b/pkgs/development/python-modules/tensorboard/default.nix index d6801aa6d629..685aba22686b 100644 --- a/pkgs/development/python-modules/tensorboard/default.nix +++ b/pkgs/development/python-modules/tensorboard/default.nix @@ -12,6 +12,7 @@ absl-py, google-auth-oauthlib, setuptools, + standard-imghdr, tensorboard-data-server, tensorboard-plugin-wit, tensorboard-plugin-profile, @@ -47,6 +48,7 @@ buildPythonPackage rec { numpy protobuf setuptools + standard-imghdr tensorboard-data-server tensorboard-plugin-profile tensorboard-plugin-wit From d239e7fbb7303c1d2aa03236e5897f1bcea7173b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 9 Jan 2025 16:27:48 +0100 Subject: [PATCH 4/5] python313Packages.torch: burn the future We don't need any of these imports for compatibility. --- pkgs/development/python-modules/torch/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 0eb31d2d1f58..26c1e15207a5 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -87,7 +87,6 @@ # dependencies for torch.utils.tensorboard pillow, six, - future, tensorboard, protobuf, @@ -298,6 +297,9 @@ buildPythonPackage rec { "# Upstream: set(CUDAToolkit_ROOT" substituteInPlace third_party/gloo/cmake/Cuda.cmake \ --replace-warn "find_package(CUDAToolkit 7.0" "find_package(CUDAToolkit" + + # annotations (3.7), print_function (3.0), with_statement (2.6) are all supported + sed -i -e "/from __future__ import/d" **.py '' + lib.optionalString rocmSupport '' # https://github.com/facebookincubator/gloo/pull/297 @@ -529,7 +531,6 @@ buildPythonPackage rec { # the following are required for tensorboard support pillow six - future tensorboard protobuf From 387ca28f0022adc4ed7a4cda007d5430ea921c7a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 9 Jan 2025 16:31:41 +0100 Subject: [PATCH 5/5] python313Packages.faster-whisper: 1.1.0 -> 1.1.1 https://github.com/SYSTRAN/faster-whisper/releases/tag/v1.1.1 --- pkgs/development/python-modules/faster-whisper/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/faster-whisper/default.nix b/pkgs/development/python-modules/faster-whisper/default.nix index 6a8fcbc3df24..eda6b677fd3b 100644 --- a/pkgs/development/python-modules/faster-whisper/default.nix +++ b/pkgs/development/python-modules/faster-whisper/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "faster-whisper"; - version = "1.1.0"; + version = "1.1.1"; pyproject = true; src = fetchFromGitHub { owner = "SYSTRAN"; repo = "faster-whisper"; tag = "v${version}"; - hash = "sha256-oJBCEwTfon80XQ9XIgnRw0SLvpwX0L5jnezwG0jv3Eg="; + hash = "sha256-1j0ZNQY+P7ZflFCxKkFncJl7Rwuf3AMhzsS6CO9uLD0="; }; build-system = [