Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d0dce64
fix(cli): hide file paths in log output unless debug mode enabled
petercrocker Nov 9, 2025
5e90f25
Merge pull request #608 from opsmill/pmc-20251109-logging
petercrocker Nov 10, 2025
1a12125
Merge pull request #618 from opsmill/develop
petercrocker Nov 10, 2025
7d3878c
Merge pull request #619 from opsmill/stable
ogenstad Nov 11, 2025
ed76b8a
Merge pull request #620 from opsmill/develop
ogenstad Nov 11, 2025
1867764
Convert project to UV (#599)
dgarros Nov 12, 2025
f532eac
Merge pull request #622 from opsmill/stable
dgarros Nov 12, 2025
19e87a1
Merge pull request #623 from opsmill/develop
ogenstad Nov 13, 2025
811c047
Merge branch 'stable' into 'develop' with resolved conflicts
ogenstad Nov 13, 2025
c0eb8a1
Merge pull request #629 from opsmill/pog-develop-to-stable-20251113
ogenstad Nov 14, 2025
a05a1a6
Update infrahub-testcontainers
ogenstad Nov 14, 2025
dc79402
Merge pull request #633 from opsmill/pog-testcontainers
ogenstad Nov 14, 2025
f9633d0
Merge pull request #632 from opsmill/develop
ogenstad Nov 14, 2025
46092e3
Remove support for Python 3.9
ogenstad Nov 17, 2025
5819312
Merge pull request #635 from opsmill/pog-remove-python-3.9
ogenstad Nov 17, 2025
2470982
Upgrade ruff
ogenstad Nov 17, 2025
6060485
Merge pull request #636 from opsmill/pog-upgrade-ruff
ogenstad Nov 17, 2025
fe3e57a
Use ruff version from uv.lock in CI
ogenstad Nov 17, 2025
21d565e
Merge pull request #638 from opsmill/pog-ruff-version-from-uvlock
ogenstad Nov 18, 2025
d2b5c42
fix(ci): uv publish command
fatih-acar Nov 18, 2025
631f9c4
Allow recursive convertion to InfrahubNode objects
ogenstad May 5, 2025
26d981c
Correct autofixable ruff rules for Optional
ogenstad Nov 18, 2025
acbed66
Simplify dictionary lookups
ogenstad Nov 18, 2025
8d6a51c
Use a `set` literal when testing for membership
ogenstad Nov 18, 2025
93e6929
Prefer `next(iter())` over single element slice
ogenstad Nov 18, 2025
38ac489
Update ruleset for shadowing builtins
ogenstad Nov 18, 2025
3cf549f
Use specific rule codes when using noqa
ogenstad Nov 18, 2025
58dd255
Upgrade uv action version and pin Python version for test matrix
ogenstad Nov 19, 2025
03198b0
Clear out test restrictions for Python 3.9
ogenstad Nov 19, 2025
b93794f
Merge pull request #390 from opsmill/pog-recursive-relationships-IHS-129
ogenstad Nov 19, 2025
7d7ec85
Merge pull request #648 from opsmill/pog-upgrade-uv-action-set-version
ogenstad Nov 19, 2025
678f2d2
Merge pull request #643 from opsmill/pog-RUF015-infrahub-develop-2025…
ogenstad Nov 19, 2025
638974d
Merge pull request #647 from opsmill/pog-sim118-infrahub-develop-2025…
ogenstad Nov 19, 2025
388e418
Merge pull request #649 from opsmill/pog-clear-3.9-test-restrictions
ogenstad Nov 19, 2025
8483c5a
Merge pull request #645 from opsmill/pog-ruff-builtin-filter-infrahub…
ogenstad Nov 19, 2025
a2d9569
Merge pull request #641 from opsmill/pog-pygrep-hooks
ogenstad Nov 19, 2025
1dcbcec
Merge pull request #642 from opsmill/pog-PLR6201-infrahub-develop-202…
ogenstad Nov 19, 2025
0aa08c2
Fix return annotations and changes for early returns
ogenstad Nov 18, 2025
f5ed365
Merge pull request #644 from opsmill/pog-return-annotations-to-infrah…
ogenstad Nov 19, 2025
ea97f40
Remove resolved rule ignores
ogenstad Nov 19, 2025
dd9e82b
Merge pull request #650 from opsmill/pog-resolved-rules
ogenstad Nov 19, 2025
3cddbac
Unnecessary assignment to `data` before `return` statement
ogenstad Nov 19, 2025
6ad9907
Linting: Probable insecure usage of temporary file or directory
ogenstad Nov 19, 2025
24395a4
Prefer `Path.cwd()` over `Path().resolve()` for current-directory loo…
ogenstad Nov 19, 2025
13b3acb
Merge pull request #640 from opsmill/develop
ogenstad Nov 19, 2025
7ebc552
Merge pull request #651 from opsmill/pog-ruff-ret504
ogenstad Nov 20, 2025
a7f3e6a
Merge pull request #653 from opsmill/pog-FURB177
ogenstad Nov 20, 2025
b2c7649
Merge pull request #652 from opsmill/pog-ruff-S108
ogenstad Nov 20, 2025
e3f5169
Infrahub SDK 1.16.0 beta0
ogenstad Nov 24, 2025
b199ef6
Merge pull request #660 from opsmill/pog-sdk-1.16.0b0
ogenstad Nov 25, 2025
1f4f5a0
add optional graphql variable types and add datetime
wvandeun Nov 14, 2025
16fe512
add get_diff_tree method to SDK client to get a diff object
wvandeun Nov 14, 2025
ab9ae5b
add updated_at meta data property for attributes and relationships
wvandeun Nov 16, 2025
a1e9b7f
add branch report command to infrahubctl
wvandeun Nov 16, 2025
b1040bd
fix
wvandeun Nov 17, 2025
ab8df56
add tests
wvandeun Nov 17, 2025
5c4aca9
ruff
wvandeun Nov 17, 2025
d98a7c4
update documentation
wvandeun Nov 17, 2025
0b48ff7
fix mypy
wvandeun Nov 17, 2025
b3f9a2f
fix: replace | union syntax with Union for Python 3.9 compatibility
wvandeun Nov 17, 2025
22a5de6
fix tests
wvandeun Nov 21, 2025
78c71b3
fail branch report command on main branch
wvandeun Nov 25, 2025
a75c77e
linting
wvandeun Nov 25, 2025
634d2d2
linting
wvandeun Nov 25, 2025
101f45a
remove deprecated raise_for_error argument
wvandeun Nov 26, 2025
e39957b
merge develop to infrahub-develop (#662)
solababs Nov 27, 2025
c850da3
Merge remote-tracking branch 'origin/infrahub-develop' into wvd-20251…
wvandeun Nov 27, 2025
2cf9c3b
Merge pull request #646 from opsmill/pog-ruff-up045-20251118-to-infra…
ogenstad Nov 28, 2025
32db310
remove excpetion handling in format_timestamp
wvandeun Dec 1, 2025
b997e3a
remove typing ignore statements
wvandeun Dec 1, 2025
c1ce7df
refactor creating branch report tables
wvandeun Dec 1, 2025
d5ff419
fix created_at metadata for proposed change in branch report
wvandeun Dec 1, 2025
898819d
update tests
wvandeun Dec 1, 2025
665eb4c
update tests
wvandeun Dec 1, 2025
b38fa29
update tests
wvandeun Dec 1, 2025
dc1e1b7
Merge pull request #637 from opsmill/wvd-20251114-infp388-branch-clea…
wvandeun Dec 1, 2025
550fdf7
Merge remote-tracking branch 'origin/stable' into wvd-20251201-releas…
wvandeun Dec 1, 2025
0ac542c
prepare release v1.16.0
wvandeun Dec 1, 2025
4952028
update CHANGELOG
wvandeun Dec 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ development_files: &development_files
- "development/**"
- "tasks/**"

poetry_files: &poetry_files
uv_files: &uv_files
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"

doc_files: &doc_files
- "docs/**"
Expand All @@ -24,7 +24,7 @@ doc_files: &doc_files

python_all: &python_all
- "**/*.py"
- *poetry_files
- *uv_files
- *ci_config
- *coverage_config

Expand Down
115 changes: 60 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
helm: ${{ steps.changes.outputs.helm_all }}
python: ${{ steps.changes.outputs.python_all }}
yaml: ${{ steps.changes.outputs.yaml_all }}
poetry_files: ${{ steps.changes.outputs.poetry_files }}
uv_files: ${{ steps.changes.outputs.uv_files }}
github_workflows: ${{ steps.changes.outputs.github_workflows }}
steps:
- name: "Check out repository code"
Expand Down Expand Up @@ -71,18 +71,26 @@ jobs:

python-lint:
if: needs.files-changed.outputs.python == 'true'
needs: ["files-changed"]
needs: ["files-changed", "prepare-environment"]
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- name: "Check out repository code"
uses: "actions/checkout@v6"
- name: "Setup environment"
run: "pip install ruff==0.11.0"
uses: "actions/checkout@v5"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install UV
uses: astral-sh/setup-uv@v7
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --group lint
- name: "Linting: ruff check"
run: "ruff check ."
run: "uv run ruff check ."
- name: "Linting: ruff format"
run: "ruff format --check --diff ."
run: "uv run ruff format --check --diff ."


markdown-lint:
Expand Down Expand Up @@ -129,7 +137,7 @@ jobs:
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs.files-changed.outputs.documentation == 'true'
needs: ["files-changed", "yaml-lint", "python-lint"]
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint"]
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
Expand All @@ -145,10 +153,18 @@ jobs:
cache-dependency-path: docs/package-lock.json
- name: "Install dependencies"
run: npm install
- name: "Setup Python environment"
run: "pip install invoke"
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install UV
uses: astral-sh/setup-uv@v7
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: "Build docs website"
run: "invoke docs"
run: "uv run invoke docs"

validate-generated-documentation:
if: |
Expand All @@ -168,17 +184,14 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: "Setup Python environment"
run: |
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
poetry config virtualenvs.create true --local
poetry env use 3.12
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi --extras ctl"
- name: "Setup environment"
run: "poetry run pip install invoke"
- name: "Validate generated documentation"
run: "poetry run invoke docs-validate"
- name: Install UV
uses: astral-sh/setup-uv@v7
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: Validate generated documentation
run: uv run invoke docs-validate

validate-documentation-style:
if: |
Expand Down Expand Up @@ -212,7 +225,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand All @@ -232,24 +244,20 @@ jobs:
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: "Setup environment"
run: |
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }} --python python${{ matrix.python-version }}
poetry config virtualenvs.create true --local
pip install invoke codecov
- name: "Install tomli for Python < 3.11"
if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
run: |
pip install tomli
- name: "Install Package"
run: "poetry install --all-extras"
- name: "Mypy Tests"
run: "poetry run mypy --show-error-codes infrahub_sdk/"
- name: "Unit Tests"
run: "poetry run pytest --cov infrahub_sdk tests/unit/"
- name: Install UV
uses: astral-sh/setup-uv@v7
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: Mypy Tests
run: uv run mypy --show-error-codes infrahub_sdk/
- name: Unit Tests
run: uv run pytest --cov infrahub_sdk tests/unit/
- name: "Upload coverage to Codecov"
run: |
codecov --flags python-${{ matrix.python-version }}
uv run codecov --flags python-${{ matrix.python-version }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -259,11 +267,10 @@ jobs:
- name: "Report coverage for pytest-plugin"
if: matrix.python-version == '3.12'
run: |
source $(poetry env info --path)/bin/activate
coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
coverage report -m
coverage xml
codecov --flags python-filler-${{ matrix.python-version }}
uv run coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
uv run coverage report -m
uv run coverage xml
uv run codecov --flags python-filler-${{ matrix.python-version }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -289,19 +296,17 @@ jobs:
run: |
RUNNER_NAME=$(echo "${{ runner.name }}" | grep -o 'ghrunner[0-9]\+' | sed 's/ghrunner\([0-9]\+\)/ghrunner_\1/')
echo "PYTEST_DEBUG_TEMPROOT=/var/lib/github/${RUNNER_NAME}/_temp" >> $GITHUB_ENV
- name: "Setup environment"
run: |
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
poetry config virtualenvs.create true --local
pip install invoke codecov
- name: "Install Package"
run: "poetry install --all-extras"
- name: "Integration Tests"
run: |
poetry run pytest --cov infrahub_sdk tests/integration/
- name: Install UV
uses: astral-sh/setup-uv@v7
with:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: Integration Tests
run: uv run pytest --cov infrahub_sdk tests/integration/
- name: "Upload coverage to Codecov"
run: |
codecov --flags integration-tests
uv run codecov --flags integration-tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/define-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: "Define versions"
on:
workflow_call:
outputs:
POETRY_VERSION:
value: "2.1.3"
UV_VERSION:
value: "0.9.8"

jobs:
prepare:
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,35 @@ jobs:
with:
python-version: "3.12"

- name: "Install Poetry"
uses: "snok/install-poetry@v1"
- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
version: ${{ needs.prepare-environment.outputs.UV_VERSION }}

- name: "Check out repository code"
uses: "actions/checkout@v6"
with:
submodules: true

- name: "Cache poetry venv"
- name: Cache UV dependencies
uses: "actions/cache@v4"
id: "cached-poetry-dependencies"
id: "cached-uv-dependencies"
with:
path: "./python_sdk/.venv"
key: "venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}"
path: ".venv"
key: "venv-${{ runner.os }}-${{ hashFiles('uv.lock') }}"

- name: "Install Dependencies"
run: "poetry install"
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install Dependencies
run: uv sync --all-groups --all-extras
if: steps.cached-uv-dependencies.outputs.cache-hit != 'true'

- name: "Add PyPI secret"
run: "poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}"
- name: Build package
run: uv build

- name: "Poetry build"
run: "poetry build"
- name: Show output
run: ls -la dist/

- name: "show output"
run: "ls -la dist/"

- name: "Poetry push PyPI"
- name: Publish to PyPI
if: ${{ inputs.publish }}
run: "poetry publish"
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
38 changes: 18 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,22 @@ jobs:
with:
python-version: "3.12"

- name: "Install Poetry"
uses: "snok/install-poetry@v1"
- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"

- name: "Setup Python environment"
run: |
poetry config virtualenvs.create true --local
poetry env use 3.12
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi"
- name: Install dependencies
run: uv sync --all-groups --all-extras

- name: "Check prerelease type"
- name: Check prerelease type
id: release
run: |
echo is_prerelease=$(poetry run python -c "from packaging.version import Version; print(int(Version('$(poetry version -s)').is_prerelease))") >> "$GITHUB_OUTPUT"
echo is_devrelease=$(poetry run python -c "from packaging.version import Version; print(int(Version('$(poetry version -s)').is_devrelease))") >> "$GITHUB_OUTPUT"
echo "version=$(poetry version -s)" >> "$GITHUB_OUTPUT"
echo major_minor_version=$(poetry run python -c "from packaging.version import Version; print(f\"{Version('$(poetry version -s)').major}.{Version('$(poetry version -s)').minor}\")") >> "$GITHUB_OUTPUT"
VERSION=$(uv version --short)
echo is_prerelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_prerelease))") >> "$GITHUB_OUTPUT"
echo is_devrelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_devrelease))") >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo major_minor_version=$(uv run python -c "from packaging.version import Version; v = Version('$VERSION'); print(f'{v.major}.{v.minor}')") >> "$GITHUB_OUTPUT"
echo latest_tag=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ github.token }}" \
Expand All @@ -60,10 +54,14 @@ jobs:
| jq -r '.tag_name') >> "$GITHUB_OUTPUT"

