1{ lib
2, argcomplete
3, buildPythonPackage
4, fetchFromGitHub
5, hatchling
6, importlib-metadata
7, packaging
8, pip
9, platformdirs
10, pytestCheckHook
11, pythonOlder
12, userpath
13}:
14
15buildPythonPackage rec {
16 pname = "pipx";
17 version = "1.2.1";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "pipxproject";
24 repo = pname;
25 rev = "refs/tags/${version}";
26 hash = "sha256-eNZJXznKgamGR9yrswrrLEqUTxFhLGxWTkYbi13bebY=";
27 };
28
29 nativeBuildInputs = [
30 hatchling
31 ];
32
33 propagatedBuildInputs = [
34 argcomplete
35 packaging
36 platformdirs
37 userpath
38 ] ++ lib.optionals (pythonOlder "3.8") [
39 importlib-metadata
40 ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 ];
45
46 preCheck = ''
47 export HOME=$(mktemp -d)
48 '';
49
50 pytestFlagsArray = [
51 "--ignore=tests/test_install_all_packages.py"
52 # start local pypi server and use in tests
53 "--net-pypiserver"
54 ];
55
56 disabledTests = [
57 # disable tests which are difficult to emulate due to shell manipulations
58 "path_warning"
59 "script_from_internet"
60 "ensure_null_pythonpath"
61 # disable tests, which require internet connection
62 "install"
63 "inject"
64 "ensure_null_pythonpath"
65 "missing_interpreter"
66 "cache"
67 "internet"
68 "run"
69 "runpip"
70 "upgrade"
71 "suffix"
72 "legacy_venv"
73 "determination"
74 "json"
75 "test_list_short"
76 ];
77
78 meta = with lib; {
79 description = "Install and run Python applications in isolated environments";
80 homepage = "https://github.com/pipxproject/pipx";
81 changelog = "https://github.com/pypa/pipx/blob/${version}/CHANGELOG.md";
82 license = licenses.mit;
83 maintainers = with maintainers; [ yshym ];
84 };
85}