1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 replaceVars,
6 setuptools,
7 setuptools-scm,
8 filelock,
9 requests,
10 platformdirs,
11 unicode-character-database,
12}:
13
14buildPythonPackage rec {
15 pname = "youseedee";
16 version = "0.7.0";
17 pyproject = true;
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-b5gxBIr/mowzlG4/N0C22S1XTq0NAGTq1/+iMUfxD18=";
22 };
23
24 patches = [
25 # Load data files from the unicode-character-database package instead of
26 # downloading them from the internet. (nixpkgs-specific, not upstreamable)
27 (replaceVars ./0001-use-packaged-unicode-data.patch {
28 ucd_dir = "${unicode-character-database}/share/unicode";
29 })
30 ];
31
32 build-system = [
33 setuptools
34 setuptools-scm
35 ];
36
37 dependencies = [
38 filelock
39 requests
40 platformdirs
41 ];
42
43 # Package has no unit tests, but we can check an example as per README.rst:
44 checkPhase = ''
45 runHook preCheck
46 python -m youseedee 0x078A | grep -qE "Block\s+Thaana"
47 runHook postCheck
48 '';
49
50 meta = with lib; {
51 description = "Python library for querying the Unicode Character Database";
52 homepage = "https://github.com/simoncozens/youseedee";
53 license = licenses.mit;
54 maintainers = with maintainers; [ danc86 ];
55 };
56}