1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, userpath
6, argcomplete
7, packaging
8, importlib-metadata
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "pipx";
14 version = "0.16.5";
15
16 disabled = pythonOlder "3.6";
17
18 # no tests in the pypi tarball, so we directly fetch from github
19 src = fetchFromGitHub {
20 owner = "pipxproject";
21 repo = pname;
22 rev = version;
23 sha256 = "sha256-gBeaHEig47XWKoPx3jzvgk/jJPJXtr5R5qUL0LgvbDg=";
24 };
25
26 propagatedBuildInputs = [
27 userpath
28 argcomplete
29 packaging
30 ] ++ lib.optionals (pythonOlder "3.8") [
31 importlib-metadata
32 ];
33
34 checkInputs = [ pytestCheckHook ];
35
36 preCheck = ''
37 export HOME=$(mktemp -d)
38 '';
39
40 pytestFlagsArray = [
41 "--ignore=tests/test_install_all_packages.py"
42 # start local pypi server and use in tests
43 "--net-pypiserver"
44 ];
45 disabledTests = [
46 # disable tests which are difficult to emulate due to shell manipulations
47 "path_warning"
48 "script_from_internet"
49 "ensure_null_pythonpath"
50 # disable tests, which require internet connection
51 "install"
52 "inject"
53 "ensure_null_pythonpath"
54 "missing_interpreter"
55 "cache"
56 "internet"
57 "run"
58 "runpip"
59 "upgrade"
60 "suffix"
61 "legacy_venv"
62 "determination"
63 "json"
64 ];
65
66 meta = with lib; {
67 description =
68 "Install and Run Python Applications in Isolated Environments";
69 homepage = "https://github.com/pipxproject/pipx";
70 license = licenses.mit;
71 maintainers = with maintainers; [ yevhenshymotiuk ];
72 };
73}