diff --git a/pkgs/development/python-modules/pytest-docker-tools/default.nix b/pkgs/development/python-modules/pytest-docker-tools/default.nix new file mode 100644 index 000000000000..59a98ad27152 --- /dev/null +++ b/pkgs/development/python-modules/pytest-docker-tools/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + docker, + fetchFromGitHub, + fetchpatch, + poetry-core, + pytest, + pytestCheckHook, + pythonOlder, +}: + +buildPythonPackage rec { + pname = "pytest-docker-tools"; + version = "3.1.3"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "Jc2k"; + repo = "pytest-docker-tools"; + rev = "refs/tags/${version}"; + hash = "sha256-6F3aSUyDlBBYG1kwOQvey7rujDdK83uJ3Q1dr8Uo1pw="; + }; + + patches = [ + # Switch to poetry-core, https://github.com/Jc2k/pytest-docker-tools/pull/48 + (fetchpatch { + name = "switch-poetry-core.patch"; + url = "https://github.com/Jc2k/pytest-docker-tools/pull/48/commits/a655e4a32b075e06e89dd907b06bc4ad90703988.patch"; + hash = "sha256-CwCBld7p+bqBfxV9IyxcCvfxXfnUSzCLF2m0ZduIqkU="; + }) + ]; + + build-system = [ poetry-core ]; + + buildInputs = [ pytest ]; + + dependencies = [ docker ]; + + # Tests require a Docker setup + doCheck = false; + + pythonImportsCheck = [ "pytest_docker_tools" ]; + + meta = with lib; { + description = "Opionated helpers for creating py.test fixtures for Docker integration and smoke testing environments"; + homepage = "https://github.com/Jc2k/pytest-docker-tools"; + changelog = "https://github.com/Jc2k/pytest-docker-tools/releases/tag/${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4b610e7c7013..0c823a0bd143 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12503,6 +12503,8 @@ self: super: with self; { pytest-django = callPackage ../development/python-modules/pytest-django { }; + pytest-docker-tools = callPackage ../development/python-modules/pytest-docker-tools { }; + pytest-doctestplus = callPackage ../development/python-modules/pytest-doctestplus { }; pytest-dotenv = callPackage ../development/python-modules/pytest-dotenv { };