git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #120684 from sveitser/python3-black-update

python3Packages.black: 20.8b1 -> 21.4b2

commit1c2986bbb806c57f9470bf3231d8da7250ab9091 authorRobert Schütz <dev@schuetz-co.de> dateTue 1 Jun 2021, 12:57 (5 years ago) parentd7550826f6270d
2 files changed+18−8
pkgs/development/python-modules/black/default.nix+8−7 pkgs/development/python-modules/pyls-black/default.nix+10−1
pkgs/development/python-modules/black/default.nix+8−7
@@ -8,6 +8,7 @@
88, dataclasses
99, mypy-extensions
1010, pathspec
11+, parameterized
1112, regex
1213, toml
1314, typed-ast
@@ -15,13 +16,13 @@
1516
1617buildPythonPackage rec {
1718 pname = "black";
18− version = "20.8b1";
19+ version = "21.5b1";
1920
2021 disabled = pythonOlder "3.6";
2122
2223 src = fetchPypi {
2324 inherit pname version;
24− sha256 = "1spv6sldp3mcxr740dh3ywp25lly9s8qlvs946fin44rl1x5a0hw";
25+ sha256 = "1cdkrl5vw26iy7s23v2zpr39m6g5xsgxhfhagzzflgfbvdc56s93";
2526 };
2627
2728 nativeBuildInputs = [ setuptools_scm ];
@@ -30,19 +31,19 @@ buildPythonPackage rec {
3031 # Black starts a local server and needs to bind a local address.
3132 __darwinAllowLocalNetworking = true;
3233
33− checkInputs = [ pytestCheckHook ];
34+ checkInputs = [ pytestCheckHook parameterized ];
3435
3536 preCheck = ''
3637 export PATH="$PATH:$out/bin"
38+
39+ # The top directory /build matches black's DEFAULT_EXCLUDE regex.
40+ # Make /build the project root for black tests to avoid excluding files.
41+ touch ../.git
3742 '';
3843
3944 disabledTests = [
40− # Don't know why these tests fails
41− "test_cache_multiple_files"
42− "test_failed_formatting_does_not_get_cached"
4345 # requires network access
4446 "test_gen_check_output"
45− "test_process_queue"
4647 ] ++ lib.optionals stdenv.isDarwin [
4748 # fails on darwin
4849 "test_expression_diff"
pkgs/development/python-modules/pyls-black/default.nix+10−1
@@ -1,4 +1,4 @@
1−{ lib, buildPythonPackage, fetchFromGitHub
1+{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
22, black, toml, pytest, python-language-server, isPy3k
33}:
44
@@ -13,6 +13,15 @@ buildPythonPackage rec {
1313 sha256 = "0cjf0mjn156qp0x6md6mncs31hdpzfim769c2lixaczhyzwywqnj";
1414 };
1515
16+ # Fix test failure with black 21.4b0+
17+ # Remove if https://github.com/rupert/pyls-black/pull/39 merged.
18+ patches = [
19+ (fetchpatch {
20+ url = "https://github.com/rupert/pyls-black/commit/728207b540d9c25eb0d1cd96419ebfda2e257f63.patch";
21+ sha256 = "0i3w5myhjl5lq1lpkizagnmk6m8fkn3igfyv5f2qcrn5n7f119ak";
22+ })
23+ ];
24+
1625 disabled = !isPy3k;
1726
1827 checkPhase = ''