blob: 0987e2ec293187627ff03558531913c0f7cc7616 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
nbval,
writableTmpDirAsHomeHook,
fetchurl,
}:
buildPythonPackage rec {
pname = "ziafont";
version = "0.11";
pyproject = true;
src = fetchFromGitHub {
owner = "cdelker";
repo = "ziafont";
tag = version;
hash = "sha256-KjJ+/Yo5mLV6m7Y0eIGHECH0RvdI+eaFTccDmytNTKI=";
};
build-system = [ setuptools ];
nativeCheckInputs = [
pytestCheckHook
writableTmpDirAsHomeHook
nbval
];
preCheck =
let
# The test notebooks try to download font files, unless they already exist in the test directory,
# so we prepare them in advance.
checkFonts = lib.map fetchurl (import ./checkfonts.nix);
copyFontCmd = font: "cp ${font} test/${lib.last (lib.splitString "/" font.url)}\n";
in
lib.concatMapStrings copyFontCmd checkFonts;
pytestFlags = [ "--nbval-lax" ];
pythonImportsCheck = [ "ziafont" ];
meta = {
description = "Convert TTF/OTF font glyphs to SVG paths";
homepage = "https://ziafont.readthedocs.io/en/latest/";
changelog = "https://github.com/cdelker/ziafont/blob/main/CHANGES.md";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.sfrijters ];
};
}
|