From 292eaf7cc1ee90611e16aa649695bc55434ee69f Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Fri, 12 Sep 2025 20:00:59 +0200 Subject: [PATCH 1/2] python3Packages.doubles: init at 1.5.3 --- .../python-modules/doubles/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/doubles/default.nix diff --git a/pkgs/development/python-modules/doubles/default.nix b/pkgs/development/python-modules/doubles/default.nix new file mode 100644 index 000000000000..9b6fb89c69ba --- /dev/null +++ b/pkgs/development/python-modules/doubles/default.nix @@ -0,0 +1,65 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytest7CheckHook, + setuptools, + coverage, + six, +}: + +buildPythonPackage rec { + pname = "doubles"; + version = "1.5.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "uber"; + repo = "doubles"; + tag = "v${version}"; + hash = "sha256-7yygZ00H2eIGuI/E0dh0j30hicJKBhCqyagY6XAJTCA="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + coverage + six + ]; + + nativeCheckInputs = [ + pytest7CheckHook + ]; + + # To avoid a ValueError: Plugin already registered under a different name: + # doubles.pytest_plugin + pytestFlags = [ + "-p" + "no:doubles" + ]; + + disabledTestPaths = [ + # nose is deprecated + "test/nose_test.py" + + # These tests fail due to an incompatibility between the doubles pytest plugin + # and modern pytest versions (7+). The plugin's verification hook incorrectly + # raises a generic `AssertionError` during teardown, instead of the specific + # exceptions the negative test cases are designed to catch. + "test/allow_test.py" + "test/expect_test.py" + "test/class_double_test.py" + "test/object_double_test.py" + ]; + + pythonImportsCheck = [ "doubles" ]; + + meta = with lib; { + description = "Test doubles for Python"; + homepage = "https://github.com/uber/doubles"; + license = licenses.mit; + maintainers = with maintainers; [ b-rodrigues ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eefb6e452e83..fca839e57e6e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4344,6 +4344,8 @@ self: super: with self; { doubleratchet = callPackage ../development/python-modules/doubleratchet { }; + doubles = callPackage ../development/python-modules/doubles { }; + dowhen = callPackage ../development/python-modules/dowhen { }; downloader-cli = callPackage ../development/python-modules/downloader-cli { }; From de09dd216dd34c7368f7af02d0cd997a32b4ea30 Mon Sep 17 00:00:00 2001 From: Sandro Date: Mon, 15 Sep 2025 13:45:50 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: qzylinra <225773816+qzylinra@users.noreply.github.com> --- pkgs/development/python-modules/doubles/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/doubles/default.nix b/pkgs/development/python-modules/doubles/default.nix index 9b6fb89c69ba..09f2e2d7533b 100644 --- a/pkgs/development/python-modules/doubles/default.nix +++ b/pkgs/development/python-modules/doubles/default.nix @@ -56,10 +56,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "doubles" ]; - meta = with lib; { + meta = { description = "Test doubles for Python"; homepage = "https://github.com/uber/doubles"; - license = licenses.mit; - maintainers = with maintainers; [ b-rodrigues ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ b-rodrigues ]; }; }