diff --git a/pkgs/development/python-modules/mirakuru/default.nix b/pkgs/development/python-modules/mirakuru/default.nix new file mode 100644 index 000000000000..4376c9387fcf --- /dev/null +++ b/pkgs/development/python-modules/mirakuru/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, setuptools +, psutil +, netcat +, ps +, python-daemon +}: + +buildPythonPackage rec { + pname = "mirakuru"; + version = "2.5.1"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ClearcodeHQ"; + repo = "mirakuru"; + rev = "refs/tags/v${version}"; + hash = "sha256-jBsSvIy2FaAYlDZLjJXl9hyCiK+nk/cM5j128f24dRc="; + }; + + nativeBuildInputs = [ setuptools ]; + + propagatedBuildInputs = [ psutil ]; + + nativeCheckInputs = [ + netcat.nc + ps + python-daemon + pytestCheckHook + ]; + pythonImportsCheck = [ "mirakuru" ]; + + meta = with lib; { + homepage = "https://pypi.org/project/mirakuru"; + description = "Process orchestration tool designed for functional and integration tests"; + changelog = "https://github.com/ClearcodeHQ/mirakuru/blob/v${version}/CHANGES.rst"; + license = licenses.lgpl3Plus; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/port-for/default.nix b/pkgs/development/python-modules/port-for/default.nix new file mode 100644 index 000000000000..9efcd9acfaff --- /dev/null +++ b/pkgs/development/python-modules/port-for/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, setuptools +}: + +buildPythonPackage rec { + pname = "port-for"; + version = "0.7.1"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "kmike"; + repo = "port-for"; + rev = "refs/tags/v${version}"; + hash = "sha256-/45TQ2crmTupRgL9hgZGw5IvFKywezSIHqHFbeAkMoo="; + }; + + nativeBuildInputs = [ setuptools ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + pythonImportsCheck = [ "port_for" ]; + + meta = with lib; { + homepage = "https://github.com/kmike/port-for"; + description = "Command-line utility and library that helps with TCP port managment"; + changelog = "https://github.com/kmike/port-for/blob/v${version}/CHANGES.rst"; + license = licenses.mit; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/pytest-postgresql/default.nix b/pkgs/development/python-modules/pytest-postgresql/default.nix new file mode 100644 index 000000000000..6eed5ef6ad2c --- /dev/null +++ b/pkgs/development/python-modules/pytest-postgresql/default.nix @@ -0,0 +1,73 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, setuptools +, mirakuru +, port-for +, psycopg +, pytest +, postgresql +}: + +buildPythonPackage rec { + pname = "pytest-postgresql"; + version = "5.0.0"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "ClearcodeHQ"; + repo = "pytest-postgresql"; + rev = "refs/tags/v${version}"; + hash = "sha256-uWKp9yxTdlswoDPMlhx+2mF1cdhFzhGYKGHdXPGlz+w="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov" "" \ + --replace "--max-worker-restart=0" "" + sed -i 's#/usr/lib/postgresql/.*/bin/pg_ctl#${postgresql}/bin/pg_ctl#' pytest_postgresql/plugin.py + ''; + + buildInputs = [ pytest ]; + + propagatedBuildInputs = [ + mirakuru + port-for + psycopg + setuptools # requires 'pkg_resources' at runtime + ]; + + nativeCheckInputs = [ + postgresql + pytestCheckHook + ]; + pytestFlagsArray = [ + "-p" + "no:postgresql" + ]; + disabledTestPaths = [ "tests/docker/test_noproc_docker.py" ]; # requires Docker + disabledTests = [ + # permissions issue running pg as Nixbld user + "test_executor_init_with_password" + # "ValueError: Pytest terminal summary report not found" + "test_postgres_options_config_in_cli" + "test_postgres_options_config_in_ini" + ]; + pythonImportsCheck = [ + "pytest_postgresql" + "pytest_postgresql.executor" + ]; + + + meta = with lib; { + homepage = "https://pypi.python.org/pypi/pytest-postgresql"; + description = "Pytest plugin that enables you to test code on a temporary PostgreSQL database"; + changelog = "https://github.com/ClearcodeHQ/pytest-postgresql/blob/v${version}/CHANGES.rst"; + license = licenses.lgpl3Plus; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7c6c4a501771..449c4ff9357b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6764,6 +6764,8 @@ self: super: with self; { mir_eval = callPackage ../development/python-modules/mir_eval { }; + mirakuru = callPackage ../development/python-modules/mirakuru { }; + misaka = callPackage ../development/python-modules/misaka { }; misoc = callPackage ../development/python-modules/misoc { }; @@ -8634,6 +8636,8 @@ self: super: with self; { portend = callPackage ../development/python-modules/portend { }; + port-for = callPackage ../development/python-modules/port-for { }; + portpicker = callPackage ../development/python-modules/portpicker { }; posix_ipc = callPackage ../development/python-modules/posix_ipc { }; @@ -10387,6 +10391,8 @@ self: super: with self; { pytest-plt = callPackage ../development/python-modules/pytest-plt { }; + pytest-postgresql = callPackage ../development/python-modules/pytest-postgresql { }; + pytest-pylint = callPackage ../development/python-modules/pytest-pylint { }; pytest-pytestrail = callPackage ../development/python-modules/pytest-pytestrail { };