mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 08:33:54 +00:00
13702bd491
Fixes #63722
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
|
|
, attrs, click, toml, appdirs, aiohttp, aiohttp-cors
|
|
, glibcLocales, pytest }:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "black";
|
|
version = "19.3b0";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "073kd5rs02lisp6n3h7yai9lix520xnaa6c7rdmp2sci9pyhz5b8";
|
|
};
|
|
|
|
checkInputs = [ pytest glibcLocales ];
|
|
|
|
# Necessary for the tests to pass on Darwin with sandbox enabled.
|
|
# Black starts a local server and needs to bind a local address.
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
# Don't know why these tests fails
|
|
checkPhase = ''
|
|
LC_ALL="en_US.UTF-8" pytest \
|
|
--deselect tests/test_black.py::BlackTestCase::test_expression_diff \
|
|
--deselect tests/test_black.py::BlackTestCase::test_cache_multiple_files \
|
|
--deselect tests/test_black.py::BlackTestCase::test_failed_formatting_does_not_get_cached
|
|
'';
|
|
|
|
propagatedBuildInputs = [ attrs appdirs click toml aiohttp aiohttp-cors ];
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "The uncompromising Python code formatter";
|
|
homepage = https://github.com/ambv/black;
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ sveitser ];
|
|
};
|
|
|
|
}
|