From dbb9d9ab296d66200654634fa301f2332a522e80 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 29 Apr 2022 12:38:25 +0200 Subject: [PATCH] python310Packages.statmake: relax cattrs constaint - disable failing tests - add pythonImportsCheck - update inputs --- .../python-modules/statmake/default.nix | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/statmake/default.nix b/pkgs/development/python-modules/statmake/default.nix index 7de42d5bc945..13187285db31 100644 --- a/pkgs/development/python-modules/statmake/default.nix +++ b/pkgs/development/python-modules/statmake/default.nix @@ -1,12 +1,14 @@ { lib -, buildPythonPackage -, fetchFromGitHub -, poetry-core , attrs +, buildPythonPackage , cattrs +, fetchFromGitHub , fonttools , fs +, importlib-metadata +, poetry-core , pytestCheckHook +, pythonOlder , ufo2ft , ufoLib2 }: @@ -14,14 +16,15 @@ buildPythonPackage rec { pname = "statmake"; version = "0.4.1"; - format = "pyproject"; + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "daltonmaag"; - repo = "statmake"; + repo = pname; rev = "v${version}"; - sha256 = "OXhoQAD4LEh80iRUZE2z8sCtWJDv/bSo0bwHbOOPVE0="; + sha256 = "sha256-OXhoQAD4LEh80iRUZE2z8sCtWJDv/bSo0bwHbOOPVE0="; }; nativeBuildInputs = [ @@ -34,6 +37,8 @@ buildPythonPackage rec { fonttools # required by fonttools[ufo] fs + ] ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata ]; checkInputs = [ @@ -46,9 +51,21 @@ buildPythonPackage rec { # https://github.com/daltonmaag/statmake/pull/41 substituteInPlace pyproject.toml \ --replace 'requires = ["poetry>=1.0.0"]' 'requires = ["poetry-core"]' \ - --replace 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"' + --replace 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"' \ + --replace 'cattrs = "^1.1"' 'cattrs = ">= 1.1"' ''; + disabledTests = [ + # cattrs.errors.IterableValidationError: While structuring typing.List[statmake.classes.Axis] + # https://github.com/daltonmaag/statmake/issues/42 + "test_load_stylespace_broken_range" + "test_load_stylespace_broken_multilingual_no_en" + ]; + + pythonImportsCheck = [ + "statmake" + ]; + meta = with lib; { description = "Applies STAT information from a Stylespace to a variable font"; homepage = "https://github.com/daltonmaag/statmake";