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