2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
argcomplete,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatchling,
|
|
|
|
hatch-vcs,
|
|
|
|
installShellFiles,
|
|
|
|
packaging,
|
|
|
|
platformdirs,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
tomli,
|
|
|
|
userpath,
|
|
|
|
git,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pipx";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.7.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-04-21 15:54:59 +00:00
|
|
|
owner = "pypa";
|
|
|
|
repo = "pipx";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-diHWzrSpXWbNosXKN5nj2FM09HicDhHWKxQDXc+AZ4o=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2022-08-12 12:06:08 +00:00
|
|
|
hatchling
|
2024-04-21 15:54:59 +00:00
|
|
|
hatch-vcs
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2021-01-17 00:15:33 +00:00
|
|
|
argcomplete
|
|
|
|
packaging
|
2023-03-15 16:39:30 +00:00
|
|
|
platformdirs
|
|
|
|
userpath
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
argcomplete
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
2024-01-25 14:12:00 +00:00
|
|
|
git
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--ignore=tests/test_install_all_packages.py"
|
|
|
|
# start local pypi server and use in tests
|
|
|
|
"--net-pypiserver"
|
|
|
|
];
|
2023-03-15 16:39:30 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
disabledTests = [
|
2021-06-28 23:13:55 +00:00
|
|
|
# disable tests which are difficult to emulate due to shell manipulations
|
|
|
|
"path_warning"
|
|
|
|
"script_from_internet"
|
|
|
|
"ensure_null_pythonpath"
|
|
|
|
# disable tests, which require internet connection
|
2020-09-25 04:45:31 +00:00
|
|
|
"install"
|
|
|
|
"inject"
|
|
|
|
"ensure_null_pythonpath"
|
|
|
|
"missing_interpreter"
|
|
|
|
"cache"
|
|
|
|
"internet"
|
2021-01-17 00:15:33 +00:00
|
|
|
"run"
|
2020-09-25 04:45:31 +00:00
|
|
|
"runpip"
|
|
|
|
"upgrade"
|
2020-12-25 13:55:36 +00:00
|
|
|
"suffix"
|
|
|
|
"legacy_venv"
|
2021-01-17 00:15:33 +00:00
|
|
|
"determination"
|
2021-05-20 23:08:51 +00:00
|
|
|
"json"
|
2024-07-27 06:49:29 +00:00
|
|
|
"test_auto_update_shared_libs"
|
|
|
|
"test_cli"
|
|
|
|
"test_cli_global"
|
|
|
|
"test_fetch_missing_python"
|
|
|
|
"test_list_does_not_trigger_maintenance"
|
|
|
|
"test_list_pinned_packages"
|
2022-08-12 12:06:08 +00:00
|
|
|
"test_list_short"
|
2024-07-27 06:49:29 +00:00
|
|
|
"test_list_standalone_interpreter"
|
|
|
|
"test_list_unused_standalone_interpreters"
|
|
|
|
"test_list_used_standalone_interpreters"
|
|
|
|
"test_pin"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_skip_maintenance"
|
2024-07-27 06:49:29 +00:00
|
|
|
"test_unpin"
|
|
|
|
"test_unpin_warning"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postInstall = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
installShellCompletion --cmd pipx \
|
2024-07-31 10:19:44 +00:00
|
|
|
--bash <(register-python-argcomplete pipx --shell bash) \
|
|
|
|
--zsh <(register-python-argcomplete pipx --shell zsh) \
|
|
|
|
--fish <(register-python-argcomplete pipx --shell fish)
|
2024-04-21 15:54:59 +00:00
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
meta = with lib; {
|
2023-03-15 16:39:30 +00:00
|
|
|
description = "Install and run Python applications in isolated environments";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pipx";
|
|
|
|
homepage = "https://github.com/pypa/pipx";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://github.com/pypa/pipx/blob/${version}/CHANGELOG.md";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.mit;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = with maintainers; [ yshym ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|