1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 deprecation,
8 docker,
9 wrapt,
10 typing-extensions,
11}:
12
13buildPythonPackage rec {
14 pname = "testcontainers";
15 version = "4.4.1";
16 disabled = pythonOlder "3.9";
17
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "testcontainers";
22 repo = "testcontainers-python";
23 rev = "refs/tags/testcontainers-v${version}";
24 hash = "sha256-osWppbptWpBSHcrHlAqNpn6j2n/qQ7iCobH3TVqB2bc=";
25 };
26
27 postPatch = ''
28 echo "${version}" > VERSION
29 '';
30
31 build-system = [ poetry-core ];
32
33 buildInputs = [
34 deprecation
35 docker
36 wrapt
37 ];
38
39 dependencies = [ typing-extensions ];
40
41 # Tests require various container and database services running
42 doCheck = false;
43
44 pythonImportsCheck = [ "testcontainers" ];
45
46 meta = with lib; {
47 description = ''
48 Allows using docker containers for functional and integration testing
49 '';
50 homepage = "https://github.com/testcontainers/testcontainers-python";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ onny ];
53 };
54}