Skip to content

Commit 8ca0a8c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into dga-2020319-prototype-pydantic
2 parents 23c59ad + 8794721 commit 8ca0a8c

Some content is hidden

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

48 files changed

+5992
-1469
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
- name: "Check out repository code"
7777
uses: "actions/checkout@v4"
7878
- name: "Setup environment"
79-
run: "pip install ruff==0.8.6"
79+
run: "pip install ruff==0.11.0"
8080
- name: "Linting: ruff check"
8181
run: "ruff check ."
8282
- name: "Linting: ruff format"
@@ -212,6 +212,7 @@ jobs:
212212
- "3.10"
213213
- "3.11"
214214
- "3.12"
215+
- "3.13"
215216
if: |
216217
always() && !cancelled() &&
217218
!contains(needs.*.result, 'failure') &&

.github/workflows/sync-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
- stable
99
paths:
1010
- 'docs/docs/**'
11-
- 'docs/sidebars.ts'
11+
- 'docs/sidebars-infrahubctl.ts'
12+
- 'docs/sidebars-python-sdk.ts'
1213
pull_request:
1314
branches:
1415
- stable

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,47 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1111

1212
<!-- towncrier release notes start -->
1313

14+
## [1.9.2](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.2) - 2025-03-26
15+
16+
### Changed
17+
18+
- Remove hfid in upsert payload, to improve node upsert performances
19+
20+
## [1.9.1](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.1) - 2025-03-21
21+
22+
### Fixed
23+
24+
- Fixed an issue where the process_nodes method in the generators used the old format of the schema hash, so node population didn't work
25+
26+
## [1.9.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.9.0) - 2025-03-21
27+
28+
### Added
29+
30+
- Add 'schema_hash' parameter to client.schema.all to only optionally refresh the schema if the provided hash differs from what the client has already cached. ([#152](https://github.com/opsmill/infrahub-sdk-python/issues/152))
31+
32+
### Changed
33+
34+
- CoreStandardGroups created or updated by a generator in Infrahub are now stored as a member of the CoreGeneratorGroup. Previously they were being stored as children of the CoreGeneratorGroup.
35+
36+
### Fixed
37+
38+
- The SDK client query methods (get, filters, all) default behaviour has changed. The query methods will store the retrieved nodes in the internal store by default, where previously this behaviour had to be enabled explicitly using the `populate_store` argument. ([#15](https://github.com/opsmill/infrahub-sdk-python/issues/15))
39+
40+
## [1.8.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.8.0) - 2025-03-19
41+
42+
### Deprecated
43+
44+
- Timestamp: Direct access to `obj` and `add_delta` have been deprecated and will be removed in a future version. ([#255](https://github.com/opsmill/infrahub-sdk-python/issues/255))
45+
46+
### Added
47+
48+
- Added support for Enum in GraphQL query and mutation. ([#18](https://github.com/opsmill/infrahub-sdk-python/issues/18))
49+
50+
### Fixed
51+
52+
- Refactored Timestamp to use `whenever` instead of `pendulum` and extend Timestamp with `add()`, `subtract()`, and `to_datetime()`. ([#255](https://github.com/opsmill/infrahub-sdk-python/issues/255))
53+
- Fixed support for Python 3.13 as it's no longer required to have Rust installed on the system.
54+
1455
## [1.7.2](https://github.com/opsmill/infrahub-sdk-python/tree/v1.7.2) - 2025-03-07
1556

1657
### Added
@@ -26,6 +67,14 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
2667
### Fixed
2768

2869
- `protocols` CTL command properly gets default branch setting from environment variable. ([#104](https://github.com/opsmill/infrahub-sdk-python/issues/104))
70+
- Fix typing for Python 3.9 ([#251](https://github.com/opsmill/infrahub-sdk-python/issues/251))
71+
- Refactor Timestamp to use `whenever` instead of `pendulum` and extend Timestamp with add(), subtract(), and to_datetime(). ([#255](https://github.com/opsmill/infrahub-sdk-python/issues/255))
72+
- Remove default value "main" for branch parameter from all Infrahub CTL commands. ([#264](https://github.com/opsmill/infrahub-sdk-python/issues/264))
73+
- Fixed support for Python 3.13, it's no longer required to have Rust installed on the system.
74+
75+
### Housekeeping
76+
77+
- Move the function `read_file` from the ctl module to the SDK.
2978
- Fixed typing for Python 3.9 and removed support for Python 3.13. ([#251](https://github.com/opsmill/infrahub-sdk-python/issues/251))
3079
- Removed default value "main" for branch parameter from all Infrahub CTL commands. ([#264](https://github.com/opsmill/infrahub-sdk-python/issues/264))
3180

changelog/+store-group-as-member-of-generator-group.changed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/15.fixed.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/docs/python-sdk/guides/query_data.mdx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,7 @@ The `get` and `filters` query methods allow you to use filters. Filters specify
1919

2020
### Discovering available filters
2121

22-
The easiest way to discover the available filters for a kind of node is by querying the schema.
23-
24-
<Tabs groupId="async-sync">
25-
<TabItem value="Async" default>
26-
27-
```python
28-
tag_schema = await client.schema.get("BuiltinTag")
29-
print(tag_schema.filters)
30-
```
31-
32-
</TabItem>
33-
<TabItem value="Sync">
34-
35-
```python
36-
tag_schema = client.schema.get("BuiltinTag")
37-
print(tag_schema.filters)
38-
```
39-
40-
</TabItem>
41-
</Tabs>
22+
The easiest way to discover the available filters for a kind of node is by opening the GraphQLi Explorer in the GraphQL sandbox. Under each GraphQL query you will find the available filters.
4223

4324
### Attribute filters
4425

@@ -435,7 +416,8 @@ You can exclude attributes and relationships that are retrieved with a query by
435416

436417
### Fetching relationships manually
437418

438-
The `fetch` method can be used to retrieve relationships that are not retrieved as part of a query. The `fetch` method will initialized the relationship, if was not yet initialized and retrieve the related nodes.
419+
The `fetch` method can be used to retrieve relationships, initialize them; and retrieving the related nodes manually.
420+
The `fetch` method can also be used on relationship that were previously initialized.
439421

440422
<Tabs groupId="async-sync">
441423
<TabItem value="Async" default>
@@ -466,8 +448,6 @@ The `fetch` method can be used to retrieve relationships that are not retrieved
466448
</TabItem>
467449
</Tabs>
468450

469-
The `fetch` method can also be used to `fetch` the related nodes of a relationship that was already initialized or retrieved as part of the query.
470-
471451
<Tabs groupId="async-sync">
472452
<TabItem value="Async" default>
473453

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
---
22
title: Python SDK
33
---
4-
import Tabs from '@theme/Tabs';
5-
import TabItem from '@theme/TabItem';
6-
7-
# Python SDK
84

95
The Infrahub Python SDK greatly simplifies how you can interact with Infrahub programmatically.
106

7+
## Blog Posts
8+
9+
- [Querying Data in Infrahub via the Python SDK](https://www.opsmill.com/querying-data-in-infrahub-via-the-python-sdk/)
10+
1111
## Guides
1212

13-
- [Installing infrahub-sdk](./guides/installation)
14-
- [Creating a client](./guides/client)
15-
- [Querying data in Infrahub](./guides/query_data)
16-
- [Managing nodes](./guides/create_update_delete)
17-
- [Managing branches](./guides/branches)
18-
- [Using the client store](./guides/store)
19-
- [Using the client tracking mode](./guides/tracking)
13+
- [Installing infrahub-sdk](./guides/installation.mdx)
14+
- [Creating a client](./guides/client.mdx)
15+
- [Querying data in Infrahub](./guides/query_data.mdx)
16+
- [Managing nodes](./guides/create_update_delete.mdx)
17+
- [Managing branches](./guides/branches.mdx)
18+
- [Using the client store](./guides/store.mdx)
19+
- [Using the client tracking mode](./guides/tracking.mdx)
2020

2121
## Topics
2222

23-
- [Understanding tracking in the Python SDK](./topics/tracking)
23+
- [Understanding tracking in the Python SDK](./topics/tracking.mdx)
2424

2525
## Reference
2626

27-
- [Client configuration](./reference/config)
27+
- [Client configuration](./reference/config.mdx)
28+
- [Python SDK Release Notes](https://github.com/opsmill/infrahub-sdk-python/releases)

0 commit comments

Comments
 (0)