Skip to content

Commit e1d70d6

Browse files
authored
Merge branch 'stable' into copilot/fix-optional-attributes-bug
2 parents de39974 + eadf3f4 commit e1d70d6

File tree

103 files changed

+6631
-4981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+6631
-4981
lines changed

.github/file-filters.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ development_files: &development_files
1313
- "development/**"
1414
- "tasks/**"
1515

16-
poetry_files: &poetry_files
16+
uv_files: &uv_files
1717
- "pyproject.toml"
18-
- "poetry.lock"
18+
- "uv.lock"
1919

2020
doc_files: &doc_files
2121
- "docs/**"
@@ -24,7 +24,7 @@ doc_files: &doc_files
2424

2525
python_all: &python_all
2626
- "**/*.py"
27-
- *poetry_files
27+
- *uv_files
2828
- *ci_config
2929
- *coverage_config
3030

.github/workflows/ci.yml

Lines changed: 97 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242
helm: ${{ steps.changes.outputs.helm_all }}
4343
python: ${{ steps.changes.outputs.python_all }}
4444
yaml: ${{ steps.changes.outputs.yaml_all }}
45-
poetry_files: ${{ steps.changes.outputs.poetry_files }}
45+
uv_files: ${{ steps.changes.outputs.uv_files }}
4646
github_workflows: ${{ steps.changes.outputs.github_workflows }}
4747
steps:
4848
- name: "Check out repository code"
49-
uses: "actions/checkout@v5"
49+
uses: "actions/checkout@v6"
5050
- name: Check for file changes
5151
uses: dorny/paths-filter@v3
5252
id: changes
@@ -63,26 +63,36 @@ jobs:
6363
timeout-minutes: 5
6464
steps:
6565
- name: "Check out repository code"
66-
uses: "actions/checkout@v5"
66+
uses: "actions/checkout@v6"
6767
- name: "Setup environment"
6868
run: "pip install yamllint==1.35.1"
6969
- name: "Linting: yamllint"
7070
run: "yamllint -s ."
7171

7272
python-lint:
7373
if: needs.files-changed.outputs.python == 'true'
74-
needs: ["files-changed"]
74+
needs: ["files-changed", "prepare-environment"]
7575
runs-on: "ubuntu-latest"
7676
timeout-minutes: 5
7777
steps:
7878
- name: "Check out repository code"
79-
uses: "actions/checkout@v5"
80-
- name: "Setup environment"
81-
run: "pip install ruff==0.11.0"
79+
uses: "actions/checkout@v6"
80+
- name: Set up Python
81+
uses: actions/setup-python@v6
82+
with:
83+
python-version: "3.12"
84+
- name: Install UV
85+
uses: astral-sh/setup-uv@v7
86+
with:
87+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
88+
- name: Install dependencies
89+
run: uv sync --group lint
8290
- name: "Linting: ruff check"
83-
run: "ruff check ."
91+
run: "uv run ruff check ."
8492
- name: "Linting: ruff format"
85-
run: "ruff format --check --diff ."
93+
run: "uv run ruff format --check --diff ."
94+
- name: "Linting: ty check"
95+
run: "uv run ty check ."
8696

8797

8898
markdown-lint:
@@ -94,9 +104,9 @@ jobs:
94104
timeout-minutes: 5
95105
steps:
96106
- name: "Check out repository code"
97-
uses: "actions/checkout@v5"
107+
uses: "actions/checkout@v6"
98108
- name: "Linting: markdownlint"
99-
uses: DavidAnson/markdownlint-cli2-action@v20
109+
uses: DavidAnson/markdownlint-cli2-action@v22
100110
with:
101111
config: .markdownlint.yaml
102112
globs: |
@@ -110,7 +120,7 @@ jobs:
110120
timeout-minutes: 5
111121
steps:
112122
- name: "Check out repository code"
113-
uses: "actions/checkout@v5"
123+
uses: "actions/checkout@v6"
114124
- name: Check workflow files
115125
run: |
116126
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
@@ -119,6 +129,28 @@ jobs:
119129
env:
120130
SHELLCHECK_OPTS: --exclude=SC2086 --exclude=SC2046 --exclude=SC2004 --exclude=SC2129
121131

