1{
2 lib,
3 buildPythonPackage,
4 cached-property,
5 click,
6 fetchFromGitHub,
7 packaging,
8 pytest-cov-stub,
9 pytest-timeout,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "pythonfinder";
17 version = "3.0.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "sarugaku";
24 repo = "pythonfinder";
25 tag = version;
26 hash = "sha256-Qym/t+IejBMFHvBfIm+G5+J3GBC9O3RFrwSqHLuxwcg=";
27 };
28
29 nativeBuildInputs = [ setuptools ];
30
31 propagatedBuildInputs = [ packaging ] ++ lib.optionals (pythonOlder "3.8") [ cached-property ];
32
33 optional-dependencies = {
34 cli = [ click ];
35 };
36
37 nativeCheckInputs = [
38 pytest-cov-stub
39 pytest-timeout
40 pytestCheckHook
41 ]
42 ++ lib.flatten (builtins.attrValues optional-dependencies);
43
44 pythonImportsCheck = [ "pythonfinder" ];
45
46 meta = with lib; {
47 description = "Cross platform search tool for finding Python";
48 mainProgram = "pyfinder";
49 homepage = "https://github.com/sarugaku/pythonfinder";
50 changelog = "https://github.com/sarugaku/pythonfinder/blob/${src.tag}/CHANGELOG.rst";
51 license = licenses.mit;
52 maintainers = with maintainers; [ cpcloud ];
53 };
54}