diff --git a/pkgs/development/python-modules/result/default.nix b/pkgs/development/python-modules/result/default.nix new file mode 100644 index 000000000000..95fcc8295b22 --- /dev/null +++ b/pkgs/development/python-modules/result/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "result"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "rustedpy"; + repo = "result"; + rev = "v${version}"; + sha256 = "sha256-bEf3OJg6ksDvzZE7ezA58Q2FObb5V7BG8vkKtX284Jg="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace '"--flake8",' "" \ + --replace '"--tb=short",' "" \ + --replace '"--cov=result",' "" \ + --replace '"--cov=tests",' "" \ + --replace '"--cov-report=term",' "" \ + --replace '"--cov-report=xml",' "" + ''; + + checkInputs = [ + pytestCheckHook + ]; + + disabledTestPaths = [ + #TODO: figure out the failure "match o:" Invalid Syntax + "tests/test_pattern_matching.py" + ]; + + pythonImportsCheck = [ "result" ]; + + meta = with lib; { + description = "A simple Result type for Python 3 inspired by Rust, fully type annotated"; + homepage = "https://github.com/rustedpy/result"; + license = licenses.mit; + maintainers = [ maintainers.kvark ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2e88812d4b1d..1cab3948c617 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8823,6 +8823,8 @@ in { restview = callPackage ../development/python-modules/restview { }; + result = callPackage ../development/python-modules/result { }; + rethinkdb = callPackage ../development/python-modules/rethinkdb { }; retry = callPackage ../development/python-modules/retry { };