2018-10-12 23:16:47 +01:00
|
|
|
{ pkgs
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, python
|
2019-01-12 10:24:31 +00:00
|
|
|
, cython
|
2018-10-12 23:16:47 +01:00
|
|
|
, cssutils
|
|
|
|
, isPyPy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tinycss";
|
|
|
|
version = "0.4";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e";
|
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
propagatedBuildInputs = [ cssutils ];
|
2019-01-12 10:24:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
# Force cython to re-generate this file. If it is present, cython will
|
|
|
|
# think it is "up to date" even though it was generated with an older,
|
|
|
|
# incompatible version of cython. See
|
|
|
|
# https://github.com/Kozea/tinycss/issues/17.
|
|
|
|
rm tinycss/speedups.c
|
|
|
|
'';
|
2018-10-12 23:16:47 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test $out/${python.sitePackages}
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Disable Cython tests for PyPy
|
|
|
|
TINYCSS_SKIP_SPEEDUPS_TESTS = pkgs.lib.optional isPyPy true;
|
|
|
|
|
|
|
|
meta = with pkgs.lib; {
|
|
|
|
description = "Complete yet simple CSS parser for Python";
|
|
|
|
license = licenses.bsd3;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://pythonhosted.org/tinycss/";
|
2018-10-12 23:16:47 +01:00
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|