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