1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, hatch-vcs
5, hatchling
6, numpy
7, pytest-xdist
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "pyhamcrest";
14 version = "2.0.4";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "hamcrest";
21 repo = "PyHamcrest";
22 rev = "refs/tags/V${version}";
23 hash = "sha256-CIkttiijbJCR0zdmwM5JvFogQKYuHUXHJhdyWonHcGk=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace 'dynamic = ["version"]' 'version = "${version}"'
29 '';
30
31 nativeBuildInputs = [
32 hatch-vcs
33 hatchling
34 ];
35
36 nativeCheckInputs = [
37 numpy
38 pytest-xdist
39 pytestCheckHook
40 ];
41
42 disabledTests = [
43 # Tests started failing with numpy 1.24
44 "test_numpy_numeric_type_complex"
45 "test_numpy_numeric_type_float"
46 "test_numpy_numeric_type_int"
47 ];
48
49 pythonImportsCheck = [
50 "hamcrest"
51 ];
52
53 meta = with lib; {
54 description = "Hamcrest framework for matcher objects";
55 homepage = "https://github.com/hamcrest/PyHamcrest";
56 license = licenses.bsd3;
57 maintainers = with maintainers; [ alunduil ];
58 };
59}