nixpkgs/pkgs/development/python-modules/pipx/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
1.6 KiB
Nix
Raw Normal View History

2020-08-24 07:58:42 +00:00
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
2022-08-02 12:50:34 +00:00
, hatchling
2020-08-24 07:58:42 +00:00
, userpath
, argcomplete
, packaging
, importlib-metadata
2022-08-02 12:50:34 +00:00
, pip
2020-08-24 07:58:42 +00:00
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pipx";
2022-07-16 10:59:24 +00:00
version = "1.1.0";
2022-08-02 12:50:34 +00:00
format = "pyproject";
2020-08-24 07:58:42 +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-07-16 10:59:24 +00:00
rev = "refs/tags/${version}";
sha256 = "sha256-6cKKVOgHIoKNfGqvDWK5cwBGBDkgfyRuBRDV6fruBoA=";
2020-08-24 07:58:42 +00:00
};
2022-08-02 12:50:34 +00:00
nativeBuildInputs = [
hatchling
];
propagatedBuildInputs = [
userpath
argcomplete
packaging
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
2020-08-24 07:58:42 +00:00
2022-08-02 12:50:34 +00:00
checkInputs = [
pytestCheckHook
];
2020-08-24 07:58:42 +00:00
preCheck = ''
export HOME=$(mktemp -d)
'';
pytestFlagsArray = [
"--ignore=tests/test_install_all_packages.py"
# start local pypi server and use in tests
"--net-pypiserver"
];
2020-08-24 07:58:42 +00:00
disabledTests = [
# 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-08-24 07:58:42 +00:00
"install"
"inject"
"ensure_null_pythonpath"
"missing_interpreter"
"cache"
"internet"
"run"
2020-08-24 07:58:42 +00:00
"runpip"
"upgrade"
"suffix"
"legacy_venv"
"determination"
"json"
2022-08-02 12:50:34 +00:00
"test_list_short"
2020-08-24 07:58:42 +00:00
];
meta = with lib; {
description =
"Install and Run Python Applications in Isolated Environments";
homepage = "https://github.com/pipxproject/pipx";
license = licenses.mit;
maintainers = with maintainers; [ yshym ];
2020-08-24 07:58:42 +00:00
};
}