From b247f03fcd48bed10a4ec54b3e321bbb9d39f0d5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 26 Nov 2024 23:29:44 +0100 Subject: [PATCH] python312Packages.pytest-codspeed: init at 3.0.0 Pytest plugin to create CodSpeed benchmarks https://github.com/CodSpeedHQ/pytest-codspeed --- .../pytest-codspeed/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-codspeed/default.nix diff --git a/pkgs/development/python-modules/pytest-codspeed/default.nix b/pkgs/development/python-modules/pytest-codspeed/default.nix new file mode 100644 index 0000000000000..f8c88f44065f2 --- /dev/null +++ b/pkgs/development/python-modules/pytest-codspeed/default.nix @@ -0,0 +1,65 @@ +{ + lib, + buildPythonPackage, + cffi, + fetchFromGitHub, + filelock, + hatchling, + importlib-metadata, + pytest-benchmark, + pytest-cov-stub, + pytest-xdist, + pytest, + pytestCheckHook, + rich, + semver, + setuptools, +}: + +buildPythonPackage rec { + pname = "pytest-codspeed"; + version = "3.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "CodSpeedHQ"; + repo = "pytest-codspeed"; + rev = "refs/tags/v${version}"; + hash = "sha256-06U7S0hRb0J4hO48DaKMQk8Uzl2rUi1thQ4lGorfqpU="; + }; + + build-system = [ hatchling ]; + + buildInput = [ pytest ]; + + dependencies = [ + cffi + filelock + importlib-metadata + rich + setuptools + ]; + + optional-dependencies = { + compat = [ + pytest-benchmark + pytest-xdist + ]; + }; + + nativeCheckInputs = [ + semver + pytest-cov-stub + pytestCheckHook + ]; + + pythonImportsCheck = [ "pytest_codspeed" ]; + + meta = { + description = "Pytest plugin to create CodSpeed benchmarks"; + homepage = "https://github.com/CodSpeedHQ/pytest-codspeed"; + changelog = "https://github.com/CodSpeedHQ/pytest-codspeed/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 62a1df04f4d3e..3571dd9e4dcb9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12640,6 +12640,8 @@ self: super: with self; { pytest-click = callPackage ../development/python-modules/pytest-click { }; + pytest-codspeed = callPackage ../development/python-modules/pytest-codspeed { }; + pytest-console-scripts = callPackage ../development/python-modules/pytest-console-scripts { }; pytest-cov = callPackage ../development/python-modules/pytest-cov { };