diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 175d049..5335bba 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -28,10 +28,10 @@ jobs: - { PYTHON_VERSION: '3.12' } steps: - name: "Checkout to repository" - uses: actions/checkout@v4 + uses: actions/checkout@v4.1.7 - name: "Setup Python" - uses: actions/setup-python@v4 + uses: actions/setup-python@v5.1.1 with: python-version: ${{ matrix.PYTHON_VERSION }} cache: 'pip' @@ -43,15 +43,15 @@ jobs: - name: Install Requirements run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r requirements.txt -r requirements.dev.txt - name: "Run tests" - uses: pavelzw/pytest-action@v2 + uses: pavelzw/pytest-action@v2.2.0 with: report-title: >- Pytest - Python ${{ matrix.PYTHON_VERSION }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3.1.4 + uses: codecov/codecov-action@v4.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/esxport/cli.py b/esxport/cli.py index 79de787..0e34cd1 100644 --- a/esxport/cli.py +++ b/esxport/cli.py @@ -5,7 +5,7 @@ import click from click import Context, Parameter -from click_params import URL +from click_params import UrlParamType from esxport import CliOptions, EsXport @@ -45,7 +45,7 @@ def print_version(ctx: Context, _: Parameter, value: bool) -> None: # noqa: FBT @click.option( "-u", "--url", - type=URL, + type=UrlParamType(may_have_port=True, simple_host=True), required=False, default=default_config_fields["url"], help="Elasticsearch host URL.", diff --git a/requirements.dev.txt b/requirements.dev.txt index 9d40ccc..85a59f3 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,11 +1,11 @@ -Faker==19.6.2 -pytest==7.4.2 +Faker==27.0.0 +pytest==8.3.2 pytest-click==1.1.0 -pytest-cov==4.1.0 -pytest-elasticsearch @ git+https://github.com/nikhilbadyal/pytest-elasticsearch/@main +pytest-cov==5.0.0 +pytest-elasticsearch-test pytest-emoji==0.2.0 -pytest-loguru==0.2.0 +pytest-loguru==0.4.0 pytest-md==0.2.0 -pytest-mock==3.11.1 -pytest-xdist==3.3.1 -python-dotenv==1.0.0 +pytest-mock==3.14.0 +pytest-xdist==3.6.1 +python-dotenv==1.0.1 diff --git a/requirements.txt b/requirements.txt index 711f8b1..bf5f97f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ -click==8.1.7 -click-params==0.4.1 -elasticsearch==8.10.0 -loguru==0.7.2 -tenacity==9.0.0 -tqdm==4.66.1 +click==8.1.7 +click-params==0.5.0 +elasticsearch==8.15.0 +loguru==0.7.2 +tenacity==9.0.0 +tqdm==4.66.5 +typing-extensions==4.12.2 diff --git a/test/esxport/retry_test.py b/test/esxport/retry_test.py index b656531..40d8dbd 100644 --- a/test/esxport/retry_test.py +++ b/test/esxport/retry_test.py @@ -6,14 +6,13 @@ import pytest from elasticsearch.exceptions import ConnectionError +from typing_extensions import Self from esxport.constant import TIMES_TO_TRY if TYPE_CHECKING: from unittest.mock import Mock - from typing_extensions import Self - from esxport.esxport import EsXport @@ -31,6 +30,6 @@ def test_retry_happens_on_connection_error(self: Self, mocker: Mock, esxport_obj with pytest.raises(ConnectionError): esxport_obj._check_indexes() - stats: dict[str, Any] = esxport_obj._check_indexes.retry.statistics # type: ignore[attr-defined] + stats: dict[str, Any] = esxport_obj._check_indexes.statistics # type: ignore[attr-defined] assert "attempt_number" in stats assert stats["attempt_number"] == TIMES_TO_TRY