oblidog-client 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oblidog_client-0.1.1/.github/dependabot.yml +19 -0
- oblidog_client-0.1.1/.github/workflows/ci.yml +66 -0
- oblidog_client-0.1.1/.github/workflows/docs-pages.yml +61 -0
- oblidog_client-0.1.1/.github/workflows/prepare-release.yml +111 -0
- oblidog_client-0.1.1/.github/workflows/release.yml +138 -0
- oblidog_client-0.1.1/.github/workflows/update-from-ledger.yml +124 -0
- oblidog_client-0.1.1/.gitignore +10 -0
- oblidog_client-0.1.1/CONTRIBUTING.md +40 -0
- oblidog_client-0.1.1/LICENSE +21 -0
- oblidog_client-0.1.1/PKG-INFO +89 -0
- oblidog_client-0.1.1/README.md +63 -0
- oblidog_client-0.1.1/docs/getting-started.md +28 -0
- oblidog_client-0.1.1/docs/index.md +12 -0
- oblidog_client-0.1.1/docs/reference/category-data.md +9 -0
- oblidog_client-0.1.1/docs/reference/client.md +9 -0
- oblidog_client-0.1.1/docs/reference/exceptions.md +9 -0
- oblidog_client-0.1.1/docs/reference/models.md +17 -0
- oblidog_client-0.1.1/docs/reference/obligations.md +13 -0
- oblidog_client-0.1.1/docs/releasing.md +43 -0
- oblidog_client-0.1.1/mkdocs.yml +40 -0
- oblidog_client-0.1.1/openapi/.gitkeep +0 -0
- oblidog_client-0.1.1/openapi/integration.json +2129 -0
- oblidog_client-0.1.1/openapi-client.yaml +3 -0
- oblidog_client-0.1.1/pyproject.toml +69 -0
- oblidog_client-0.1.1/scripts/__init__.py +1 -0
- oblidog_client-0.1.1/scripts/smoke_installed.py +47 -0
- oblidog_client-0.1.1/scripts/verify-package.sh +18 -0
- oblidog_client-0.1.1/scripts/verify_dist.py +103 -0
- oblidog_client-0.1.1/scripts/verify_release.py +121 -0
- oblidog_client-0.1.1/src/oblidog_client/__init__.py +57 -0
- oblidog_client-0.1.1/src/oblidog_client/client.py +568 -0
- oblidog_client-0.1.1/src/oblidog_client/exceptions.py +32 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/__init__.py +8 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/__init__.py +1 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/__init__.py +1 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_append_integration_obligation_note.py +182 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_cancel_integration_obligation.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_create_integration_category_data_record.py +172 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_finish_integration_run.py +172 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_mark_integration_obligation_error.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_mark_integration_obligation_paid.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_mark_integration_obligation_ready.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_category_data_records.py +226 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_category_data_schema.py +128 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_context.py +132 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_obligation.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_obligation_components.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_integration_obligations.py +214 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_read_latest_integration_category_data_record.py +128 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_reopen_integration_obligation.py +161 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_start_integration_run.py +172 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_update_integration_obligation.py +186 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/api/integration/integration_upsert_integration_obligation_component.py +188 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/client.py +282 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/errors.py +16 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/__init__.py +89 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/category_data_record_public.py +131 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/category_data_record_public_data.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/category_data_records_public.py +83 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/category_data_schema_public.py +96 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/category_data_schema_public_schema.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/context.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/counterparty_summary_public.py +98 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/current_value_source.py +12 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/effective_value_source_mode.py +13 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/http_validation_error.py +79 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_category_data_record_create.py +84 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_category_data_record_create_data.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_conflict_code.py +12 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_conflict_detail.py +63 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_conflict_response.py +67 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_credential_public.py +154 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_execution_state.py +11 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_health.py +14 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_obligation_component_upsert.py +133 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_obligation_component_upsert_metadata_type_0.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_public.py +431 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_result.py +9 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_run_error.py +50 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_run_finish.py +101 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/integration_run_start.py +51 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_component_public.py +187 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_component_public_metadata_type_0.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_components_public.py +83 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_integration_update.py +116 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_lifecycle.py +13 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_note_append.py +42 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_period_public.py +69 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligation_public.py +375 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/obligations_public.py +83 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/response_integration_read_integration_context.py +47 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/validation_error.py +123 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/models/value_state.py +11 -0
- oblidog_client-0.1.1/src/oblidog_client/generated/types.py +54 -0
- oblidog_client-0.1.1/tests/test_client.py +634 -0
- oblidog_client-0.1.1/tests/test_package.py +41 -0
- oblidog_client-0.1.1/tests/test_verify_release.py +78 -0
- oblidog_client-0.1.1/uv.lock +1458 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "uv"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
groups:
|
|
8
|
+
python-dependencies:
|
|
9
|
+
patterns:
|
|
10
|
+
- "*"
|
|
11
|
+
|
|
12
|
+
- package-ecosystem: "github-actions"
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: "weekly"
|
|
16
|
+
groups:
|
|
17
|
+
github-actions:
|
|
18
|
+
patterns:
|
|
19
|
+
- "*"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: true
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
quality:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v7
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v7
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v7
|
|
32
|
+
|
|
33
|
+
- name: Sync dependencies
|
|
34
|
+
run: uv sync --all-groups
|
|
35
|
+
|
|
36
|
+
- name: Ruff check
|
|
37
|
+
run: uv run ruff check src tests scripts
|
|
38
|
+
|
|
39
|
+
- name: Ruff format check
|
|
40
|
+
run: uv run ruff format --check src tests scripts
|
|
41
|
+
|
|
42
|
+
- name: Tests
|
|
43
|
+
run: uv run pytest -q
|
|
44
|
+
|
|
45
|
+
- name: Build documentation
|
|
46
|
+
run: uv run --group docs mkdocs build --strict
|
|
47
|
+
|
|
48
|
+
- name: Compile package
|
|
49
|
+
run: python -m compileall -q src/oblidog_client
|
|
50
|
+
|
|
51
|
+
distribution:
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- name: Checkout
|
|
55
|
+
uses: actions/checkout@v7
|
|
56
|
+
|
|
57
|
+
- name: Set up Python
|
|
58
|
+
uses: actions/setup-python@v7
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.12"
|
|
61
|
+
|
|
62
|
+
- name: Install uv
|
|
63
|
+
uses: astral-sh/setup-uv@v7
|
|
64
|
+
|
|
65
|
+
- name: Verify distributions and installed API
|
|
66
|
+
run: ./scripts/verify-package.sh
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Publish documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: github-pages
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
pages: write
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v7
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v7
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v7
|
|
32
|
+
|
|
33
|
+
- name: Sync locked documentation environment
|
|
34
|
+
run: uv sync --locked --group docs
|
|
35
|
+
|
|
36
|
+
- name: Configure GitHub Pages
|
|
37
|
+
uses: actions/configure-pages@v6
|
|
38
|
+
with:
|
|
39
|
+
enablement: true
|
|
40
|
+
|
|
41
|
+
- name: Build documentation
|
|
42
|
+
run: uv run --group docs mkdocs build --strict
|
|
43
|
+
|
|
44
|
+
- name: Upload Pages artifact
|
|
45
|
+
uses: actions/upload-pages-artifact@v5
|
|
46
|
+
with:
|
|
47
|
+
path: site
|
|
48
|
+
|
|
49
|
+
deploy:
|
|
50
|
+
needs: build
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
environment:
|
|
53
|
+
name: github-pages
|
|
54
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
55
|
+
permissions:
|
|
56
|
+
pages: write
|
|
57
|
+
id-token: write
|
|
58
|
+
steps:
|
|
59
|
+
- name: Deploy to GitHub Pages
|
|
60
|
+
id: deployment
|
|
61
|
+
uses: actions/deploy-pages@v5
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Prepare release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: prepare-release-main
|
|
14
|
+
cancel-in-progress: false
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
prepare-release:
|
|
18
|
+
if: github.actor != 'github-actions[bot]'
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v7
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@v7
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.12"
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@v7
|
|
33
|
+
|
|
34
|
+
- name: Sync locked dependencies
|
|
35
|
+
run: uv sync --all-groups --locked
|
|
36
|
+
|
|
37
|
+
- name: Check initial release is finalized
|
|
38
|
+
id: state
|
|
39
|
+
shell: bash
|
|
40
|
+
run: |
|
|
41
|
+
current_version="$(uv run cz version -p)"
|
|
42
|
+
if ! git rev-parse -q --verify "refs/tags/v${current_version}" >/dev/null; then
|
|
43
|
+
echo "v${current_version} is not tagged; create the initial release first."
|
|
44
|
+
echo "ready=false" >> "$GITHUB_OUTPUT"
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
echo "ready=true" >> "$GITHUB_OUTPUT"
|
|
48
|
+
|
|
49
|
+
- name: Determine next version
|
|
50
|
+
if: steps.state.outputs.ready == 'true'
|
|
51
|
+
id: version
|
|
52
|
+
shell: bash
|
|
53
|
+
run: |
|
|
54
|
+
set +e
|
|
55
|
+
next_version="$(uv run cz bump --dry-run --yes --get-next)"
|
|
56
|
+
status=$?
|
|
57
|
+
set -e
|
|
58
|
+
if [[ $status -eq 3 || $status -eq 21 ]]; then
|
|
59
|
+
echo "No releasable Conventional Commit found."
|
|
60
|
+
echo "should_release=false" >> "$GITHUB_OUTPUT"
|
|
61
|
+
exit 0
|
|
62
|
+
fi
|
|
63
|
+
if [[ $status -ne 0 ]]; then
|
|
64
|
+
exit "$status"
|
|
65
|
+
fi
|
|
66
|
+
echo "should_release=true" >> "$GITHUB_OUTPUT"
|
|
67
|
+
echo "version=$next_version" >> "$GITHUB_OUTPUT"
|
|
68
|
+
|
|
69
|
+
- name: Check release branch
|
|
70
|
+
if: steps.version.outputs.should_release == 'true'
|
|
71
|
+
id: branch
|
|
72
|
+
env:
|
|
73
|
+
RELEASE_BRANCH: release/v${{ steps.version.outputs.version }}
|
|
74
|
+
shell: bash
|
|
75
|
+
run: |
|
|
76
|
+
if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then
|
|
77
|
+
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
78
|
+
else
|
|
79
|
+
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
- name: Prepare and push release branch
|
|
83
|
+
if: steps.version.outputs.should_release == 'true' && steps.branch.outputs.exists == 'false'
|
|
84
|
+
env:
|
|
85
|
+
RELEASE_BRANCH: release/v${{ steps.version.outputs.version }}
|
|
86
|
+
RELEASE_VERSION: ${{ steps.version.outputs.version }}
|
|
87
|
+
shell: bash
|
|
88
|
+
run: |
|
|
89
|
+
git config user.name "github-actions[bot]"
|
|
90
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
91
|
+
uv run cz bump --yes --check-consistency
|
|
92
|
+
git tag -d "v${RELEASE_VERSION}"
|
|
93
|
+
uv lock
|
|
94
|
+
git add uv.lock
|
|
95
|
+
git commit --amend --no-edit
|
|
96
|
+
git push origin HEAD:"refs/heads/${RELEASE_BRANCH}"
|
|
97
|
+
|
|
98
|
+
- name: Ensure release pull request
|
|
99
|
+
if: steps.version.outputs.should_release == 'true'
|
|
100
|
+
env:
|
|
101
|
+
GH_TOKEN: ${{ github.token }}
|
|
102
|
+
RELEASE_BRANCH: release/v${{ steps.version.outputs.version }}
|
|
103
|
+
RELEASE_VERSION: ${{ steps.version.outputs.version }}
|
|
104
|
+
shell: bash
|
|
105
|
+
run: |
|
|
106
|
+
if gh pr list --base main --head "$RELEASE_BRANCH" --state open --json url --jq '.[0].url' | grep -q .; then
|
|
107
|
+
exit 0
|
|
108
|
+
fi
|
|
109
|
+
gh pr create --base main --head "$RELEASE_BRANCH" \
|
|
110
|
+
--title "bump: version $RELEASE_VERSION" \
|
|
111
|
+
--body "Automated release preparation for v$RELEASE_VERSION. Merge after checks pass, then publish a GitHub Release for v$RELEASE_VERSION to release the package to PyPI."
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- published
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
release_tag:
|
|
10
|
+
description: Existing vX.Y.Z or vX.Y.ZrcN tag to publish to TestPyPI
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
target:
|
|
14
|
+
description: Manual runs are restricted to TestPyPI
|
|
15
|
+
required: true
|
|
16
|
+
type: choice
|
|
17
|
+
options:
|
|
18
|
+
- testpypi
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
|
|
23
|
+
concurrency:
|
|
24
|
+
group: oblidog-client-package-release
|
|
25
|
+
cancel-in-progress: false
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
outputs:
|
|
31
|
+
release-tag: ${{ steps.release.outputs.tag }}
|
|
32
|
+
target: ${{ steps.release.outputs.target }}
|
|
33
|
+
steps:
|
|
34
|
+
- name: Resolve release target
|
|
35
|
+
id: release
|
|
36
|
+
env:
|
|
37
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
38
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
39
|
+
MANUAL_TAG: ${{ inputs.release_tag }}
|
|
40
|
+
shell: bash
|
|
41
|
+
run: |
|
|
42
|
+
if [[ "$EVENT_NAME" == "release" ]]; then
|
|
43
|
+
echo "tag=$RELEASE_TAG" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "target=pypi" >> "$GITHUB_OUTPUT"
|
|
45
|
+
else
|
|
46
|
+
echo "tag=$MANUAL_TAG" >> "$GITHUB_OUTPUT"
|
|
47
|
+
echo "target=testpypi" >> "$GITHUB_OUTPUT"
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
- name: Checkout release tag
|
|
51
|
+
uses: actions/checkout@v7
|
|
52
|
+
with:
|
|
53
|
+
ref: ${{ steps.release.outputs.tag }}
|
|
54
|
+
|
|
55
|
+
- name: Set up Python
|
|
56
|
+
uses: actions/setup-python@v7
|
|
57
|
+
with:
|
|
58
|
+
python-version: "3.12"
|
|
59
|
+
|
|
60
|
+
- name: Install uv
|
|
61
|
+
uses: astral-sh/setup-uv@v7
|
|
62
|
+
|
|
63
|
+
- name: Sync locked dependencies
|
|
64
|
+
run: uv sync --all-groups --locked
|
|
65
|
+
|
|
66
|
+
- name: Verify tag and publication order
|
|
67
|
+
env:
|
|
68
|
+
RELEASE_TAG: ${{ steps.release.outputs.tag }}
|
|
69
|
+
RELEASE_TARGET: ${{ steps.release.outputs.target }}
|
|
70
|
+
run: uv run python scripts/verify_release.py "$RELEASE_TAG" "$RELEASE_TARGET"
|
|
71
|
+
|
|
72
|
+
- name: Ruff check
|
|
73
|
+
run: uv run ruff check src tests scripts
|
|
74
|
+
|
|
75
|
+
- name: Ruff format check
|
|
76
|
+
run: uv run ruff format --check src tests scripts
|
|
77
|
+
|
|
78
|
+
- name: Tests
|
|
79
|
+
run: uv run pytest -q
|
|
80
|
+
|
|
81
|
+
- name: Compile package
|
|
82
|
+
run: python -m compileall -q src/oblidog_client
|
|
83
|
+
|
|
84
|
+
- name: Build and verify distributions
|
|
85
|
+
run: ./scripts/verify-package.sh
|
|
86
|
+
|
|
87
|
+
- name: Upload verified distributions
|
|
88
|
+
uses: actions/upload-artifact@v7
|
|
89
|
+
with:
|
|
90
|
+
name: python-distributions
|
|
91
|
+
path: dist/
|
|
92
|
+
if-no-files-found: error
|
|
93
|
+
retention-days: 7
|
|
94
|
+
|
|
95
|
+
publish-testpypi:
|
|
96
|
+
if: github.event_name == 'workflow_dispatch'
|
|
97
|
+
needs: build
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
environment:
|
|
100
|
+
name: testpypi
|
|
101
|
+
url: https://test.pypi.org/project/oblidog-client/
|
|
102
|
+
permissions:
|
|
103
|
+
contents: read
|
|
104
|
+
id-token: write
|
|
105
|
+
steps:
|
|
106
|
+
- name: Download verified distributions
|
|
107
|
+
uses: actions/download-artifact@v8
|
|
108
|
+
with:
|
|
109
|
+
name: python-distributions
|
|
110
|
+
path: dist/
|
|
111
|
+
|
|
112
|
+
- name: Publish to TestPyPI
|
|
113
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
114
|
+
with:
|
|
115
|
+
packages-dir: dist/
|
|
116
|
+
repository-url: https://test.pypi.org/legacy/
|
|
117
|
+
|
|
118
|
+
publish-pypi:
|
|
119
|
+
if: github.event_name == 'release' && github.event.action == 'published'
|
|
120
|
+
needs: build
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
environment:
|
|
123
|
+
name: pypi
|
|
124
|
+
url: https://pypi.org/project/oblidog-client/
|
|
125
|
+
permissions:
|
|
126
|
+
contents: read
|
|
127
|
+
id-token: write
|
|
128
|
+
steps:
|
|
129
|
+
- name: Download verified distributions
|
|
130
|
+
uses: actions/download-artifact@v8
|
|
131
|
+
with:
|
|
132
|
+
name: python-distributions
|
|
133
|
+
path: dist/
|
|
134
|
+
|
|
135
|
+
- name: Publish to PyPI
|
|
136
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
137
|
+
with:
|
|
138
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
name: Update client from Oblidog Ledger
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
repository_dispatch:
|
|
5
|
+
types:
|
|
6
|
+
- ledger-release
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
release_tag:
|
|
10
|
+
description: Oblidog Ledger release tag, for example v0.2.0
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: update-client-from-ledger
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
regenerate:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v7
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
|
|
31
|
+
- name: Resolve Ledger release tag
|
|
32
|
+
id: release
|
|
33
|
+
env:
|
|
34
|
+
DISPATCH_TAG: ${{ github.event.client_payload.tag_name }}
|
|
35
|
+
MANUAL_TAG: ${{ inputs.release_tag }}
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
tag="${DISPATCH_TAG:-$MANUAL_TAG}"
|
|
39
|
+
if [[ -z "$tag" ]]; then
|
|
40
|
+
echo "Ledger release tag is required" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
44
|
+
|
|
45
|
+
- name: Set up Python
|
|
46
|
+
uses: actions/setup-python@v7
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
|
|
50
|
+
- name: Install uv
|
|
51
|
+
uses: astral-sh/setup-uv@v7
|
|
52
|
+
|
|
53
|
+
- name: Download integration OpenAPI schema
|
|
54
|
+
env:
|
|
55
|
+
RELEASE_TAG: ${{ steps.release.outputs.tag }}
|
|
56
|
+
shell: bash
|
|
57
|
+
run: |
|
|
58
|
+
mkdir -p openapi
|
|
59
|
+
base_url="https://github.com/oblidog/oblidog-ledger/releases/download/${RELEASE_TAG}"
|
|
60
|
+
|
|
61
|
+
if curl --fail --location --retry 3 \
|
|
62
|
+
"${base_url}/integration-openapi.json" \
|
|
63
|
+
--output openapi/integration.json; then
|
|
64
|
+
echo "Downloaded integration-openapi.json"
|
|
65
|
+
else
|
|
66
|
+
echo "Canonical asset not found; trying legacy integration.json"
|
|
67
|
+
curl --fail --location --retry 3 \
|
|
68
|
+
"${base_url}/integration.json" \
|
|
69
|
+
--output openapi/integration.json
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
- name: Generate client
|
|
73
|
+
run: |
|
|
74
|
+
uvx --from openapi-python-client==0.29.0 openapi-python-client generate \
|
|
75
|
+
--fail-on-warning \
|
|
76
|
+
--path openapi/integration.json \
|
|
77
|
+
--config openapi-client.yaml \
|
|
78
|
+
--meta none \
|
|
79
|
+
--output-path src/oblidog_client/generated \
|
|
80
|
+
--overwrite
|
|
81
|
+
|
|
82
|
+
- name: Validate generated client
|
|
83
|
+
run: |
|
|
84
|
+
python -m compileall -q src/oblidog_client/generated
|
|
85
|
+
uv build
|
|
86
|
+
|
|
87
|
+
- name: Create update pull request
|
|
88
|
+
env:
|
|
89
|
+
GH_TOKEN: ${{ github.token }}
|
|
90
|
+
RELEASE_TAG: ${{ steps.release.outputs.tag }}
|
|
91
|
+
shell: bash
|
|
92
|
+
run: |
|
|
93
|
+
changes="$(git status --porcelain -- openapi/integration.json src/oblidog_client/generated)"
|
|
94
|
+
if [[ -z "$changes" ]]; then
|
|
95
|
+
echo "No client changes for ${RELEASE_TAG}."
|
|
96
|
+
exit 0
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
branch="bot/update-from-ledger-${RELEASE_TAG}"
|
|
100
|
+
|
|
101
|
+
git config user.name "github-actions[bot]"
|
|
102
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
103
|
+
git checkout -B "$branch"
|
|
104
|
+
git add openapi/integration.json src/oblidog_client/generated
|
|
105
|
+
git commit -m "chore: regenerate client from ledger ${RELEASE_TAG}"
|
|
106
|
+
git push --force origin "$branch"
|
|
107
|
+
|
|
108
|
+
existing_pr="$(gh pr list \
|
|
109
|
+
--base main \
|
|
110
|
+
--head "$branch" \
|
|
111
|
+
--state open \
|
|
112
|
+
--json url \
|
|
113
|
+
--jq '.[0].url // empty')"
|
|
114
|
+
|
|
115
|
+
if [[ -n "$existing_pr" ]]; then
|
|
116
|
+
echo "Update PR already exists: $existing_pr"
|
|
117
|
+
exit 0
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
gh pr create \
|
|
121
|
+
--base main \
|
|
122
|
+
--head "$branch" \
|
|
123
|
+
--title "chore: update client from ledger ${RELEASE_TAG}" \
|
|
124
|
+
--body "Regenerates the low-level Python client from the integration OpenAPI contract published with Oblidog Ledger ${RELEASE_TAG}."
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Branching
|
|
4
|
+
|
|
5
|
+
`main` is the only long-lived branch and should stay releasable.
|
|
6
|
+
|
|
7
|
+
Create short-lived branches for all changes, for example:
|
|
8
|
+
|
|
9
|
+
- `feat/...` for features
|
|
10
|
+
- `fix/...` for fixes
|
|
11
|
+
- `chore/...` for maintenance
|
|
12
|
+
- `bot/update-from-ledger-vX.Y.Z` for generated client updates
|
|
13
|
+
|
|
14
|
+
All changes should reach `main` through pull requests.
|
|
15
|
+
|
|
16
|
+
## Generated code
|
|
17
|
+
|
|
18
|
+
`src/oblidog_client/generated/` is generated from the Oblidog Ledger integration OpenAPI contract. Do not edit files in that directory by hand.
|
|
19
|
+
|
|
20
|
+
The source snapshot used for generation lives in `openapi/integration.json`.
|
|
21
|
+
|
|
22
|
+
## Local checks
|
|
23
|
+
|
|
24
|
+
Run before opening a pull request:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uv sync --all-groups
|
|
28
|
+
uv run ruff check src tests
|
|
29
|
+
uv run ruff format --check src tests
|
|
30
|
+
uv run pytest -q
|
|
31
|
+
uv run --group docs mkdocs build --strict
|
|
32
|
+
uv run --group docs mkdocs serve
|
|
33
|
+
python -m compileall -q src/oblidog_client
|
|
34
|
+
uv build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Generated code is excluded from handwritten Ruff checks and is instead validated by compilation and package build.
|
|
38
|
+
|
|
39
|
+
Use `mkdocs serve` to preview the documentation locally; it watches the source
|
|
40
|
+
files and prints the local URL.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oblidog contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: oblidog-client
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python client for the Oblidog integration API
|
|
5
|
+
Project-URL: Homepage, https://github.com/oblidog/oblidog-client-python
|
|
6
|
+
Project-URL: Documentation, https://oblidog.github.io/oblidog-client-python/
|
|
7
|
+
Project-URL: Repository, https://github.com/oblidog/oblidog-client-python
|
|
8
|
+
Project-URL: Issues, https://github.com/oblidog/oblidog-client-python/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/oblidog/oblidog-client-python/releases
|
|
10
|
+
Author: Oblidog contributors
|
|
11
|
+
Maintainer: wini83
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: integration,oblidog,openapi,sdk
|
|
15
|
+
Classifier: Development Status :: 3 - Alpha
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: attrs>=23.0
|
|
23
|
+
Requires-Dist: httpx>=0.27
|
|
24
|
+
Requires-Dist: pydantic>=2.7
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# oblidog-client
|
|
28
|
+
|
|
29
|
+
Python client for the Oblidog integration API.
|
|
30
|
+
|
|
31
|
+
Use the handwritten `OblidogClient` facade in application code. The
|
|
32
|
+
`oblidog_client.generated` namespace is OpenAPI-generated transport code and is
|
|
33
|
+
an implementation detail, not the recommended SDK API.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install oblidog-client
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
import datetime
|
|
45
|
+
|
|
46
|
+
from oblidog_client import OblidogClient
|
|
47
|
+
|
|
48
|
+
with OblidogClient(base_url="https://oblidog.example.com", api_key="fdg_live_...") as client:
|
|
49
|
+
with client.integrations.run() as run:
|
|
50
|
+
client.category_data.create(
|
|
51
|
+
observed_at=datetime.datetime.now(datetime.UTC),
|
|
52
|
+
data={"meter_reading_kwh": 1234.5},
|
|
53
|
+
)
|
|
54
|
+
run.finish_success(changes_detected=True)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The integration API key selects its integration and category. Use
|
|
58
|
+
`client.integrations.run()` around synchronization work: it reads context and
|
|
59
|
+
starts a run before the block, then reports a sanitized failure if the block
|
|
60
|
+
raises.
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
The full documentation is published at
|
|
65
|
+
[oblidog.github.io/oblidog-client-python](https://oblidog.github.io/oblidog-client-python/).
|
|
66
|
+
It includes a quickstart, public API reference, and supported API boundary; it
|
|
67
|
+
intentionally excludes generated endpoints and transport classes.
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
This project uses `uv` for dependency and environment management. The low-level client is generated from the Oblidog Ledger integration OpenAPI contract; generated code should not be edited manually.
|
|
72
|
+
|
|
73
|
+
Use Commitizen to create Conventional Commit messages interactively, or to
|
|
74
|
+
validate one non-interactively:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv run cz commit
|
|
78
|
+
uv run cz check -m "feat: add a new capability"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Run the same distribution verification used by CI locally:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
./scripts/verify-package.sh
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The command builds the wheel and source distribution, validates their metadata and contents, installs the wheel into a clean environment, and checks the installed public API. It does not publish any artifacts.
|
|
88
|
+
|
|
89
|
+
Release maintainers should follow the [Trusted Publishing setup and release procedure](docs/releasing.md).
|