1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pytest-benchmark,
7 pythonOlder,
8 hatchling,
9 httpx,
10 tomli,
11 starlette,
12}:
13
14buildPythonPackage rec {
15 pname = "wn";
16 version = "0.13.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-wOaFLlFCNUo7RWWiMXRuztyVJTXpJtPvZJi9d6UmkcY=";
24 };
25
26 build-system = [ hatchling ];
27
28 dependencies = [
29 httpx
30 tomli
31 ];
32
33 optional-dependencies.web = [
34 starlette
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pytest-benchmark
40 ]
41 ++ optional-dependencies.web;
42
43 pytestFlags = [ "--benchmark-disable" ];
44
45 preCheck = ''
46 export HOME=$(mktemp -d)
47 '';
48
49 pythonImportsCheck = [ "wn" ];
50
51 meta = with lib; {
52 description = "Modern, interlingual wordnet interface for Python";
53 homepage = "https://github.com/goodmami/wn";
54 changelog = "https://github.com/goodmami/wn/blob/v${version}/CHANGELOG.md";
55 license = licenses.mit;
56 maintainers = with maintainers; [ zendo ];
57 };
58}