From fd21570d748828b0a7e9c997aed61fcd41cca2a8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 14 Jun 2024 22:51:00 +0200 Subject: [PATCH] python312Packages.inline-snapshot: init at 0.10.2 Create and update inline snapshots in Python tests https://github.com/15r10nk/inline-snapshot/ --- .../inline-snapshot/default.nix | 73 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/inline-snapshot/default.nix diff --git a/pkgs/development/python-modules/inline-snapshot/default.nix b/pkgs/development/python-modules/inline-snapshot/default.nix new file mode 100644 index 000000000000..37e365781573 --- /dev/null +++ b/pkgs/development/python-modules/inline-snapshot/default.nix @@ -0,0 +1,73 @@ +{ + lib, + asttokens, + black, + buildPythonPackage, + click, + dirty-equals, + executing, + fetchFromGitHub, + hypothesis, + poetry-core, + pyright, + pytest-subtests, + pytest-xdist, + pytestCheckHook, + pythonOlder, + rich, + time-machine, + toml, + types-toml, +}: + +buildPythonPackage rec { + pname = "inline-snapshot"; + version = "0.10.2"; + pyproject = true; + + disabled = pythonOlder "3.10"; + + src = fetchFromGitHub { + owner = "15r10nk"; + repo = "inline-snapshot"; + rev = "refs/tags/v${version}"; + hash = "sha256-19rvhqYkM3QiD0La5TRi/2uKza8HW/bnXeGAhOZ/bgs="; + }; + + build-system = [ poetry-core ]; + + dependencies = [ + asttokens + black + click + executing + rich + toml + types-toml + ]; + + nativeCheckInputs = [ + dirty-equals + hypothesis + pyright + pytest-subtests + pytest-xdist + pytestCheckHook + time-machine + ]; + + pythonImportsCheck = [ "inline_snapshot" ]; + + disabledTestPaths = [ + # Tests don't play nice with pytest-xdist + "tests/test_typing.py" + ]; + + meta = with lib; { + description = "Create and update inline snapshots in Python tests"; + homepage = "https://github.com/15r10nk/inline-snapshot/"; + changelog = "https://github.com/15r10nk/inline-snapshot/blob/${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 928edd66a5f2..483cb05e6996 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5819,6 +5819,8 @@ self: super: with self; { inkex = callPackage ../development/python-modules/inkex { }; + inline-snapshot = callPackage ../development/python-modules/inline-snapshot { }; + inlinestyler = callPackage ../development/python-modules/inlinestyler { }; inotify = callPackage ../development/python-modules/inotify { };