132+
uv-lock-check:
133+
if: |
134+
needs.files-changed.outputs.uv_files == 'true' ||
135+
needs.files-changed.outputs.github_workflows == 'true'
136+
needs:
137+
- files-changed
138+
- prepare-environment
139+
runs-on: "ubuntu-latest"
140+
timeout-minutes: 5
141+
steps:
142+
- name: "Check out repository code"
143+
uses: "actions/checkout@v6"
144+
- name: "Set up Python"
145+
uses: "actions/setup-python@v6"
146+
with:
147+
python-version: "3.12"
148+
- name: "Install uv"
149+
uses: astral-sh/setup-uv@v7
150+
with:
151+
version: ${{ needs.prepare-environment.outputs.UV_VERSION }}
152+
- name: "Validate pyproject.toml and consistency with uv.lock"
153+
run: uv lock --locked --offline
122154

123155
documentation:
124156
defaults:
@@ -129,12 +161,12 @@ jobs:
129161
!contains(needs.*.result, 'failure') &&
130162
!contains(needs.*.result, 'cancelled') &&
131163
needs.files-changed.outputs.documentation == 'true'
132-
needs: ["files-changed", "yaml-lint", "python-lint"]
164+
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint"]
133165
runs-on: "ubuntu-22.04"
134166
timeout-minutes: 5
135167
steps:
136168
- name: "Check out repository code"
137-
uses: "actions/checkout@v5"
169+
uses: "actions/checkout@v6"
138170
with:
139171
submodules: true
140172
- name: Install NodeJS
@@ -145,10 +177,18 @@ jobs:
145177
cache-dependency-path: docs/package-lock.json
146178
- name: "Install dependencies"
147179
run: npm install
148-
- name: "Setup Python environment"
149-
run: "pip install invoke"
180+
- name: Set up Python
181+
uses: actions/setup-python@v6
182+
with:
183+
python-version: "3.12"
184+
- name: Install UV
185+
uses: astral-sh/setup-uv@v7
186+
with:
187+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
188+
- name: Install dependencies
189+
run: uv sync --all-groups --all-extras
150190
- name: "Build docs website"
151-
run: "invoke docs"
191+
run: "uv run invoke docs"
152192

153193
validate-generated-documentation:
154194
if: |
@@ -161,24 +201,21 @@ jobs:
161201
timeout-minutes: 5
162202
steps:
163203
- name: "Check out repository code"
164-
uses: "actions/checkout@v5"
204+
uses: "actions/checkout@v6"
165205
with:
166206
submodules: true
167207
- name: Set up Python
168208
uses: actions/setup-python@v6
169209
with:
170210
python-version: "3.12"
171-
- name: "Setup Python environment"
172-
run: |
173-
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
174-
poetry config virtualenvs.create true --local
175-
poetry env use 3.12
176-
- name: "Install dependencies"
177-
run: "poetry install --no-interaction --no-ansi --extras ctl"
178-
- name: "Setup environment"
179-
run: "poetry run pip install invoke"
180-
- name: "Validate generated documentation"
181-
run: "poetry run invoke docs-validate"
211+
- name: Install UV
212+
uses: astral-sh/setup-uv@v7
213+
with:
214+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
215+
- name: Install dependencies
216+
run: uv sync --all-groups --all-extras
217+
- name: Validate generated documentation
218+
run: uv run invoke docs-validate
182219

183220
validate-documentation-style:
184221
if: |
@@ -190,7 +227,7 @@ jobs:
190227
timeout-minutes: 5
191228
steps:
192229
- name: "Check out repository code"
193-
uses: "actions/checkout@v5"
230+
uses: "actions/checkout@v6"
194231
with:
195232
submodules: true
196233

