Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.DEPENDABOT_APP_ID }}
private-key: ${{ secrets.DEPENDABOT_APP_PRIVATE_KEY }}
owner: gradientlabs-ai

- name: Configure git to use HTTPS for gradientlabs-ai repos
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/gradientlabs-ai/".insteadOf "ssh://git@github.com/gradientlabs-ai/"

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync

- name: Check formatting
run: uvx ruff format --check .

- name: Lint
run: uvx ruff check .

- name: Run unit tests
run: |
if [ -d "tests" ]; then
uv run pytest tests/ -m unit || [ $? -eq 5 ] # exit 5 means no tests selected; treat as success
else
echo "No tests directory, skipping"
fi
31 changes: 0 additions & 31 deletions .github/workflows/test.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gradient-labs"
version = "0.11.8"
version = "0.12.0"
description = "Python bindings for the Gradient Labs API"
readme = "README.md"
requires-python = ">=3.9,<4.0"
Expand All @@ -23,10 +23,10 @@ members = ["examples/tools"]
[tool.uv]
constraint-dependencies = [
"urllib3>=2.7.0",
"starlette>=0.49.1",
"starlette>=1.3.1",
"h11>=0.16.0",
"idna>=3.15",
]

[tool.ruff.lint]
ignore = ["D100", "D101"]
ignore = ["D100", "D101", "F403", "F405"]
2 changes: 1 addition & 1 deletion src/gradient_labs/_conversation_add_message.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Any, List
from typing import Optional, List
from datetime import datetime

from dataclasses import dataclass, field
Expand Down
19 changes: 4 additions & 15 deletions src/gradient_labs/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Optional, List
from typing import Optional, List

from ._article_delete import delete_article
from ._article_set_status import set_article_usage_status, SetArticleUsageStatusParams
Expand Down Expand Up @@ -28,8 +28,6 @@
start_outbound_conversation,
StartOutboundConversationParams,
StartOutboundConversationResponse,
CustomerSource,
SupportPlatform,
)

from ._handoff_target_upsert import upsert_hand_off_target, UpsertHandOffTargetParams
Expand Down Expand Up @@ -108,14 +106,9 @@
from .tool import *
from .note import Note
from .secret import Secret
from .resource_type import ResourceType, Scope, RefreshStrategy, SourceConfig
from .resource_type import ResourceType
from .resource_source import (
ResourceSource,
SourceType,
SchemaUpdateStrategy,
ResourceHTTPDefinition,
ResourceHTTPBodyDefinition,
ResourceWebhookDefinition,
)
from .webhook import Webhook, WebhookEvent

Expand Down Expand Up @@ -487,9 +480,7 @@ def set_procedure_gated_version(
params=params,
)

def unset_procedure_gated_version(
self, *, procedure_id: str, version: int
) -> None:
def unset_procedure_gated_version(self, *, procedure_id: str, version: int) -> None:
"""unset_procedure_gated_version removes gated status from a version.

Once unset, the version will no longer be used for A/B testing or served as a gated version.
Expand Down Expand Up @@ -733,9 +724,7 @@ def delete_resource_source(self, *, id: str) -> None:

# ==================== Traffic Group Operations ====================

def create_traffic_group(
self, *, params: CreateTrafficGroupParams
) -> TrafficGroup:
def create_traffic_group(self, *, params: CreateTrafficGroupParams) -> TrafficGroup:
"""create_traffic_group creates a new traffic group.

Note: requires a `Management` API key."""
Expand Down
2 changes: 1 addition & 1 deletion src/gradient_labs/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def parse_signature_header(
timestamp, signatures = cls._get_timestamp_and_signatures(
header, cls.SCHEME
)
except:
except Exception:
return WebhookSignature(valid=False, timestamp=None)

signed_payload = "%d.%s" % (timestamp, payload)
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading