Files
nixpkgs/pkgs/development/python-modules/tinycss/default.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

54 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
cssutils,
cython,
fetchPypi,
pytestCheckHook,
pythonOlder,
}:
buildPythonPackage rec {
pname = "tinycss";
version = "0.4";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-EjBvtQ5enn6u74S4Au2HdIi6gONcZyhn9UjAkkp2cW4=";
};
postPatch = ''
sed -i "/--cov/d" setup.cfg
'';
nativeBuildInputs = [ cython ];
propagatedBuildInputs = [ cssutils ];
nativeCheckInputs = [ pytestCheckHook ];
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
'';
# Disable Cython tests
TINYCSS_SKIP_SPEEDUPS_TESTS = true;
pythonImportsCheck = [ "tinycss" ];
meta = {
description = "Complete yet simple CSS parser for Python";
homepage = "https://tinycss.readthedocs.io";
changelog = "https://github.com/Kozea/tinycss/releases/tag/v${version}";
license = lib.licenses.bsd3;
maintainers = [ ];
};
}