python312Packages.testresources: fix build

- Convert to PEP517 build
- Convert to unittestCheckHook
- Replace removed aliases in unittest module
This commit is contained in:
Martin Weinelt 2023-12-11 16:24:59 +01:00
parent 631df95dd5
commit 3638ba2105
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,24 +1,42 @@
{ lib, buildPythonPackage, fetchPypi, python
, pbr, fixtures, testtools }:
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, pbr
, fixtures
, testtools
, unittestCheckHook
}:
buildPythonPackage rec {
pname = "testresources";
version = "2.0.1";
format = "setuptools";
pyproject = true;
src = fetchPypi {
inherit pname version;
sha256 = "ee9d1982154a1e212d4e4bac6b610800bfb558e4fb853572a827bc14a96e4417";
};
propagatedBuildInputs = [ pbr ];
nativeCheckInputs = [ fixtures testtools ];
checkPhase = ''
${python.interpreter} -m testtools.run discover
postPatch = ''
substituteInPlace testresources/tests/test_resourced_test_case.py \
--replace "failIf" "assertFalse"
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
pbr
];
nativeCheckInputs = [
fixtures
testtools
unittestCheckHook
];
meta = with lib; {
description = "Pyunit extension for managing expensive test resources";
homepage = "https://launchpad.net/testresources";