From 690e5bf26a0ff837a438bd62232f0705c5b2b1f7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 Apr 2023 10:08:06 +0200 Subject: [PATCH 1/3] python310Packages.tinycss: update meta --- pkgs/development/python-modules/tinycss/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/tinycss/default.nix b/pkgs/development/python-modules/tinycss/default.nix index 5dc443a0e47a..ac59b9a310f3 100644 --- a/pkgs/development/python-modules/tinycss/default.nix +++ b/pkgs/development/python-modules/tinycss/default.nix @@ -40,8 +40,9 @@ buildPythonPackage rec { meta = with pkgs.lib; { description = "Complete yet simple CSS parser for Python"; + homepage = "https://tinycss.readthedocs.io"; + changelog = "https://github.com/Kozea/tinycss/releases/tag/v${version}"; license = licenses.bsd3; - homepage = "https://pythonhosted.org/tinycss/"; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc ]; }; } From b49aa4221b330db57f08936b1dfac88f38f8b712 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 Apr 2023 10:11:08 +0200 Subject: [PATCH 2/3] python310Packages.tinycss: disable on unsupported Python releases - add format - use hash - replace pkgs with lib --- pkgs/development/python-modules/tinycss/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/tinycss/default.nix b/pkgs/development/python-modules/tinycss/default.nix index ac59b9a310f3..2f69fedb2476 100644 --- a/pkgs/development/python-modules/tinycss/default.nix +++ b/pkgs/development/python-modules/tinycss/default.nix @@ -1,4 +1,4 @@ -{ pkgs +{ lib , buildPythonPackage , fetchPypi , pytest @@ -6,15 +6,19 @@ , cython , cssutils , isPyPy +, pythonOlder }: buildPythonPackage rec { pname = "tinycss"; version = "0.4"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "12306fb50e5e9e7eaeef84b802ed877488ba80e35c672867f548c0924a76716e"; + hash = "sha256-EjBvtQ5enn6u74S4Au2HdIi6gONcZyhn9UjAkkp2cW4="; }; nativeCheckInputs = [ pytest ]; @@ -38,7 +42,7 @@ buildPythonPackage rec { # Disable Cython tests for PyPy TINYCSS_SKIP_SPEEDUPS_TESTS = pkgs.lib.optional isPyPy true; - meta = with pkgs.lib; { + meta = with lib; { description = "Complete yet simple CSS parser for Python"; homepage = "https://tinycss.readthedocs.io"; changelog = "https://github.com/Kozea/tinycss/releases/tag/v${version}"; From cf197c7d49f669d88b3919f72bf9998ca00b70f2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 23 Apr 2023 10:29:15 +0200 Subject: [PATCH 3/3] python310Packages.tinycss: add pythonImportsCheck - switch to pytestCheckHook - don't get coverage - never run speedup tests --- .../python-modules/tinycss/default.nix | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/tinycss/default.nix b/pkgs/development/python-modules/tinycss/default.nix index 2f69fedb2476..108c989b7de5 100644 --- a/pkgs/development/python-modules/tinycss/default.nix +++ b/pkgs/development/python-modules/tinycss/default.nix @@ -1,11 +1,9 @@ { lib , buildPythonPackage -, fetchPypi -, pytest -, python -, cython , cssutils -, isPyPy +, cython +, fetchPypi +, pytestCheckHook , pythonOlder }: @@ -21,26 +19,36 @@ buildPythonPackage rec { hash = "sha256-EjBvtQ5enn6u74S4Au2HdIi6gONcZyhn9UjAkkp2cW4="; }; - nativeCheckInputs = [ pytest ]; - propagatedBuildInputs = [ cssutils ]; + 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 + # 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 + # incompatible version of Cython. See # https://github.com/Kozea/tinycss/issues/17. rm tinycss/speedups.c ''; - checkPhase = '' - py.test $out/${python.sitePackages} - ''; + # Disable Cython tests + TINYCSS_SKIP_SPEEDUPS_TESTS = true; - # Disable Cython tests for PyPy - TINYCSS_SKIP_SPEEDUPS_TESTS = pkgs.lib.optional isPyPy true; + pythonImportsCheck = [ + "tinycss" + ]; meta = with lib; { description = "Complete yet simple CSS parser for Python";