diff --git a/pkgs/development/python-modules/pipx/default.nix b/pkgs/development/python-modules/pipx/default.nix new file mode 100644 index 000000000000..e39c791d9c46 --- /dev/null +++ b/pkgs/development/python-modules/pipx/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, userpath +, argcomplete +, packaging +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pipx"; + version = "0.15.5.0"; + + disabled = pythonOlder "3.6"; + + # no tests in the pypi tarball, so we directly fetch from github + src = fetchFromGitHub { + owner = "pipxproject"; + repo = pname; + rev = version; + sha256 = "13z032i8r9f6d09hssvyjpxjacb4wgms5bh2i37da2ili9bh72m6"; + }; + + propagatedBuildInputs = [ userpath argcomplete packaging ]; + + # avoid inconclusive venv assertion, see https://github.com/pipxproject/pipx/pull/477 + # remove after PR is merged + postPatch = '' + substituteInPlace tests/helpers.py \ + --replace 'assert getattr(sys, "base_prefix", sys.prefix) != sys.prefix, "Tests require venv"' "" + ''; + + checkInputs = [ pytestCheckHook ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + # disable tests, which require internet connection + disabledTests = [ + "install" + "inject" + "ensure_null_pythonpath" + "missing_interpreter" + "cache" + "internet" + "runpip" + "upgrade" + ]; + + meta = with lib; { + description = + "Install and Run Python Applications in Isolated Environments"; + homepage = "https://github.com/pipxproject/pipx"; + license = licenses.mit; + maintainers = with maintainers; [ yevhenshymotiuk ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bde2da684f82..57bf95b4606a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5346,6 +5346,8 @@ in { pip = callPackage ../development/python-modules/pip { }; + pipx = callPackage ../development/python-modules/pipx { }; + pip-tools = callPackage ../development/python-modules/pip-tools { git = pkgs.gitMinimal; glibcLocales = pkgs.glibcLocales;