From 4a19316bfd4afdca35455f4a4c802630c13f1630 Mon Sep 17 00:00:00 2001 From: Yevhen Shymotyuk Date: Mon, 24 Aug 2020 10:58:42 +0300 Subject: [PATCH] python3Packages.pipx: init at 0.15.5.0 --- .../python-modules/pipx/default.nix | 59 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/pipx/default.nix diff --git a/pkgs/development/python-modules/pipx/default.nix b/pkgs/development/python-modules/pipx/default.nix new file mode 100644 index 00000000000..e39c791d9c4 --- /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 bde2da684f8..57bf95b4606 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;