Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at r-updates 58 lines 1.2 kB view raw
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.18"; 15 pyproject = true; 16 17 src = fetchFromGitHub { 18 owner = "pydantic"; 19 repo = "pytest-examples"; 20 tag = "v${version}"; 21 hash = "sha256-ZnDl0B7/oLX6PANrqsWtVJwe4E/+7inCgOpo7oSeZlw="; 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 disabledTestPaths = [ 47 # assert 1 + 2 == 4 48 "tests/test_run_examples.py::test_run_example_ok_fail" 49 ]; 50 51 meta = { 52 description = "Pytest plugin for testing examples in docstrings and markdown files"; 53 homepage = "https://github.com/pydantic/pytest-examples"; 54 changelog = "https://github.com/pydantic/pytest-examples/releases/tag/${src.tag}"; 55 license = lib.licenses.mit; 56 maintainers = with lib.maintainers; [ fab ]; 57 }; 58}