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