From cafee09a901be684d083111ff4483cbd93faa507 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 21 May 2026 01:32:44 +0200 Subject: [PATCH] black: 25.1.0 -> 26.5.1 https://github.com/psf/black/blob/26.5.1/CHANGES.md --- .../python-modules/black/default.nix | 48 ++++++------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/pkgs/development/python-modules/black/default.nix b/pkgs/development/python-modules/black/default.nix index ea56257d981f..ee547c137c06 100644 --- a/pkgs/development/python-modules/black/default.nix +++ b/pkgs/development/python-modules/black/default.nix @@ -2,8 +2,7 @@ stdenv, lib, buildPythonPackage, - fetchPypi, - fetchpatch, + fetchFromGitHub, pytestCheckHook, aiohttp, click, @@ -17,50 +16,36 @@ pathspec, parameterized, platformdirs, + pytokens, tokenize-rt, uvloop, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "black"; - version = "25.1.0"; + version = "26.5.1"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-M0ltXNEiKtczkTUrSujaFSU8Xeibk6gLPiyNmhnsJmY="; + src = fetchFromGitHub { + owner = "psf"; + repo = "black"; + tag = finalAttrs.version; + hash = "sha256-xALg9ta0U2V6i/b7VYiPKu0oNnHfg9T+XuK3CvqJmjs="; }; - patches = [ - (fetchpatch { - name = "click-8.2-compat-1.patch"; - url = "https://github.com/psf/black/commit/14e1de805a5d66744a08742cad32d1660bf7617a.patch"; - hash = "sha256-fHRlMetE6+09MKkuFNQQr39nIKeNrqwQuBNqfIlP4hc="; - }) - (fetchpatch { - name = "click-8.2-compat-2.patch"; - url = "https://github.com/psf/black/commit/ed64d89faa7c738c4ba0006710f7e387174478af.patch"; - hash = "sha256-df/J6wiRqtnHk3mAY3ETiRR2G4hWY1rmZMfm2rjP2ZQ="; - }) - (fetchpatch { - name = "click-8.2-compat-3.patch"; - url = "https://github.com/psf/black/commit/b0f36f5b4233ef4cf613daca0adc3896d5424159.patch"; - hash = "sha256-SGLCxbgrWnAi79IjQOb2H8mD/JDbr2SGfnKyzQsJrOA="; - }) - ]; - - nativeBuildInputs = [ + build-system = [ hatch-fancy-pypi-readme hatch-vcs hatchling ]; - propagatedBuildInputs = [ + dependencies = [ click mypy-extensions packaging pathspec platformdirs + pytokens ]; optional-dependencies = { @@ -81,7 +66,7 @@ buildPythonPackage rec { pytestCheckHook parameterized ] - ++ lib.concatAttrValues optional-dependencies; + ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies; pytestFlags = [ "-Wignore::DeprecationWarning" @@ -102,9 +87,6 @@ buildPythonPackage rec { disabledTests = [ # requires network access "test_gen_check_output" - # broken on Python 3.13.4 - # FIXME: remove this when fixed upstream - "test_simple_format[pep_701]" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # fails on darwin @@ -119,7 +101,7 @@ buildPythonPackage rec { meta = { description = "Uncompromising Python code formatter"; homepage = "https://github.com/psf/black"; - changelog = "https://github.com/psf/black/blob/${version}/CHANGES.md"; + changelog = "https://github.com/psf/black/blob/${finalAttrs.src.tag}/CHANGES.md"; license = lib.licenses.mit; mainProgram = "black"; maintainers = with lib.maintainers; [ @@ -127,4 +109,4 @@ buildPythonPackage rec { autophagy ]; }; -} +})