Skip to content

Commit bbc7d6f

Browse files
authored
Merge pull request #4625 from opsmill/dga-20241014-fix-4234
Integrate python SDK into main python project
2 parents da84370 + 7598cd5 commit bbc7d6f

File tree

11 files changed

+137
-1298
lines changed

11 files changed

+137
-1298
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,12 @@ jobs:
252252
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
253253
- name: "Setup Python environment"
254254
run: |
255-
poetry config virtualenvs.create false
256-
pip install toml invoke
255+
poetry config virtualenvs.create true --local
256+
poetry env use 3.12
257257
- name: "Install dependencies"
258258
run: "poetry install --no-interaction --no-ansi"
259259
- name: "Unit Tests"
260-
run: "invoke backend.test-unit"
260+
run: "poetry run invoke backend.test-unit"
261261
- name: "Coveralls : Unit Tests"
262262
uses: coverallsapp/github-action@v2
263263
continue-on-error: true
@@ -305,16 +305,16 @@ jobs:
305305
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
306306
- name: "Setup Python environment"
307307
run: |
308-
poetry config virtualenvs.create false
309-
pip install toml invoke
308+
poetry config virtualenvs.create true --local
309+
poetry env use 3.12
310310
- name: "Install dependencies"
311311
run: "poetry install --no-interaction --no-ansi"
312312
- name: "Mypy Tests"
313-
run: "invoke backend.mypy"
313+
run: "poetry run invoke backend.mypy"
314314
- name: "Pylint Tests"
315-
run: "invoke backend.pylint"
315+
run: "poetry run invoke backend.pylint"
316316
- name: "Integration Tests"
317-
run: "invoke backend.test-integration"
317+
run: "poetry run invoke backend.test-integration"
318318
- name: "Coveralls : Integration Tests"
319319
uses: coverallsapp/github-action@v2
320320
continue-on-error: true
@@ -366,12 +366,12 @@ jobs:
366366
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
367367
- name: "Setup Python environment"
368368
run: |
369-
poetry config virtualenvs.create false
370-
pip install toml invoke
369+
poetry config virtualenvs.create true --local
370+
poetry env use 3.12
371371
- name: "Install dependencies"
372372
run: "poetry install --no-interaction --no-ansi"
373373
- name: "Unit Tests"
374-
run: "invoke backend.test-unit"
374+
run: "poetry run invoke backend.test-unit"
375375

376376
backend-validate-generated:
377377
if: |
@@ -829,8 +829,8 @@ jobs:
829829
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
830830
- name: "Setup Python environment"
831831
run: |
832-
poetry config virtualenvs.create false
833-
pip install toml invoke
832+
poetry config virtualenvs.create true --local
833+
poetry env use 3.12
834834
- name: "Install dependencies"
835835
run: "poetry install --no-interaction --no-ansi"
836836
- name: Update PATH

backend/infrahub/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import importlib.metadata
22

3-
__version__ = importlib.metadata.version("infrahub")
3+
__version__ = importlib.metadata.version("infrahub-server")

backend/infrahub/menu/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass, field
4-
from typing import TYPE_CHECKING, Self
4+
from typing import TYPE_CHECKING
55

66
from pydantic import BaseModel, Field
7+
from typing_extensions import Self
78

89
from infrahub.core.node import Node
910
from infrahub.core.protocols import CoreMenuItem

backend/infrahub/workflows/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import importlib
2-
from typing import Any, Awaitable, Callable, Self, TypeVar
2+
from typing import Any, Awaitable, Callable, TypeVar
33
from uuid import UUID
44

55
from prefect.client.orchestration import PrefectClient
66
from prefect.client.schemas.actions import DeploymentScheduleCreate
77
from prefect.client.schemas.objects import FlowRun
88
from prefect.client.schemas.schedules import CronSchedule
99
from pydantic import BaseModel
10+
from typing_extensions import Self
1011

1112
from infrahub import __version__
1213

backend/tests/unit/git/test_git_rpc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Optional, Self
3+
from typing import TYPE_CHECKING, Any, Optional
44
from unittest.mock import AsyncMock, patch
55

66
from infrahub_sdk import UUIDT, Config, InfrahubClient
7+
from typing_extensions import Self
78

89
from infrahub.core.constants import InfrahubKind, RepositoryInternalStatus
910
from infrahub.exceptions import RepositoryError
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# `infrahubctl menu`
2+
3+
Manage the menu in a remote Infrahub instance.
4+
5+
**Usage**:
6+
7+
```console
8+
$ infrahubctl menu [OPTIONS] COMMAND [ARGS]...
9+
```
10+
11+
**Options**:
12+
13+
* `--install-completion`: Install completion for the current shell.
14+
* `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
15+
* `--help`: Show this message and exit.
16+
17+
**Commands**:
18+
19+
* `load`: Load one or multiple menu files into...
20+
21+
## `infrahubctl menu load`
22+
23+
Load one or multiple menu files into Infrahub.
24+
25+
**Usage**:
26+
27+
```console
28+
$ infrahubctl menu load [OPTIONS] MENUS...
29+
```
30+
31+
**Arguments**:
32+
33+
* `MENUS...`: [required]
34+
35+
**Options**:
36+
37+
* `--debug / --no-debug`: [default: no-debug]
38+
* `--branch TEXT`: Branch on which to load the menu. [default: main]
39+
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
40+
* `--help`: Show this message and exit.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# `infrahubctl object`
2+
3+
Manage objects in a remote Infrahub instance.
4+
5+
**Usage**:
6+
7+
```console
8+
$ infrahubctl object [OPTIONS] COMMAND [ARGS]...
9+
```
10+
11+
**Options**:
12+
13+
* `--install-completion`: Install completion for the current shell.
14+
* `--show-completion`: Show completion for the current shell, to copy it or customize the installation.
15+
* `--help`: Show this message and exit.
16+
17+
**Commands**:
18+
19+
* `load`: Load one or multiple objects files into...
20+
21+
## `infrahubctl object load`
22+
23+
Load one or multiple objects files into Infrahub.
24+
25+
**Usage**:
26+
27+
```console
28+
$ infrahubctl object load [OPTIONS] PATHS...
29+
```
30+
31+
**Arguments**:
32+
33+
* `PATHS...`: [required]
34+
35+
**Options**:
36+
37+
* `--debug / --no-debug`: [default: no-debug]
38+
* `--branch TEXT`: Branch on which to load the objects. [default: main]
39+
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
40+
* `--help`: Show this message and exit.

docs/docs/python-sdk/reference/config.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ The following settings can be defined in the `Config` class
158158
<!-- vale on -->
159159
**Description**: Default connection timeout in seconds<br />
160160
**Type**: `integer`<br />
161-
**Default value**: 10<br />
161+
**Default value**: 60<br />
162162
**Environment variable**: `INFRAHUB_TIMEOUT`<br />
163163
<!-- vale off -->
164164
## transport

0 commit comments

Comments
 (0)