2020-09-25 04:45:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2022-08-12 12:06:08 +00:00
|
|
|
, hatchling
|
2020-09-25 04:45:31 +00:00
|
|
|
, userpath
|
|
|
|
, argcomplete
|
|
|
|
, packaging
|
2021-01-17 00:15:33 +00:00
|
|
|
, importlib-metadata
|
2022-08-12 12:06:08 +00:00
|
|
|
, pip
|
2020-09-25 04:45:31 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pipx";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.1.0";
|
|
|
|
format = "pyproject";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
# no tests in the pypi tarball, so we directly fetch from github
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pipxproject";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "sha256-6cKKVOgHIoKNfGqvDWK5cwBGBDkgfyRuBRDV6fruBoA=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
userpath
|
|
|
|
argcomplete
|
|
|
|
packaging
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
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"
|
|
|
|
];
|
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"
|
2022-08-12 12:06:08 +00:00
|
|
|
"test_list_short"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description =
|
|
|
|
"Install and Run Python Applications in Isolated Environments";
|
|
|
|
homepage = "https://github.com/pipxproject/pipx";
|
|
|
|
license = licenses.mit;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = with maintainers; [ yshym ];
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
}
|