diff --git a/pkgs/development/python-modules/consul/default.nix b/pkgs/development/python-modules/consul/default.nix index 400cfb30bef0..bac1c1db892c 100644 --- a/pkgs/development/python-modules/consul/default.nix +++ b/pkgs/development/python-modules/consul/default.nix @@ -10,19 +10,18 @@ pytest-asyncio, pytest-cov-stub, python, - docker, }: buildPythonPackage rec { pname = "py-consul"; - version = "1.6.0"; + version = "1.7.1"; pyproject = true; src = fetchFromGitHub { owner = "criteo"; repo = "py-consul"; tag = "v${version}"; - hash = "sha256-kNIFpY8rXdfGmaW2GAq7SvjK+4ahgaFnyXEqcUrXoEs="; + hash = "sha256-DpGSiwpxAF1kCraRFl6XPJ1eSzvR6Rdq8PkK30J/vA0="; }; patches = [ @@ -30,6 +29,9 @@ buildPythonPackage rec { url = "https://salsa.debian.org/python-team/packages/python-consul/-/raw/master/debian/patches/avoir-usr-requirements.txt.patch"; hash = "sha256-lB9Irzuc2IpbQOIP/C3JQ4iYqugf1U6CVlAEXrrFUfI="; }) + + # conftest.py always imports docker, even if related tests are disabled + ./disable-docker-tests.patch ]; build-system = [ @@ -50,7 +52,6 @@ buildPythonPackage rec { pytestCheckHook pytest-asyncio pytest-cov-stub - docker ]; # Most tests want to run a consul docker container ("hashicorp/consul:{version}" in conftest.py) @@ -104,6 +105,12 @@ buildPythonPackage rec { "test_transaction" "test_consul_ctor" "test_acl_token_delete" + "test_acl_templated_policy_list" + "test_acl_templated_policy_preview" + "test_acl_templated_policy_read" + "test_acl_templated_policy_wrote" + "test_agent_service_tagged_addresses" + "test_agent_service_connect" ]; pythonImportsCheck = [ "consul" ]; diff --git a/pkgs/development/python-modules/consul/disable-docker-tests.patch b/pkgs/development/python-modules/consul/disable-docker-tests.patch new file mode 100644 index 000000000000..a837a3c64c63 --- /dev/null +++ b/pkgs/development/python-modules/consul/disable-docker-tests.patch @@ -0,0 +1,19 @@ +diff --git a/conftest.py b/conftest.py +index 533d99c..c57afd8 100644 +--- a/conftest.py ++++ b/conftest.py +@@ -7,11 +7,11 @@ import socket + import time + import uuid + +-import docker ++#import docker + import pytest + import requests +-from docker import DockerClient +-from docker.errors import APIError, NotFound ++#from docker import DockerClient ++#from docker.errors import APIError, NotFound + from requests import RequestException + + CONSUL_VERSIONS = ["1.17.3", "1.19.2", "1.20.2"]