1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5}:
6
7buildPythonPackage rec {
8 pname = "result";
9 version = "0.7.0";
10
11 src = fetchFromGitHub {
12 owner = "rustedpy";
13 repo = "result";
14 rev = "v${version}";
15 hash = "sha256-bEf3OJg6ksDvzZE7ezA58Q2FObb5V7BG8vkKtX284Jg=";
16 };
17
18 postPatch = ''
19 substituteInPlace pyproject.toml \
20 --replace '"--flake8",' "" \
21 --replace '"--tb=short",' "" \
22 --replace '"--cov=result",' "" \
23 --replace '"--cov=tests",' "" \
24 --replace '"--cov-report=term",' "" \
25 --replace '"--cov-report=xml",' ""
26 '';
27
28 nativeCheckInputs = [
29 pytestCheckHook
30 ];
31
32 disabledTestPaths = [
33 #TODO: figure out the failure "match o:" Invalid Syntax
34 "tests/test_pattern_matching.py"
35 ];
36
37 pythonImportsCheck = [ "result" ];
38
39 meta = with lib; {
40 description = "A simple Result type for Python 3 inspired by Rust, fully type annotated";
41 homepage = "https://github.com/rustedpy/result";
42 license = licenses.mit;
43 maintainers = [];
44 };
45}