@@ -212,11 +249,11 @@ jobs:
212249
strategy:
213250
matrix:
214251
python-version:
215-
- "3.9"
216252
- "3.10"
217253
- "3.11"
218254
- "3.12"
219255
- "3.13"
256+
- "3.14"
220257
if: |
221258
always() && !cancelled() &&
222259
!contains(needs.*.result, 'failure') &&
@@ -227,29 +264,25 @@ jobs:
227264
timeout-minutes: 30
228265
steps:
229266
- name: "Check out repository code"
230-
uses: "actions/checkout@v5"
267+
uses: "actions/checkout@v6"
231268
- name: Set up Python ${{ matrix.python-version }}
232269
uses: actions/setup-python@v6
233270
with:
234271
python-version: ${{ matrix.python-version }}
235-
- name: "Setup environment"
236-
run: |
237-
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }} --python python${{ matrix.python-version }}
238-
poetry config virtualenvs.create true --local
239-
pip install invoke codecov
240-
- name: "Install tomli for Python < 3.11"
241-
if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
242-
run: |
243-
pip install tomli
244-
- name: "Install Package"
245-
run: "poetry install --all-extras"
246-
- name: "Mypy Tests"
247-
run: "poetry run mypy --show-error-codes infrahub_sdk/"
248-
- name: "Unit Tests"
249-
run: "poetry run pytest --cov infrahub_sdk tests/unit/"
272+
- name: Install UV
273+
uses: astral-sh/setup-uv@v7
274+
with:
275+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
276+
python-version: ${{ matrix.python-version }}
277+
- name: Install dependencies
278+
run: uv sync --all-groups --all-extras
279+
- name: Mypy Tests
280+
run: uv run mypy --show-error-codes infrahub_sdk/
281+
- name: Unit Tests
282+
run: uv run pytest --cov infrahub_sdk tests/unit/
250283
- name: "Upload coverage to Codecov"
251284
run: |
252-
codecov --flags python-${{ matrix.python-version }}
285+
uv run codecov --flags python-${{ matrix.python-version }}
253286
env:
254287
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
255288

@@ -259,11 +292,10 @@ jobs:
259292
- name: "Report coverage for pytest-plugin"
260293
if: matrix.python-version == '3.12'
261294
run: |
262-
source $(poetry env info --path)/bin/activate
263-
coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
264-
coverage report -m
265-
coverage xml
266-
codecov --flags python-filler-${{ matrix.python-version }}
295+
uv run coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
296+
uv run coverage report -m
297+
uv run coverage xml
298+
uv run codecov --flags python-filler-${{ matrix.python-version }}
267299
env:
268300
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
269301

@@ -280,7 +312,7 @@ jobs:
280312
timeout-minutes: 30
281313
steps:
282314
- name: "Check out repository code"
283-
uses: "actions/checkout@v5"
315+
uses: "actions/checkout@v6"
284316
- name: Set up Python
285317
uses: actions/setup-python@v6
286318
with:
@@ -289,19 +321,17 @@ jobs:
289321
run: |
290322
RUNNER_NAME=$(echo "${{ runner.name }}" | grep -o 'ghrunner[0-9]\+' | sed 's/ghrunner\([0-9]\+\)/ghrunner_\1/')
291323
echo "PYTEST_DEBUG_TEMPROOT=/var/lib/github/${RUNNER_NAME}/_temp" >> $GITHUB_ENV
292-
- name: "Setup environment"
293-
run: |
294-
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
295-
poetry config virtualenvs.create true --local
296-
pip install invoke codecov
297-
- name: "Install Package"
298-
run: "poetry install --all-extras"
299-
- name: "Integration Tests"
300-
run: |
301-
poetry run pytest --cov infrahub_sdk tests/integration/
324+
- name: Install UV
325+
uses: astral-sh/setup-uv@v7
326+
with:
327+
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
328+
- name: Install dependencies
329+
run: uv sync --all-groups --all-extras
330+
- name: Integration Tests
331+
run: uv run pytest --cov infrahub_sdk tests/integration/
302332
- name: "Upload coverage to Codecov"
303333
run: |
304-
codecov --flags integration-tests
334+
uv run codecov --flags integration-tests
305335
env:
306336
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
307337

@@ -320,14 +350,14 @@ jobs:
320350
# timeout-minutes: 30
321351
# steps:
322352
# - name: "Check out repository code"
323-
# uses: "actions/checkout@v5"
353+
# uses: "actions/checkout@v6"
324354

325355
# - name: "Extract target branch name"
326356
# id: extract_branch
327357
# run: echo "TARGET_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
328358

329359
# - name: "Checkout infrahub repository"
330-
# uses: "actions/checkout@v5"
360+
# uses: "actions/checkout@v6"
331361
# with:
332362
# repository: "opsmill/infrahub"
333363
# path: "infrahub-server"

.github/workflows/define-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: "Define versions"
44
on:
55
workflow_call:
66
outputs:
7-
POETRY_VERSION:
8-
value: "2.1.3"
7+
UV_VERSION:
8+
value: "0.9.8"
99

1010
jobs:
1111
prepare:

.github/workflows/labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
-
1919
name: Checkout
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121
-
2222
name: Run Labeler
2323
uses: crazy-max/ghaction-github-labeler@v5

0 commit comments

Comments
 (0)