1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, setuptools-scm
6, toml
7, importlib-metadata
8, cssselect
9, lxml
10, mock
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "cssutils";
16 version = "2.3.0";
17
18 disabled = pythonOlder "3.6";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "sha256-stOxYEfKroLlxZADaTW6+htiHPRcLziIWvS+SDjw/QA=";
23 };
24
25 nativeBuildInputs = [
26 setuptools-scm
27 toml
28 ];
29
30 propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
31 importlib-metadata
32 ];
33
34 checkInputs = [
35 cssselect
36 lxml
37 mock
38 pytestCheckHook
39 ];
40
41 disabledTests = [
42 # access network
43 "test_parseUrl"
44 "encutils"
45 "website.logging"
46 ] ++ lib.optionals (pythonOlder "3.9") [
47 # AttributeError: module 'importlib.resources' has no attribute 'files'
48 "test_parseFile"
49 "test_parseString"
50 "test_combine"
51 ];
52
53 pythonImportsCheck = [ "cssutils" ];
54
55 meta = with lib; {
56 description = "A CSS Cascading Style Sheets library for Python";
57 homepage = "https://github.com/jaraco/cssutils";
58 changelog = "https://github.com/jaraco/cssutils/blob/v${version}/CHANGES.rst";
59 license = licenses.lgpl3Plus;
60 maintainers = with maintainers; [ dotlambda ];
61 };
62}