diff --git a/pkgs/development/python-modules/howdoi/default.nix b/pkgs/development/python-modules/howdoi/default.nix index b886e3c8b4fa..8cd90765ec14 100644 --- a/pkgs/development/python-modules/howdoi/default.nix +++ b/pkgs/development/python-modules/howdoi/default.nix @@ -1,43 +1,61 @@ { lib +, appdirs , buildPythonPackage -, fetchPypi -, six +, cachelib +, cssselect +, fetchFromGitHub +, keep +, lxml , pygments , pyquery -, cachelib -, appdirs -, keep +, requests +, six +, pytestCheckHook }: buildPythonPackage rec { pname = "howdoi"; - version = "2.0.16"; + version = "2.0.17"; - src = fetchPypi { - inherit pname version; - sha256 = "0257fbb328eb3a15ed3acc498314902f00908b130209073509eec21cb7235b2b"; + src = fetchFromGitHub { + owner = "gleitz"; + repo = pname; + rev = "v${version}"; + sha256 = "1cc9hbnalbsd5la9wsm8s6drb79vlzin9qnv86ic81r5nq27n180"; }; - postPatch = '' - substituteInPlace setup.py --replace 'cachelib==0.1' 'cachelib' - ''; + propagatedBuildInputs = [ + appdirs + cachelib + cssselect + keep + lxml + pygments + pyquery + requests + six + ]; - propagatedBuildInputs = [ six pygments pyquery cachelib appdirs keep ]; + checkInputs = [ + pytestCheckHook + ]; - # author hasn't included page_cache directory (which allows tests to run without - # external requests) in pypi tarball. github repo doesn't have release revisions - # clearly tagged. re-enable tests when either is sorted. - doCheck = false; preCheck = '' - mv howdoi _howdoi export HOME=$(mktemp -d) ''; + + disabledTests = [ + # AssertionError: "The... + "test_get_text_with_one_link" + "test_get_text_without_links" + ]; + pythonImportsCheck = [ "howdoi" ]; meta = with lib; { description = "Instant coding answers via the command line"; homepage = "https://pypi.python.org/pypi/howdoi"; license = licenses.mit; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc ]; }; }