1{ lib
2, buildPythonPackage
3, cached-property
4, click
5, fetchFromGitHub
6, packaging
7, pydantic
8, pytest-timeout
9, pytestCheckHook
10, pythonOlder
11, setuptools
12}:
13
14buildPythonPackage rec {
15 pname = "pythonfinder";
16 version = "2.0.5";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "sarugaku";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-L/+6w5lLqHO5c9CThoUPOHXRPVxBlOWFDAmfoYxRw5g=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.cfg \
30 --replace " --cov" ""
31 '';
32
33 nativeBuildInputs = [
34 setuptools
35 ];
36
37 propagatedBuildInputs = [
38 cached-property
39 packaging
40 pydantic
41 ];
42
43 passthru.optional-dependencies = {
44 cli = [
45 click
46 ];
47 };
48
49 nativeCheckInputs = [
50 pytest-timeout
51 pytestCheckHook
52 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
53
54 pythonImportsCheck = [
55 "pythonfinder"
56 ];
57
58 # these tests invoke git in a subprocess and
59 # for some reason git can't be found even if included in nativeCheckInputs
60 # disabledTests = [
61 # "test_shims_are_kept"
62 # "test_shims_are_removed"
63 # ];
64
65 meta = with lib; {
66 description = "Cross platform search tool for finding Python";
67 homepage = "https://github.com/sarugaku/pythonfinder";
68 changelog = "https://github.com/sarugaku/pythonfinder/blob/v${version}/CHANGELOG.rst";
69 license = licenses.mit;
70 maintainers = with maintainers; [ cpcloud ];
71 };
72}