From 585cfbd8b77d4c72ad4ca9273e0b3a42ee86c84e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 11 Jan 2025 12:44:28 +0100 Subject: [PATCH] python312Packages.result: refactor --- .../python-modules/result/default.nix | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/result/default.nix b/pkgs/development/python-modules/result/default.nix index db123e031067..cd4793401976 100644 --- a/pkgs/development/python-modules/result/default.nix +++ b/pkgs/development/python-modules/result/default.nix @@ -2,21 +2,19 @@ lib, buildPythonPackage, fetchFromGitHub, - pytestCheckHook, pytest-asyncio, - nix-update-script, + pytest-cov-stub, + pytestCheckHook, + pythonOlder, setuptools, - wheel, }: buildPythonPackage rec { pname = "result"; version = "0.17.0"; pyproject = true; - build-system = [ - setuptools - wheel - ]; + + disabled = pythonOlder "3.10"; src = fetchFromGitHub { owner = "rustedpy"; @@ -25,27 +23,20 @@ buildPythonPackage rec { hash = "sha256-o+7qKxGQCeMUnsmEReggvf+XwQWFHRCYArYk3DxCa50="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace '"--flake8",' "" \ - --replace '"--tb=short",' "" \ - --replace '"--cov=result",' "" \ - --replace '"--cov=tests",' "" \ - --replace '"--cov-report=term",' "" \ - --replace '"--cov-report=xml",' "" - ''; + build-system = [ setuptools ]; nativeCheckInputs = [ - pytestCheckHook pytest-asyncio + pytest-cov-stub + pytestCheckHook ]; - passthru.updateScript = nix-update-script { }; pythonImportsCheck = [ "result" ]; meta = with lib; { - description = "A simple Result type for Python 3 inspired by Rust, fully type annotated"; + description = "A Rust-like result type for Python"; homepage = "https://github.com/rustedpy/result"; + changelog = "https://github.com/rustedpy/result/blob/v${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with lib.maintainers; [ emattiza ]; };