1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 pytest,
7 black,
8 ruff,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pytest-examples";
14 version = "0.0.17";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "pydantic";
19 repo = "pytest-examples";
20 tag = "v${version}";
21 hash = "sha256-gPae04hgzUJrY0wshp25ojWrbi+7EYaWoR8wxoEJB30=";
22 };
23
24 build-system = [
25 hatchling
26 ];
27
28 buildInputs = [ pytest ];
29
30 dependencies = [
31 black
32 ruff
33 ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pythonImportsCheck = [ "pytest_examples" ];
38
39 disabledTests = [
40 # Fails with AssertionError because formatting is different than expected
41 "test_black_error"
42 "test_black_error_dot_space"
43 "test_black_error_multiline"
44 ];
45
46 meta = {
47 description = "Pytest plugin for testing examples in docstrings and markdown files";
48 homepage = "https://github.com/pydantic/pytest-examples";
49 changelog = "https://github.com/pydantic/pytest-examples/releases/tag/${src.tag}";
50 license = lib.licenses.mit;
51 maintainers = with lib.maintainers; [ fab ];
52 };
53}