From 73c65c2d26bda4433cfae331f82b1e6f5fa672d1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Dec 2024 05:26:37 +0100 Subject: [PATCH 1/2] python312Packages.deal-solver: refactor --- .../development/python-modules/deal-solver/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/deal-solver/default.nix b/pkgs/development/python-modules/deal-solver/default.nix index 8acefba226a8..0bed1e57a7dd 100644 --- a/pkgs/development/python-modules/deal-solver/default.nix +++ b/pkgs/development/python-modules/deal-solver/default.nix @@ -13,20 +13,18 @@ buildPythonPackage rec { pname = "deal-solver"; version = "0.1.2"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "life4"; - repo = pname; + repo = "deal-solver"; rev = "refs/tags/${version}"; hash = "sha256-DAOeQLFR/JED32uJSW7W9+Xx5f1Et05W8Fp+Vm7sfZo="; }; - nativeBuildInputs = [ - flit-core - ]; + build-system = [ flit-core ]; # z3 does not provide a dist-info, so python-runtime-deps-check will fail pythonRemoveDeps = [ "z3-solver" ]; @@ -40,7 +38,7 @@ buildPythonPackage rec { --replace "\"--cov-fail-under=100\"," "" ''; - propagatedBuildInputs = [ + dependencies = [ z3-solver astroid ] ++ z3-solver.requiredPythonModules; From 6a3ec2ff756073e91d6abad3f7e37cb887c9fb9d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 12 Dec 2024 05:29:34 +0100 Subject: [PATCH 2/2] python312Packages.deal-solver: use pytest-cov-stub and pytest-xdist --- .../python-modules/deal-solver/default.nix | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/deal-solver/default.nix b/pkgs/development/python-modules/deal-solver/default.nix index 0bed1e57a7dd..41baa4b8f1fe 100644 --- a/pkgs/development/python-modules/deal-solver/default.nix +++ b/pkgs/development/python-modules/deal-solver/default.nix @@ -1,13 +1,15 @@ { lib, + astroid, buildPythonPackage, fetchFromGitHub, - pythonOlder, flit-core, - z3-solver, - astroid, - pytestCheckHook, hypothesis, + pytest-cov-stub, + pytest-xdist, + pytestCheckHook, + pythonOlder, + z3-solver, }: buildPythonPackage rec { @@ -29,23 +31,16 @@ buildPythonPackage rec { # z3 does not provide a dist-info, so python-runtime-deps-check will fail pythonRemoveDeps = [ "z3-solver" ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "\"--cov=deal_solver\"," "" \ - --replace "\"--cov-report=html\"," "" \ - --replace "\"--cov-report=xml\"," "" \ - --replace "\"--cov-report=term-missing:skip-covered\"," "" \ - --replace "\"--cov-fail-under=100\"," "" - ''; - dependencies = [ z3-solver astroid ] ++ z3-solver.requiredPythonModules; nativeCheckInputs = [ - pytestCheckHook hypothesis + pytest-cov-stub + pytest-xdist + pytestCheckHook ]; pythonImportsCheck = [ "deal_solver" ];