2021-03-12 07:09:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-01-19 23:45:15 +00:00
|
|
|
, pythonAtLeast
|
2021-03-23 19:22:30 +00:00
|
|
|
, pythonOlder
|
2022-01-19 23:45:15 +00:00
|
|
|
, fetchpatch
|
2021-03-12 07:09:13 +00:00
|
|
|
, fetchPypi
|
2021-03-23 19:22:30 +00:00
|
|
|
, setuptools-scm
|
|
|
|
, toml
|
|
|
|
, importlib-metadata
|
2021-05-29 03:34:57 +00:00
|
|
|
, cssselect
|
|
|
|
, lxml
|
2021-03-12 07:09:13 +00:00
|
|
|
, mock
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cssutils";
|
2021-05-29 03:34:57 +00:00
|
|
|
version = "2.3.0";
|
2021-03-12 07:09:13 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-05-29 03:34:57 +00:00
|
|
|
sha256 = "sha256-stOxYEfKroLlxZADaTW6+htiHPRcLziIWvS+SDjw/QA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
patches = lib.optionals (pythonAtLeast "3.10") [
|
|
|
|
# fix tests for python3.10
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/jaraco/cssutils/pull/17/commits/355b1795dde77bd4b49d8df35377230fdb503802.patch";
|
|
|
|
sha256 = "sha256-hwe8oeZO2rq00cs079lje3wjQDEczAu3Tfy/X/M9+GQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
checkInputs = [
|
2021-05-29 03:34:57 +00:00
|
|
|
cssselect
|
|
|
|
lxml
|
2021-03-12 07:09:13 +00:00
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2021-03-23 19:22:30 +00:00
|
|
|
# access network
|
|
|
|
"test_parseUrl"
|
|
|
|
"encutils"
|
2021-05-29 03:34:57 +00:00
|
|
|
"website.logging"
|
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
# AttributeError: module 'importlib.resources' has no attribute 'files'
|
|
|
|
"test_parseFile"
|
|
|
|
"test_parseString"
|
|
|
|
"test_combine"
|
2021-03-12 07:09:13 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
pythonImportsCheck = [ "cssutils" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-03-12 07:09:13 +00:00
|
|
|
description = "A CSS Cascading Style Sheets library for Python";
|
|
|
|
homepage = "https://github.com/jaraco/cssutils";
|
|
|
|
changelog = "https://github.com/jaraco/cssutils/blob/v${version}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
2021-03-12 07:09:13 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|