python311Packages.diceware: remove pytest-runner

- add pythonImportsCheck
- switch to pytestCheckHook
- disable on unsupported Python releases
- add changelog to meta
This commit is contained in:
Fabian Affolter 2023-06-09 19:36:07 +02:00
parent a175ac6ba8
commit 5e3827d5bd

View File

@ -1,32 +1,49 @@
{ lib, buildPythonPackage, fetchPypi { lib
, pytest-runner , buildPythonPackage
, fetchPypi
, setuptools , setuptools
, coverage, pytest , pytestCheckHook
, pythonOlder
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "diceware"; pname = "diceware";
version = "0.10"; version = "0.10";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
hash = "sha256-srTMm1n1aNLvUb/fn34a+UHSX7j1wl8XAZHburzpZWk="; hash = "sha256-srTMm1n1aNLvUb/fn34a+UHSX7j1wl8XAZHburzpZWk=";
}; };
nativeBuildInputs = [ pytest-runner ]; postPatch = ''
substituteInPlace setup.py \
propagatedBuildInputs = [ setuptools ]; --replace "'pytest_runner'," ""
nativeCheckInputs = [ coverage pytest ];
# see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733
checkPhase = ''
py.test -m 'not packaging'
''; '';
propagatedBuildInputs = [
setuptools
];
nativeCheckInputs = [
pytestCheckHook
];
pytestFlagsArray = [
# see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733
"-m 'not packaging'"
];
pythonImportsCheck = [
"diceware"
];
meta = with lib; { meta = with lib; {
description = "Generates passphrases by concatenating words randomly picked from wordlists"; description = "Generates passphrases by concatenating words randomly picked from wordlists";
homepage = "https://github.com/ulif/diceware"; homepage = "https://github.com/ulif/diceware";
changelog = "https://github.com/ulif/diceware/blob/v${version}/CHANGES.rst";
license = licenses.gpl3; license = licenses.gpl3;
maintainers = with maintainers; [ asymmetric ]; maintainers = with maintainers; [ asymmetric ];
}; };