2018-07-23 17:45:58 +02:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
|
2019-04-03 18:09:04 +02:00
|
|
|
, attrs, click, toml, appdirs, aiohttp, aiohttp-cors
|
2018-07-23 17:45:58 +02:00
|
|
|
, glibcLocales, pytest }:
|
2018-04-05 09:11:53 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "black";
|
2019-04-02 12:46:17 +02:00
|
|
|
version = "19.3b0";
|
2018-04-05 09:11:53 +02:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-04-02 12:46:17 +02:00
|
|
|
sha256 = "073kd5rs02lisp6n3h7yai9lix520xnaa6c7rdmp2sci9pyhz5b8";
|
2018-04-05 09:11:53 +02:00
|
|
|
};
|
|
|
|
|
2018-07-23 17:45:58 +02:00
|
|
|
checkInputs = [ pytest glibcLocales ];
|
|
|
|
|
2019-06-24 16:13:43 +02:00
|
|
|
# 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;
|
|
|
|
|
2019-01-13 21:22:24 +01:00
|
|
|
# Don't know why these tests fails
|
2018-07-23 17:45:58 +02:00
|
|
|
checkPhase = ''
|
2019-01-13 21:22:24 +01:00
|
|
|
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
|
2018-07-23 17:45:58 +02:00
|
|
|
'';
|
|
|
|
|
2019-04-03 18:09:04 +02:00
|
|
|
propagatedBuildInputs = [ attrs appdirs click toml aiohttp aiohttp-cors ];
|
2018-04-05 09:11:53 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "The uncompromising Python code formatter";
|
|
|
|
homepage = https://github.com/ambv/black;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ sveitser ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|