Skip to content

Commit e70ff61

Browse files
authored
Merge pull request #12 from InfrastructureAsCode-ch/update_dependencies
Drop Py3.8 and Py3.9 support Migrate to UV
2 parents 587e255 + f20eb09 commit e70ff61

7 files changed

Lines changed: 518 additions & 580 deletions

File tree

.github/workflows/main.yaml

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,76 @@ on: [push, pull_request]
55
jobs:
66
linters:
77
name: linters
8-
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.13"]
11+
platform: [ubuntu-latest]
12+
runs-on: ${{ matrix.platform }}
913
steps:
10-
- uses: actions/checkout@v2
11-
- name: Setup python
12-
uses: actions/setup-python@v1
14+
- uses: actions/checkout@v5
1315

14-
- name: Install Poetry
15-
uses: snok/install-poetry@v1
16+
- name: Install uv and set the python version
17+
uses: astral-sh/setup-uv@v6
1618
with:
17-
virtualenvs-create: true
18-
virtualenvs-in-project: true
19-
20-
- name: Cache Poetry virtualenv
21-
uses: actions/cache@v2
22-
id: cached-poetry-dependencies
23-
with:
24-
path: .venv
25-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
19+
enable-cache: true
20+
python-version: ${{ matrix.python-version }}
2621

27-
- name: Install Dependencies
28-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
29-
run: poetry install --no-interaction --no-root
22+
- name: Install the project
23+
run: uv sync --locked --all-extras --dev
3024

3125
- name: Run black
32-
run: poetry run black --check .
26+
run: uv run black --check .
3327

3428
pytest:
3529
name: Testing on Python ${{ matrix.python-version }} (${{ matrix.platform}})
3630
defaults:
3731
run:
3832
shell: bash
3933
strategy:
34+
fail-fast: false
4035
matrix:
41-
python-version: ["3.8", "3.9", "3.10", "3.11"]
42-
platform: [ubuntu-latest, macOS-latest, windows-latest]
36+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
37+
platform: [ubuntu-latest, macos-13, windows-latest]
4338
runs-on: ${{ matrix.platform }}
4439
steps:
45-
- uses: actions/checkout@v2
46-
- name: Setup python
47-
uses: actions/setup-python@v1
48-
with:
49-
python-version: ${{ matrix.python-version }}
50-
architecture: x64
51-
52-
- name: Install Poetry
53-
uses: snok/install-poetry@v1
54-
with:
55-
virtualenvs-create: true
56-
virtualenvs-in-project: true
40+
- uses: actions/checkout@v5
5741

58-
- name: Cache Poetry virtualenv
59-
uses: actions/cache@v2
60-
id: cached-poetry-dependencies
42+
- name: Install uv and set the python version
43+
uses: astral-sh/setup-uv@v6
6144
with:
62-
path: .venv
63-
key: venv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
64-
if: ${{ matrix.platform != 'windows-latest' }} # windows hangs if using a cached venv
45+
enable-cache: true
46+
python-version: ${{ matrix.python-version }}
6547

66-
- name: Install Dependencies
67-
run: poetry install --no-interaction --no-root
48+
- name: Install the project
49+
run: uv sync --locked --all-extras --dev
6850

6951
- name: Run pytest
70-
run: poetry run pytest -vv
52+
run: uv run pytest -vs
7153

7254
release:
7355
name: Releasing to pypi
7456
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
7557
needs: [linters, pytest]
7658
runs-on: ubuntu-latest
7759
steps:
78-
- uses: actions/checkout@v2
79-
- name: Setup python
80-
uses: actions/setup-python@v1
81-
with:
82-
python-version: 3.8
60+
- uses: actions/checkout@v5
8361

84-
- name: Install Poetry
85-
uses: snok/install-poetry@v1
62+
- name: Install uv and set the python version
63+
uses: astral-sh/setup-uv@v6
64+
with:
65+
enable-cache: true
66+
python-version: "3.10"
8667

87-
- name: build release
88-
run: poetry build
68+
- name: Build release
69+
run: uv build
8970

9071
- name: Publish package to PyPI
9172
uses: pypa/gh-action-pypi-publish@release/v1
9273
with:
9374
user: __token__
9475
password: ${{ secrets.PYPI_API_TOKEN }}
9576

96-
- uses: actions/upload-artifact@v3
77+
- uses: actions/upload-artifact@v4
9778
with:
9879
name: build
9980
path: dist/*

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.pytest_cache/
44
.vscode/
55
dist/
6-
nornir.log
6+
nornir.log
7+
.venv/

nornir_http/result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
response: Response,
2929
result: Any = None,
3030
failed: bool = False,
31-
**kwargs: Any
31+
**kwargs: Any,
3232
):
3333
super().__init__(host=host, result=result, failed=failed, **kwargs)
3434
self.response = response

nornir_http/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def http_method(
1010
url: str = "",
1111
raise_for_status: bool = False,
1212
is_error: bool = True,
13-
**kwargs: Any
13+
**kwargs: Any,
1414
) -> HTTPResult:
1515
"""
1616
This is a helper task that uses `httpx <https://www.python-httpx.org/api/>`_ to

0 commit comments

Comments
 (0)