diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58d680fc..d799ad1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,9 +288,6 @@ jobs: pip install invoke toml codecov - name: "Install Package" run: "poetry install --all-extras" - - name: "Set environment variables for python_testcontainers" - run: | - echo INFRAHUB_TESTING_IMAGE_VER=latest >> $GITHUB_ENV - name: "Integration Tests" run: | poetry run pytest --cov infrahub_sdk tests/integration/ diff --git a/infrahub_sdk/testing/docker.py b/infrahub_sdk/testing/docker.py index e5865678..0f7d46b2 100644 --- a/infrahub_sdk/testing/docker.py +++ b/infrahub_sdk/testing/docker.py @@ -8,13 +8,16 @@ from .. import Config, InfrahubClient, InfrahubClientSync -INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER", "latest") +INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER") def skip_version(min_infrahub_version: str | None = None, max_infrahub_version: str | None = None) -> bool: """ Check if a test should be skipped depending on infrahub version. """ + if INFRAHUB_VERSION is None: + return True + try: version = Version(INFRAHUB_VERSION) except InvalidVersion: @@ -31,10 +34,6 @@ def skip_version(min_infrahub_version: str | None = None, max_infrahub_version: class TestInfrahubDockerClient(TestInfrahubDocker): - @pytest.fixture(scope="class") - def infrahub_version(self) -> str: - return INFRAHUB_VERSION - @pytest.fixture(scope="class") def client(self, infrahub_port: int) -> InfrahubClient: return InfrahubClient( diff --git a/poetry.lock b/poetry.lock index f60815ae..ac79c770 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,7 +6,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -341,6 +341,7 @@ description = "A Python library for the Docker Engine API." optional = false python-versions = ">=3.8" groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ {file = "docker-7.1.0-py3-none-any.whl", hash = "sha256:c96b93b7f0a746f9e77d325bcfb87422a3d8bd4f03136ae8a85b37f1898d5fc0"}, {file = "docker-7.1.0.tar.gz", hash = "sha256:ad8c70e6e3f8926cb8a92619b832b4ea5299e2831c14284663184e200546fa6c"}, @@ -676,17 +677,21 @@ type = ["pytest-mypy"] [[package]] name = "infrahub-testcontainers" -version = "1.1.9" +version = "1.2.5" description = "Testcontainers instance for Infrahub to easily build integration tests" optional = false python-versions = "<4.0,>=3.9" groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ - {file = "infrahub_testcontainers-1.1.9-py3-none-any.whl", hash = "sha256:3b86954baa3103bbdeb8e74d10befd7cc2859b7a8ddea89138abe231a054ec85"}, - {file = "infrahub_testcontainers-1.1.9.tar.gz", hash = "sha256:4b42f4928d406bc9f6b00b3f91d24f3c2a3bd2a8f2950ad0aa0abe1e4685dcfe"}, + {file = "infrahub_testcontainers-1.2.5-py3-none-any.whl", hash = "sha256:80b8c2e88cd75830365c7a1135d13e33c7c0f284c54f7974b10574e4bfef5134"}, + {file = "infrahub_testcontainers-1.2.5.tar.gz", hash = "sha256:447cc513c4208a3eac8fc3e480c57d4895c9fe3b167357a83dcadd55821f7e5e"}, ] [package.dependencies] +httpx = ">=0.28.1,<0.29.0" +psutil = "*" +pydantic = ">=2.10.6,<3.0.0" pytest = "*" testcontainers = ">=4.8,<4.9" @@ -1185,6 +1190,31 @@ files = [ [package.dependencies] wcwidth = "*" +[[package]] +name = "psutil" +version = "7.0.0" +description = "Cross-platform lib for process and system monitoring in Python. NOTE: the syntax of this script MUST be kept compatible with Python 2.7." +optional = false +python-versions = ">=3.6" +groups = ["dev"] +markers = "python_version >= \"3.10\"" +files = [ + {file = "psutil-7.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25"}, + {file = "psutil-7.0.0-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:39db632f6bb862eeccf56660871433e111b6ea58f2caea825571951d4b6aa3da"}, + {file = "psutil-7.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fcee592b4c6f146991ca55919ea3d1f8926497a713ed7faaf8225e174581e91"}, + {file = "psutil-7.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b1388a4f6875d7e2aff5c4ca1cc16c545ed41dd8bb596cefea80111db353a34"}, + {file = "psutil-7.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5f098451abc2828f7dc6b58d44b532b22f2088f4999a937557b603ce72b1993"}, + {file = "psutil-7.0.0-cp36-cp36m-win32.whl", hash = "sha256:84df4eb63e16849689f76b1ffcb36db7b8de703d1bc1fe41773db487621b6c17"}, + {file = "psutil-7.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:1e744154a6580bc968a0195fd25e80432d3afec619daf145b9e5ba16cc1d688e"}, + {file = "psutil-7.0.0-cp37-abi3-win32.whl", hash = "sha256:ba3fcef7523064a6c9da440fc4d6bd07da93ac726b5733c29027d7dc95b39d99"}, + {file = "psutil-7.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:4cf3d4eb1aa9b348dec30105c55cd9b7d4629285735a102beb4441e38db90553"}, + {file = "psutil-7.0.0.tar.gz", hash = "sha256:7be9c3eba38beccb6495ea33afd982a44074b78f28c434a1f51cc07fd315c456"}, +] + +[package.extras] +dev = ["abi3audit", "black (==24.10.0)", "check-manifest", "coverage", "packaging", "pylint", "pyperf", "pypinfo", "pytest", "pytest-cov", "pytest-xdist", "requests", "rstcheck", "ruff", "setuptools", "sphinx", "sphinx_rtd_theme", "toml-sort", "twine", "virtualenv", "vulture", "wheel"] +test = ["pytest", "pytest-xdist", "setuptools"] + [[package]] name = "ptyprocess" version = "0.7.0" @@ -1275,7 +1305,7 @@ version = "2.11.1" description = "Data validation using Python type hints" optional = false python-versions = ">=3.9" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "pydantic-2.11.1-py3-none-any.whl", hash = "sha256:5b6c415eee9f8123a14d859be0c84363fec6b1feb6b688d6435801230b56e0b8"}, {file = "pydantic-2.11.1.tar.gz", hash = "sha256:442557d2910e75c991c39f4b4ab18963d57b9b55122c8b2a9cd176d8c29ce968"}, @@ -1297,7 +1327,7 @@ version = "2.33.0" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.9" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "pydantic_core-2.33.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71dffba8fe9ddff628c68f3abd845e91b028361d43c5f8e7b3f8b91d7d85413e"}, {file = "pydantic_core-2.33.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:abaeec1be6ed535a5d7ffc2e6c390083c425832b20efd621562fbb5bff6dc518"}, @@ -1579,7 +1609,7 @@ description = "Python for Window Extensions" optional = false python-versions = "*" groups = ["dev"] -markers = "sys_platform == \"win32\"" +markers = "python_version >= \"3.10\" and sys_platform == \"win32\"" files = [ {file = "pywin32-308-cp310-cp310-win32.whl", hash = "sha256:796ff4426437896550d2981b9c2ac0ffd75238ad9ea2d3bfa67a1abd546d262e"}, {file = "pywin32-308-cp310-cp310-win_amd64.whl", hash = "sha256:4fc888c59b3c0bef905ce7eb7e2106a07712015ea1c8234b703a088d46110e8e"}, @@ -1799,6 +1829,7 @@ description = "Python library for throwaway instances of anything that can run i optional = false python-versions = "<4.0,>=3.9" groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ {file = "testcontainers-4.8.2-py3-none-any.whl", hash = "sha256:9e19af077cd96e1957c13ee466f1f32905bc6c5bc1bc98643eb18be1a989bfb0"}, {file = "testcontainers-4.8.2.tar.gz", hash = "sha256:dd4a6a2ea09e3c3ecd39e180b6548105929d0bb78d665ce9919cb3f8c98f9853"}, @@ -1994,7 +2025,7 @@ version = "0.4.0" description = "Runtime typing introspection tools" optional = false python-versions = ">=3.9" -groups = ["main"] +groups = ["main", "dev"] files = [ {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"}, {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"}, @@ -2246,6 +2277,7 @@ description = "Module for decorators, wrappers and monkey patching." optional = false python-versions = ">=3.8" groups = ["dev"] +markers = "python_version >= \"3.10\"" files = [ {file = "wrapt-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a0c23b8319848426f305f9cb0c98a6e32ee68a36264f45948ccf8e7d2b941f8"}, {file = "wrapt-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1ca5f060e205f72bec57faae5bd817a1560fcfc4af03f414b08fa29106b7e2d"}, @@ -2362,4 +2394,4 @@ tests = ["Jinja2", "pytest", "pyyaml", "rich"] [metadata] lock-version = "2.1" python-versions = "^3.9, <3.14" -content-hash = "3f22f4c4d4aefaa0e51fd28a5e9f9c185b146e6261af38072bc7eae4b1ff0680" +content-hash = "5e04cf55024fdf4f1c549eb7b17ef3791d8db85fa8447e92b4584f3d01b7f54c" diff --git a/pyproject.toml b/pyproject.toml index 4f14a11f..e8e4e50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,8 +64,7 @@ pytest-xdist = "^3.3.1" types-python-slugify = "^8.0.0.3" invoke = "^2.2.0" towncrier = "^24.8.0" -infrahub-testcontainers = "~1.1.9" - +infrahub-testcontainers = { version = "^1.2.5", python = ">=3.10" } astroid = "~3.1" [tool.poetry.extras]