1{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
2, attrs, click, toml, appdirs
3, glibcLocales, pytest }:
4
5buildPythonPackage rec {
6 pname = "black";
7 version = "18.6b4";
8
9 disabled = pythonOlder "3.6";
10
11 src = fetchPypi {
12 inherit pname version;
13 sha256 = "0i4sfqgz6w15vd50kbhi7g7rifgqlf8yfr8y78rypd56q64qn592";
14 };
15
16 checkInputs = [ pytest glibcLocales ];
17
18 checkPhase = ''
19 # no idea, why those fail.
20 LC_ALL="en_US.UTF-8" HOME="$NIX_BUILD_TOP" \
21 pytest \
22 -k "not test_cache_multiple_files and not test_failed_formatting_does_not_get_cached"
23 '';
24
25 propagatedBuildInputs = [ attrs appdirs click toml ];
26
27 meta = with stdenv.lib; {
28 description = "The uncompromising Python code formatter";
29 homepage = https://github.com/ambv/black;
30 license = licenses.mit;
31 maintainers = with maintainers; [ sveitser ];
32 };
33
34}