- name: Check tag version
if: github.event.release.tag_name != format('v{0}', steps.release.outputs.version)
run: |
echo "Tag version does not match python project version"
exit 1
EXPECTED_TAG="v${{ steps.release.outputs.version }}"
if [ "${{ github.event.release.tag_name }}" != "$EXPECTED_TAG" ]; then
echo "Tag version does not match python project version"
echo "Expected: $EXPECTED_TAG"
echo "Got: ${{ github.event.release.tag_name }}"
exit 1
fi

- name: Check prerelease and project version
if: github.event.release.prerelease == true && steps.release.outputs.is_prerelease == 0 && steps.release.outputs.is_devrelease == 0
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ script.py
.vscode/settings.json
.DS_Store
.python-version
.venv/
.venv
.ruff_cache
**/.ruff_cache
**/.idea/**
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [1.16.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.16.0) - 2025-12-01

### Added

- Added infrahubctl branch report command to help with cleaning up branches in Infrahub.

### Changed

- Updated behaviour for recursive lookups for the conversion of nested relationships. Note that this change could cause issues in transforms or generators that use the convert_query_response feature if "id" or "__typename" isn't requested for nested related objects. ([#389](https://github.com/opsmill/infrahub-sdk-python/issues/389))
- The project now uses `uv` instead of `poetry` for package and dependency management.

### Removed

- Remove `is_visible` property from infrahub
- Removed support for Python 3.9 (end of life)

## [1.15.1](https://github.com/opsmill/infrahub-sdk-python/tree/v1.15.1) - 2025-11-13

### Fixed
Expand Down
Loading