lol

python311Packages.diceware: remove pytest-runner

- add pythonImportsCheck
- switch to pytestCheckHook
- disable on unsupported Python releases
- add changelog to meta

+27 -10
+27 -10
pkgs/development/python-modules/diceware/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi 2 - , pytest-runner 1 + { lib 2 + , buildPythonPackage 3 + , fetchPypi 3 4 , setuptools 4 - , coverage, pytest 5 + , pytestCheckHook 6 + , pythonOlder 5 7 }: 6 8 7 9 buildPythonPackage rec { 8 10 pname = "diceware"; 9 11 version = "0.10"; 12 + format = "setuptools"; 13 + 14 + disabled = pythonOlder "3.7"; 10 15 11 16 src = fetchPypi { 12 17 inherit pname version; 13 18 hash = "sha256-srTMm1n1aNLvUb/fn34a+UHSX7j1wl8XAZHburzpZWk="; 14 19 }; 15 20 16 - nativeBuildInputs = [ pytest-runner ]; 21 + postPatch = '' 22 + substituteInPlace setup.py \ 23 + --replace "'pytest_runner'," "" 24 + ''; 25 + 26 + propagatedBuildInputs = [ 27 + setuptools 28 + ]; 17 29 18 - propagatedBuildInputs = [ setuptools ]; 30 + nativeCheckInputs = [ 31 + pytestCheckHook 32 + ]; 19 33 20 - nativeCheckInputs = [ coverage pytest ]; 34 + pytestFlagsArray = [ 35 + # see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733 36 + "-m 'not packaging'" 37 + ]; 21 38 22 - # see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733 23 - checkPhase = '' 24 - py.test -m 'not packaging' 25 - ''; 39 + pythonImportsCheck = [ 40 + "diceware" 41 + ]; 26 42 27 43 meta = with lib; { 28 44 description = "Generates passphrases by concatenating words randomly picked from wordlists"; 29 45 homepage = "https://github.com/ulif/diceware"; 46 + changelog = "https://github.com/ulif/diceware/blob/v${version}/CHANGES.rst"; 30 47 license = licenses.gpl3; 31 48 maintainers = with maintainers; [ asymmetric ]; 32 49 };