Skip to content

Commit acd3dd6

Browse files
authored
Merge pull request #17 from InfrastructureAsCode-ch/develop
Version 0.2.0
2 parents bfbc220 + d0d9442 commit acd3dd6

7 files changed

Lines changed: 447 additions & 397 deletions

File tree

.github/workflows/main.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ jobs:
77
name: linters
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v4
1111
- name: Setup python
12-
uses: actions/setup-python@v1
12+
uses: actions/setup-python@v5
1313

1414
- name: Install Poetry
1515
uses: snok/install-poetry@v1
@@ -18,7 +18,7 @@ jobs:
1818
virtualenvs-in-project: true
1919

2020
- name: Cache Poetry virtualenv
21-
uses: actions/cache@v2
21+
uses: actions/cache@v4
2222
id: cached-poetry-dependencies
2323
with:
2424
path: .venv
@@ -40,16 +40,15 @@ jobs:
4040
shell: bash
4141
strategy:
4242
matrix:
43-
python-version: [ '3.8', '3.9', '3.10', '3.11']
44-
platform: [ubuntu-latest, macOS-latest, windows-latest]
43+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
44+
platform: [ubuntu-latest, macos-13, windows-2019]
4545
runs-on: ${{ matrix.platform }}
4646
steps:
47-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v4
4848
- name: Setup python
49-
uses: actions/setup-python@v1
49+
uses: actions/setup-python@v5
5050
with:
5151
python-version: ${{ matrix.python-version }}
52-
architecture: x64
5352

5453
- name: Install Poetry
5554
uses: snok/install-poetry@v1
@@ -58,12 +57,12 @@ jobs:
5857
virtualenvs-in-project: true
5958

6059
- name: Cache Poetry virtualenv
61-
uses: actions/cache@v2
60+
uses: actions/cache@v4
6261
id: cached-poetry-dependencies
6362
with:
6463
path: .venv
6564
key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
66-
if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv
65+
if: ${{ matrix.platform != 'windows-2019' }} # windows hangs if using a cached venv
6766

6867
- name: Install Dependencies
6968
run: poetry install --no-interaction --no-root
@@ -76,13 +75,13 @@ jobs:
7675

7776
- name: Force using UTF-8 encoding for windows tests
7877
run: poetry run python -m pytest -vs
79-
if: ${{ matrix.platform == 'windows-latest' }}
78+
if: ${{ matrix.platform == 'windows-2019' }}
8079
env:
8180
PYTHONIOENCODING: utf-8
8281

8382
- name: Run pytest
8483
run: make pytest
85-
if: ${{ matrix.platform != 'windows-latest' }}
84+
if: ${{ matrix.platform != 'windows-2019' }}
8685

8786

8887
release:
@@ -91,9 +90,9 @@ jobs:
9190
needs: [linters, pytest]
9291
runs-on: ubuntu-latest
9392
steps:
94-
- uses: actions/checkout@v2
93+
- uses: actions/checkout@v4
9594
- name: Setup python
96-
uses: actions/setup-python@v1
95+
uses: actions/setup-python@v5
9796
with:
9897
python-version: 3.8
9998

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ IMG_URL=https://raw.githubusercontent.com/InfrastructureAsCode-ch/nornir_rich/ma
55
# Run pytest
66
.PHONY: pytest
77
pytest:
8-
poetry run pytest -vs ${ARGS}
8+
poetry run pytest -vs tests
99

1010
# Check if the python code needs to be reformatted
1111
.PHONY: black

nornir_rich/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.6" # From Makefile
1+
__version__ = "0.2.0" # From Makefile

nornir_rich/progress_bar.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,19 @@ def task_instance_started(self, task: Task, host: Host) -> None:
103103
self.progress_running_tasks.update(self.running_concurrent_bar, advance=1)
104104

105105
def task_instance_completed(
106-
self, task: Task, host: Host, results: MultiResult
106+
self, task: Task, host: Host, result: MultiResult
107107
) -> None:
108108
with self.lock:
109109
self.progress_running_tasks.update(self.running_concurrent_bar, advance=-1)
110110
self.progress_total.update(self.total, advance=1)
111111
self.progress_status.update(
112-
self.error if results.failed else self.successful, advance=1
112+
self.error if result.failed else self.successful, advance=1
113113
)
114-
if results.changed:
114+
if result.changed:
115115
self.progress_status.update(self.changed, advance=1)
116116

117-
def subtask_instance_started(self, task: Task, host: Host) -> None:
118-
...
117+
def subtask_instance_started(self, task: Task, host: Host) -> None: ...
119118

120119
def subtask_instance_completed(
121120
self, task: Task, host: Host, result: MultiResult
122-
) -> None:
123-
...
121+
) -> None: ...

0 commit comments

Comments
 (0)