1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, webencodings
6, pytestCheckHook
7, flit-core
8}:
9
10buildPythonPackage rec {
11 pname = "tinycss2";
12 version = "1.1.1";
13 format = "flit";
14
15 disabled = pythonOlder "3.6";
16
17 src = fetchFromGitHub {
18 owner = "kozea";
19 repo = "tinycss2";
20 rev = "v${version}";
21 # for tests
22 fetchSubmodules = true;
23 sha256 = "sha256-RUF/3cjNgDFofoxl9iKY3u5ZAVVQmXu2Qbb5U4brdcQ=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace "'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'" "" \
29 --replace "--isort --flake8 --cov --no-cov-on-fail" ""
30 '';
31
32 nativeBuildInputs = [ flit-core ];
33
34 propagatedBuildInputs = [ webencodings ];
35
36 checkInputs = [ pytestCheckHook ];
37
38 meta = with lib; {
39 description = "Low-level CSS parser for Python";
40 homepage = "https://github.com/Kozea/tinycss2";
41 license = licenses.bsd3;
42 maintainers = with maintainers; [ onny ];
43 };
44}