summary refs log tree commit diff
path: root/pkgs/development/python-modules/tinycss2/default.nix
blob: 5e6f441d3d3bde9a44b0f93fc1f437723319f0d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, webencodings
, pytestCheckHook
, flit-core
}:

buildPythonPackage rec {
  pname = "tinycss2";
  version = "1.2.1";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "kozea";
    repo = "tinycss2";
    rev = "refs/tags/v${version}";
    # for tests
    fetchSubmodules = true;
    hash = "sha256-rJtxMmW30NK+E+Dhh/fu6FPrEojWWdoEWNt0raYEubs=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "'pytest-cov', 'pytest-flake8', 'pytest-isort', 'coverage[toml]'" "" \
      --replace "--isort --flake8 --cov --no-cov-on-fail" ""
  '';

  nativeBuildInputs = [ flit-core ];

  propagatedBuildInputs = [ webencodings ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = with lib; {
    description = "Low-level CSS parser for Python";
    homepage = "https://github.com/Kozea/tinycss2";
    license = licenses.bsd3;
    maintainers = with maintainers; [ onny ];
  };
}