nixpkgs/pkgs/development/python-modules/psautohint/default.nix
Drew Risinger c2c9fcc896 python3Packages.psautohint: disable slow tests
* Reduces test time from ~5 mins to ~30 seconds.
* Also converts to pytestCheckHook for better test control.
* Makes fetchFromGitHub variables match convention.
* remove pytest-randomly.
    pytest-randomly will randomize test order &
    reset random seeds between tests.
    We don't want the random test ordering for reproducible builds, so we
    remove it.
* Fixes flaky test "test_hashmap_old_version" by pinning pytest to v5,
    corresponding to upstream issue:
    https://github.com/adobe-type-tools/psautohint/issues/284#issuecomment-742800965

py3.psautohint: use pytest5
2020-12-10 17:56:36 -05:00

57 lines
1.6 KiB
Nix

{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
, fonttools, lxml, fs
, setuptools_scm
, pytestCheckHook, pytest_5, pytestcov, pytest_xdist
}:
buildPythonPackage rec {
pname = "psautohint";
version = "2.1.2";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "adobe-type-tools";
repo = pname;
rev = "v${version}";
sha256 = "1s2l54gzn11y07zaggprwif7r3ia244qijjhkbvjdx4jsgc5df8n";
fetchSubmodules = true; # data dir for tests
};
postPatch = ''
echo '#define PSAUTOHINT_VERSION "${version}"' > libpsautohint/src/version.h
sed -i '/use_scm_version/,+3d' setup.py
sed -i '/setup(/a \ version="${version}",' setup.py
'';
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ fonttools lxml fs ];
checkInputs = [
# Override pytestCheckHook to use pytest v5, because some tests fail on pytest >= v6
# https://github.com/adobe-type-tools/psautohint/issues/284#issuecomment-742800965
# Override might be able to be removed in future, check package dependency pins (coverage.yml)
(pytestCheckHook.override{ pytest = pytest_5; })
pytestcov
pytest_xdist
];
disabledTests = [
# Slow tests, reduces test time from ~5 mins to ~30s
"test_mmufo"
"test_flex_ufo"
"test_ufo"
"test_flex_otf"
"test_multi_outpath"
"test_mmhint"
"test_otf"
];
meta = with lib; {
description = "Script to normalize the XML and other data inside of a UFO";
homepage = "https://github.com/adobe-type-tools/psautohint";
license = licenses.bsd3;
maintainers = [ maintainers.sternenseemann ];
};
}