diff --git a/pkgs/development/python-modules/funcparserlib/default.nix b/pkgs/development/python-modules/funcparserlib/default.nix index 19e2dd146d20..3ace04b108d4 100644 --- a/pkgs/development/python-modules/funcparserlib/default.nix +++ b/pkgs/development/python-modules/funcparserlib/default.nix @@ -1,25 +1,47 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, fetchpatch +, poetry-core , python -, isPy3k +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "funcparserlib"; - version = "0.3.6"; + version = "1.0.0a0"; + format = "pyproject"; - src = fetchPypi { - inherit pname version; - sha256 = "b7992eac1a3eb97b3d91faa342bfda0729e990bd8a43774c1592c091e563c91d"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "vlasovskikh"; + repo = pname; + rev = version; + sha256 = "sha256-YfcboKjyc5ASzrp0duu2R6psf51MGZIeZ0owo5QNSnU="; }; - checkPhase = '' - ${python.interpreter} -m unittest discover - ''; + nativeBuildInputs = [ + poetry-core + ]; - # Tests are Python 2.x only judging from SyntaxError - doCheck = !(isPy3k); + checkInputs = [ + pytestCheckHook + ]; + + patches = [ + # Support for poetry-core, https://github.com/vlasovskikh/funcparserlib/pull/73 + (fetchpatch { + name = "support-poetry-core.patch"; + url = "https://github.com/vlasovskikh/funcparserlib/commit/61ed558fc146b7a30879919325dfa8aae77be556.patch"; + sha256 = "sha256-tqdR3r4/t7RWBYZeAabaN7oYf6VxkVVz006XICX9rYI="; + }) + ]; + + pythonImportsCheck = [ + "funcparserlib" + ]; meta = with lib; { description = "Recursive descent parsing library based on functional combinators"; @@ -27,5 +49,4 @@ buildPythonPackage rec { license = licenses.mit; platforms = platforms.unix; }; - }