diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2f47fea..4b1dd4a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,9 +7,9 @@ jobs: name: linters runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 - name: Install Poetry uses: snok/install-poetry@v1 @@ -18,7 +18,7 @@ jobs: virtualenvs-in-project: true - name: Cache Poetry virtualenv - uses: actions/cache@v2 + uses: actions/cache@v4 id: cached-poetry-dependencies with: path: .venv @@ -40,16 +40,15 @@ jobs: shell: bash strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10'] - platform: [ubuntu-latest, macOS-latest, windows-latest] + python-version: [ '3.8', '3.9', '3.10', '3.11' ] + platform: [ubuntu-latest, macos-13, windows-2019] runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: x64 - name: Install Poetry uses: snok/install-poetry@v1 @@ -58,12 +57,12 @@ jobs: virtualenvs-in-project: true - name: Cache Poetry virtualenv - uses: actions/cache@v2 + uses: actions/cache@v4 id: cached-poetry-dependencies with: path: .venv key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv + if: ${{ matrix.platform != 'windows-2019' }} # windows hangs if using a cached venv - name: Install Dependencies run: poetry install --no-interaction --no-root @@ -76,13 +75,13 @@ jobs: - name: Force using UTF-8 encoding for windows tests run: poetry run python -m pytest -vs - if: ${{ matrix.platform == 'windows-latest' }} + if: ${{ matrix.platform == 'windows-2019' }} env: PYTHONIOENCODING: utf-8 - name: Run pytest run: make pytest - if: ${{ matrix.platform != 'windows-latest' }} + if: ${{ matrix.platform != 'windows-2019' }} release: @@ -91,9 +90,9 @@ jobs: needs: [linters, pytest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/Makefile b/Makefile index 11c6717..e613b71 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ IMG_URL=https://raw.githubusercontent.com/InfrastructureAsCode-ch/nornir_rich/ma # Run pytest .PHONY: pytest pytest: - poetry run pytest -vs ${ARGS} + poetry run pytest -vs tests # Check if the python code needs to be reformatted .PHONY: black diff --git a/nornir_rich/progress_bar.py b/nornir_rich/progress_bar.py index 8b9d410..ffef876 100644 --- a/nornir_rich/progress_bar.py +++ b/nornir_rich/progress_bar.py @@ -103,15 +103,15 @@ def task_instance_started(self, task: Task, host: Host) -> None: self.progress_running_tasks.update(self.running_concurrent_bar, advance=1) def task_instance_completed( - self, task: Task, host: Host, results: MultiResult + self, task: Task, host: Host, result: MultiResult ) -> None: with self.lock: self.progress_running_tasks.update(self.running_concurrent_bar, advance=-1) self.progress_total.update(self.total, advance=1) self.progress_status.update( - self.error if results.failed else self.successful, advance=1 + self.error if result.failed else self.successful, advance=1 ) - if results.changed: + if result.changed: self.progress_status.update(self.changed, advance=1) def subtask_instance_started(self, task: Task, host: Host) -> None: