mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-17 02:34:05 +00:00
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
fonttools,
|
|
gitMinimal,
|
|
gitpython,
|
|
pytestCheckHook,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "font-v";
|
|
version = "2.1.0";
|
|
pyproject = true;
|
|
|
|
# PyPI source tarballs omit tests, fetch from Github instead
|
|
src = fetchFromGitHub {
|
|
owner = "source-foundry";
|
|
repo = "font-v";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-ceASyYcNul5aWPAPGajCQrqsQ3bN1sE+nMbCbj7f35w=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
dependencies = [
|
|
fonttools
|
|
gitpython
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
gitMinimal
|
|
pytestCheckHook
|
|
];
|
|
|
|
preCheck = ''
|
|
# Many tests assume they are running from a git checkout, although they
|
|
# don't care which one. Create a dummy git repo to satisfy the tests:
|
|
git init -b main
|
|
git config user.email test@example.invalid
|
|
git config user.name Test
|
|
git commit --allow-empty --message 'Dummy commit for tests'
|
|
'';
|
|
|
|
disabledTests = [
|
|
# These tests assume they are actually running from a font-v git checkout,
|
|
# so just skip them:
|
|
"test_utilities_get_gitrootpath_function"
|
|
];
|
|
|
|
meta = {
|
|
description = "Python utility for manipulating font version headers";
|
|
changelog = "https://github.com/source-foundry/font-v/blob/v${finalAttrs.version}/CHANGELOG.md";
|
|
mainProgram = "font-v";
|
|
homepage = "https://github.com/source-foundry/font-v";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ danc86 ];
|
|
};
|
|
})
|