1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, pythonAtLeast
6, pbr
7, testtools
8, mock
9, python
10, six
11}:
12
13buildPythonPackage rec {
14 pname = "fixtures";
15 version = "3.0.0";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "fcf0d60234f1544da717a9738325812de1f42c2fa085e2d9252d8fff5712b2ef";
20 };
21
22 patches = lib.optionals (pythonAtLeast "3.9") [
23 # drop tests that try to monkeypatch a classmethod, which fails on python3.9
24 # https://github.com/testing-cabal/fixtures/issues/44
25 (fetchpatch {
26 url = "https://salsa.debian.org/openstack-team/python/python-fixtures/-/raw/debian/victoria/debian/patches/remove-broken-monkey-patch-test.patch";
27 sha256 = "1s3hg2zmqc4shmnf90kscphzj5qlqpxghzw2a59p8f88zrbsj97r";
28 })
29 ];
30
31 nativeBuildInputs = [
32 pbr
33 ];
34
35 propagatedBuildInputs = [
36 testtools
37 six # not in install_requires, but used in fixture.py
38 ];
39
40 checkInputs = [
41 mock
42 ];
43
44 checkPhase = ''
45 ${python.interpreter} -m testtools.run fixtures.test_suite
46 '';
47
48 meta = {
49 description = "Reusable state for writing clean tests and more";
50 homepage = "https://pypi.python.org/pypi/fixtures";
51 license = lib.licenses.asl20;
52 };
53}