From 7c337d6d8c2a7b01bae9f6f8f406183e5a166a00 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 30 Dec 2022 20:13:18 +0100 Subject: [PATCH] python3Packages.hypothesmith: 0.2.0 -> 0.2.3 --- .../python-modules/hypothesmith/default.nix | 9 ++++++-- .../hypothesmith/remove-black.patch | 21 +++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/hypothesmith/default.nix b/pkgs/development/python-modules/hypothesmith/default.nix index 4bac9c0bb022..76977b770027 100644 --- a/pkgs/development/python-modules/hypothesmith/default.nix +++ b/pkgs/development/python-modules/hypothesmith/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "hypothesmith"; - version = "0.2.0"; + version = "0.2.3"; src = fetchPypi { inherit pname version; - sha256 = "0fb7b3fd03d76eddd4474b0561e1c2662457593a74cc300fd27e5409cd4d7922"; + sha256 = "sha256-vc6EXsmE5uP+0h5l0ugrjrxt5cpeuTZJ39dgNMWQakY="; }; patches = [ @@ -46,6 +46,11 @@ buildPythonPackage rec { "test_source_code_from_libcst_node_type" ]; + disabledTestPaths = [ + # missing blib2to3 + "tests/test_syntactic.py" + ]; + pythonImportsCheck = [ "hypothesmith" ]; meta = with lib; { diff --git a/pkgs/development/python-modules/hypothesmith/remove-black.patch b/pkgs/development/python-modules/hypothesmith/remove-black.patch index 565f350b06b4..d37222ef4b2c 100644 --- a/pkgs/development/python-modules/hypothesmith/remove-black.patch +++ b/pkgs/development/python-modules/hypothesmith/remove-black.patch @@ -1,5 +1,5 @@ diff --git a/tests/test_cst.py b/tests/test_cst.py -index c436183..bdba2d7 100644 +index 8532240..bdba2d7 100644 --- a/tests/test_cst.py +++ b/tests/test_cst.py @@ -3,7 +3,6 @@ import ast @@ -15,11 +15,11 @@ index c436183..bdba2d7 100644 -@pytest.mark.xfail --@example("A\u2592", black.FileMode()) +-@example("A\u2592", black.Mode()) -@given( - source_code=hypothesmith.from_node(), - mode=st.builds( -- black.FileMode, +- black.Mode, - line_length=st.just(88) | st.integers(0, 200), - string_normalization=st.booleans(), - is_pyi=st.booleans(), @@ -39,28 +39,27 @@ index c436183..bdba2d7 100644 def test_from_node_always_compilable(source_code): compile(source_code, "", "exec") diff --git a/tests/test_syntactic.py b/tests/test_syntactic.py -index 7ea42e9..a77ac39 100644 +index 7fe9835..17c4f7c 100644 --- a/tests/test_syntactic.py +++ b/tests/test_syntactic.py -@@ -3,8 +3,6 @@ import ast +@@ -3,7 +3,6 @@ import ast import io import tokenize -import black --import blib2to3 + import blib2to3 import parso import pytest - from hypothesis import example, given, reject, strategies as st -@@ -58,34 +56,6 @@ def test_ast_unparse_from_grammar(source_code): +@@ -58,34 +57,6 @@ def test_ast_unparse_from_grammar(source_code): assert ast.dump(first) == ast.dump(second) --@example("\\", black.FileMode()) --@example("A#\r#", black.FileMode()) +-@example("\\", black.Mode()) +-@example("A#\r#", black.Mode()) -@given( - source_code=hypothesmith.from_grammar(), - mode=st.builds( -- black.FileMode, +- black.Mode, - line_length=st.just(88) | st.integers(0, 200), - string_normalization=st.booleans(), - is_pyi=st.booleans(),