From 5e3827d5bd33ab17fe04823e7150ea977bccf538 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 9 Jun 2023 19:36:07 +0200 Subject: [PATCH] python311Packages.diceware: remove pytest-runner - add pythonImportsCheck - switch to pytestCheckHook - disable on unsupported Python releases - add changelog to meta --- .../python-modules/diceware/default.nix | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/diceware/default.nix b/pkgs/development/python-modules/diceware/default.nix index d719dd738ca2..ed6c77c6abc6 100644 --- a/pkgs/development/python-modules/diceware/default.nix +++ b/pkgs/development/python-modules/diceware/default.nix @@ -1,32 +1,49 @@ -{ lib, buildPythonPackage, fetchPypi -, pytest-runner +{ lib +, buildPythonPackage +, fetchPypi , setuptools -, coverage, pytest +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "diceware"; version = "0.10"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; hash = "sha256-srTMm1n1aNLvUb/fn34a+UHSX7j1wl8XAZHburzpZWk="; }; - nativeBuildInputs = [ pytest-runner ]; - - propagatedBuildInputs = [ setuptools ]; - - nativeCheckInputs = [ coverage pytest ]; - - # see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733 - checkPhase = '' - py.test -m 'not packaging' + postPatch = '' + substituteInPlace setup.py \ + --replace "'pytest_runner'," "" ''; + propagatedBuildInputs = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ + # see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733 + "-m 'not packaging'" + ]; + + pythonImportsCheck = [ + "diceware" + ]; + meta = with lib; { description = "Generates passphrases by concatenating words randomly picked from wordlists"; homepage = "https://github.com/ulif/diceware"; + changelog = "https://github.com/ulif/diceware/blob/v${version}/CHANGES.rst"; license = licenses.gpl3; maintainers = with maintainers; [ asymmetric ]; };