diff options
Diffstat (limited to 'pkgs/development/python-modules/black/default.nix')
-rw-r--r-- | pkgs/development/python-modules/black/default.nix | 133 |
1 files changed, 69 insertions, 64 deletions
diff --git a/pkgs/development/python-modules/black/default.nix b/pkgs/development/python-modules/black/default.nix index ec11de747c1e5..158d0698aaef9 100644 --- a/pkgs/development/python-modules/black/default.nix +++ b/pkgs/development/python-modules/black/default.nix @@ -1,37 +1,38 @@ -{ stdenv -, lib -, buildPythonPackage -, fetchPypi -, pythonOlder -, pytestCheckHook -, aiohttp -, click -, colorama -, hatch-fancy-pypi-readme -, hatch-vcs -, hatchling -, ipython -, mypy-extensions -, packaging -, pathspec -, parameterized -, platformdirs -, tokenize-rt -, tomli -, typing-extensions -, uvloop +{ + stdenv, + lib, + buildPythonPackage, + fetchPypi, + pythonOlder, + pytestCheckHook, + aiohttp, + click, + colorama, + hatch-fancy-pypi-readme, + hatch-vcs, + hatchling, + ipython, + mypy-extensions, + packaging, + pathspec, + parameterized, + platformdirs, + tokenize-rt, + tomli, + typing-extensions, + uvloop, }: buildPythonPackage rec { pname = "black"; - version = "24.3.0"; + version = "24.4.0"; format = "pyproject"; disabled = pythonOlder "3.8"; src = fetchPypi { inherit pname version; - hash = "sha256-oMnEoHca/GkZV4zscc6Co+MeBUkE5xl96svJOCZxxB8="; + hash = "sha256-8Htp/aIFeDZ+rrvWcP+PxlOrGB4f+V2ESX+fog59BkE="; }; nativeBuildInputs = [ @@ -40,27 +41,23 @@ buildPythonPackage rec { hatchling ]; - propagatedBuildInputs = [ - click - mypy-extensions - packaging - pathspec - platformdirs - ] ++ lib.optionals (pythonOlder "3.11") [ - tomli - typing-extensions - ]; + propagatedBuildInputs = + [ + click + mypy-extensions + packaging + pathspec + platformdirs + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + typing-extensions + ]; passthru.optional-dependencies = { - colorama = [ - colorama - ]; - d = [ - aiohttp - ]; - uvloop = [ - uvloop - ]; + colorama = [ colorama ]; + d = [ aiohttp ]; + uvloop = [ uvloop ]; jupyter = [ ipython tokenize-rt @@ -77,30 +74,35 @@ buildPythonPackage rec { ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); pytestFlagsArray = [ - "-W" "ignore::DeprecationWarning" + "-W" + "ignore::DeprecationWarning" ]; - preCheck = '' - export PATH="$PATH:$out/bin" + preCheck = + '' + export PATH="$PATH:$out/bin" - # The top directory /build matches black's DEFAULT_EXCLUDE regex. - # Make /build the project root for black tests to avoid excluding files. - touch ../.git - '' + lib.optionalString stdenv.isDarwin '' - # Work around https://github.com/psf/black/issues/2105 - export TMPDIR="/tmp" - ''; + # The top directory /build matches black's DEFAULT_EXCLUDE regex. + # Make /build the project root for black tests to avoid excluding files. + touch ../.git + '' + + lib.optionalString stdenv.isDarwin '' + # Work around https://github.com/psf/black/issues/2105 + export TMPDIR="/tmp" + ''; - disabledTests = [ - # requires network access - "test_gen_check_output" - ] ++ lib.optionals stdenv.isDarwin [ - # fails on darwin - "test_expression_diff" - # Fail on Hydra, see https://github.com/NixOS/nixpkgs/pull/130785 - "test_bpo_2142_workaround" - "test_skip_magic_trailing_comma" - ]; + disabledTests = + [ + # requires network access + "test_gen_check_output" + ] + ++ lib.optionals stdenv.isDarwin [ + # fails on darwin + "test_expression_diff" + # Fail on Hydra, see https://github.com/NixOS/nixpkgs/pull/130785 + "test_bpo_2142_workaround" + "test_skip_magic_trailing_comma" + ]; # multiple tests exceed max open files on hydra builders doCheck = !(stdenv.isLinux && stdenv.isAarch64); @@ -110,6 +112,9 @@ buildPythonPackage rec { changelog = "https://github.com/psf/black/blob/${version}/CHANGES.md"; license = licenses.mit; mainProgram = "black"; - maintainers = with maintainers; [ sveitser autophagy ]; + maintainers = with maintainers; [ + sveitser + autophagy + ]; }; } |