celeste-ai 0.2.4__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.
- celeste_ai-0.2.4/.env.example +38 -0
- celeste_ai-0.2.4/.github/actions/setup-python-uv/action.yml +23 -0
- celeste_ai-0.2.4/.github/workflows/ci.yml +115 -0
- celeste_ai-0.2.4/.github/workflows/claude-code-review.yml +56 -0
- celeste_ai-0.2.4/.github/workflows/claude.yml +49 -0
- celeste_ai-0.2.4/.github/workflows/publish.yml +162 -0
- celeste_ai-0.2.4/.gitignore +159 -0
- celeste_ai-0.2.4/.pre-commit-config.yaml +61 -0
- celeste_ai-0.2.4/LICENSE +201 -0
- celeste_ai-0.2.4/Makefile +86 -0
- celeste_ai-0.2.4/PKG-INFO +176 -0
- celeste_ai-0.2.4/README.md +134 -0
- celeste_ai-0.2.4/logo.svg +11 -0
- celeste_ai-0.2.4/packages/image-generation/README.md +79 -0
- celeste_ai-0.2.4/packages/image-generation/pyproject.toml +39 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/__init__.py +36 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/client.py +82 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/constraints.py +72 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/io.py +58 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/models.py +14 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/parameters.py +23 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/__init__.py +28 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/README.md +13 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/__init__.py +6 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/client.py +156 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/config.py +10 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/models.py +34 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/parameters.py +101 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/bytedance/streaming.py +67 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/__init__.py +6 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/client.py +143 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/config.py +10 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/gemini_api.py +82 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/imagen_api.py +67 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/models.py +86 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/google/parameters.py +67 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/__init__.py +7 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/client.py +138 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/config.py +10 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/models.py +44 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/parameters.py +118 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/providers/openai/streaming.py +76 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/py.typed +0 -0
- celeste_ai-0.2.4/packages/image-generation/src/celeste_image_generation/streaming.py +48 -0
- celeste_ai-0.2.4/packages/image-generation/tests/integration_tests/test_image_generation/__init__.py +1 -0
- celeste_ai-0.2.4/packages/image-generation/tests/integration_tests/test_image_generation/test_generate.py +61 -0
- celeste_ai-0.2.4/packages/image-generation/tests/unit_tests/__init__.py +0 -0
- celeste_ai-0.2.4/packages/image-generation/tests/unit_tests/providers/google/__init__.py +0 -0
- celeste_ai-0.2.4/packages/image-generation/tests/unit_tests/providers/google/test_finish_reason.py +165 -0
- celeste_ai-0.2.4/packages/text-generation/README.md +81 -0
- celeste_ai-0.2.4/packages/text-generation/pyproject.toml +39 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/__init__.py +37 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/client.py +78 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/io.py +57 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/models.py +18 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/parameters.py +23 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/__init__.py +36 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/__init__.py +7 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/client.py +139 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/config.py +14 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/models.py +58 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/parameters.py +289 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/anthropic/streaming.py +343 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/__init__.py +7 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/client.py +134 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/config.py +11 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/models.py +58 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/parameters.py +238 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/cohere/streaming.py +154 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/__init__.py +7 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/client.py +138 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/config.py +10 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/models.py +52 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/parameters.py +227 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/google/streaming.py +164 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/__init__.py +7 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/client.py +129 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/config.py +10 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/models.py +165 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/parameters.py +218 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/mistral/streaming.py +134 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/__init__.py +7 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/client.py +145 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/config.py +10 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/models.py +111 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/parameters.py +222 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/providers/openai/streaming.py +108 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/py.typed +1 -0
- celeste_ai-0.2.4/packages/text-generation/src/celeste_text_generation/streaming.py +44 -0
- celeste_ai-0.2.4/packages/text-generation/tests/integration_tests/test_text_generation/__init__.py +1 -0
- celeste_ai-0.2.4/packages/text-generation/tests/integration_tests/test_text_generation/test_generate.py +57 -0
- celeste_ai-0.2.4/packages/text-generation/tests/integration_tests/test_text_generation/test_stream.py +103 -0
- celeste_ai-0.2.4/pyproject.toml +187 -0
- celeste_ai-0.2.4/src/__init__.py +0 -0
- celeste_ai-0.2.4/src/celeste/__init__.py +132 -0
- celeste_ai-0.2.4/src/celeste/artifacts.py +60 -0
- celeste_ai-0.2.4/src/celeste/client.py +252 -0
- celeste_ai-0.2.4/src/celeste/constraints.py +193 -0
- celeste_ai-0.2.4/src/celeste/core.py +54 -0
- celeste_ai-0.2.4/src/celeste/credentials.py +109 -0
- celeste_ai-0.2.4/src/celeste/exceptions.py +173 -0
- celeste_ai-0.2.4/src/celeste/http.py +209 -0
- celeste_ai-0.2.4/src/celeste/io.py +43 -0
- celeste_ai-0.2.4/src/celeste/mime_types.py +56 -0
- celeste_ai-0.2.4/src/celeste/models.py +117 -0
- celeste_ai-0.2.4/src/celeste/parameters.py +58 -0
- celeste_ai-0.2.4/src/celeste/py.typed +1 -0
- celeste_ai-0.2.4/src/celeste/registry.py +24 -0
- celeste_ai-0.2.4/src/celeste/streaming.py +116 -0
- celeste_ai-0.2.4/tests/unit_tests/test_artifacts.py +209 -0
- celeste_ai-0.2.4/tests/unit_tests/test_client.py +553 -0
- celeste_ai-0.2.4/tests/unit_tests/test_constraints.py +350 -0
- celeste_ai-0.2.4/tests/unit_tests/test_core.py +174 -0
- celeste_ai-0.2.4/tests/unit_tests/test_credentials.py +371 -0
- celeste_ai-0.2.4/tests/unit_tests/test_exceptions.py +251 -0
- celeste_ai-0.2.4/tests/unit_tests/test_http.py +833 -0
- celeste_ai-0.2.4/tests/unit_tests/test_init.py +175 -0
- celeste_ai-0.2.4/tests/unit_tests/test_mime_types.py +155 -0
- celeste_ai-0.2.4/tests/unit_tests/test_models.py +399 -0
- celeste_ai-0.2.4/tests/unit_tests/test_parameters.py +58 -0
- celeste_ai-0.2.4/tests/unit_tests/test_streaming.py +699 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Celeste AI - Environment Variables
|
|
2
|
+
# Copy this file to .env and fill in your API keys
|
|
3
|
+
|
|
4
|
+
# OpenAI
|
|
5
|
+
OPENAI_API_KEY=your-openai-api-key-here
|
|
6
|
+
|
|
7
|
+
# Anthropic
|
|
8
|
+
ANTHROPIC_API_KEY=your-anthropic-api-key-here
|
|
9
|
+
|
|
10
|
+
# Google
|
|
11
|
+
GOOGLE_API_KEY=your-google-api-key-here
|
|
12
|
+
|
|
13
|
+
# Mistral
|
|
14
|
+
MISTRAL_API_KEY=your-mistral-api-key-here
|
|
15
|
+
|
|
16
|
+
# Hugging Face
|
|
17
|
+
HUGGINGFACE_TOKEN=your-huggingface-token-here
|
|
18
|
+
|
|
19
|
+
# Stability AI
|
|
20
|
+
STABILITYAI_API_KEY=your-stabilityai-api-key-here
|
|
21
|
+
|
|
22
|
+
# Replicate
|
|
23
|
+
REPLICATE_API_TOKEN=your-replicate-api-token-here
|
|
24
|
+
|
|
25
|
+
# Cohere
|
|
26
|
+
COHERE_API_KEY=your-cohere-api-key-here
|
|
27
|
+
|
|
28
|
+
# xAI
|
|
29
|
+
XAI_API_KEY=your-xai-api-key-here
|
|
30
|
+
|
|
31
|
+
# Luma
|
|
32
|
+
LUMA_API_KEY=your-luma-api-key-here
|
|
33
|
+
|
|
34
|
+
# Topaz Labs
|
|
35
|
+
TOPAZLABS_API_KEY=your-topazlabs-api-key-here
|
|
36
|
+
|
|
37
|
+
# Perplexity
|
|
38
|
+
PERPLEXITY_API_KEY=your-perplexity-api-key-here
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: 'Setup Python and uv'
|
|
2
|
+
description: 'Set up Python, install uv package manager, and sync project dependencies with workspace support'
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
python-version:
|
|
6
|
+
required: false
|
|
7
|
+
default: '3.12'
|
|
8
|
+
group-deps:
|
|
9
|
+
required: false
|
|
10
|
+
default: 'dev'
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: 'composite'
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: ${{ inputs.python-version }}
|
|
18
|
+
- uses: astral-sh/setup-uv@v3
|
|
19
|
+
with:
|
|
20
|
+
enable-cache: true
|
|
21
|
+
cache-dependency-glob: '**/pyproject.toml'
|
|
22
|
+
- shell: bash
|
|
23
|
+
run: uv sync --all-packages --group ${{ inputs.group-deps }}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main, develop]
|
|
9
|
+
workflow_call:
|
|
10
|
+
inputs:
|
|
11
|
+
python-version:
|
|
12
|
+
required: false
|
|
13
|
+
type: string
|
|
14
|
+
default: '3.12'
|
|
15
|
+
skip-tests:
|
|
16
|
+
required: false
|
|
17
|
+
type: boolean
|
|
18
|
+
default: false
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
format-check:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 1
|
|
30
|
+
- uses: ./.github/actions/setup-python-uv
|
|
31
|
+
with:
|
|
32
|
+
python-version: ${{ inputs.python-version || '3.12' }}
|
|
33
|
+
- run: |
|
|
34
|
+
if [ -d "packages" ]; then
|
|
35
|
+
uv run ruff format --check src/celeste tests/ packages/
|
|
36
|
+
else
|
|
37
|
+
uv run ruff format --check src/celeste tests/
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
lint:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
with:
|
|
45
|
+
fetch-depth: 1
|
|
46
|
+
- uses: ./.github/actions/setup-python-uv
|
|
47
|
+
with:
|
|
48
|
+
python-version: ${{ inputs.python-version || '3.12' }}
|
|
49
|
+
- run: |
|
|
50
|
+
if [ -d "packages" ]; then
|
|
51
|
+
uv run ruff check --output-format=github src/celeste tests/ packages/
|
|
52
|
+
else
|
|
53
|
+
uv run ruff check --output-format=github src/celeste tests/
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
type-check:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v4
|
|
60
|
+
with:
|
|
61
|
+
fetch-depth: 1
|
|
62
|
+
- uses: ./.github/actions/setup-python-uv
|
|
63
|
+
with:
|
|
64
|
+
python-version: ${{ inputs.python-version || '3.12' }}
|
|
65
|
+
- run: |
|
|
66
|
+
if [ -d "packages" ]; then
|
|
67
|
+
uv run mypy -p celeste && uv run mypy tests/ && uv run mypy packages/
|
|
68
|
+
else
|
|
69
|
+
uv run mypy -p celeste && uv run mypy tests/
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
security:
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v4
|
|
76
|
+
with:
|
|
77
|
+
fetch-depth: 1
|
|
78
|
+
- uses: ./.github/actions/setup-python-uv
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ inputs.python-version || '3.12' }}
|
|
81
|
+
- run: |
|
|
82
|
+
if [ -d "packages" ]; then
|
|
83
|
+
uv run bandit -c pyproject.toml -r src/ packages/ -f screen
|
|
84
|
+
else
|
|
85
|
+
uv run bandit -c pyproject.toml -r src/ -f screen
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
test:
|
|
89
|
+
if: ${{ !inputs.skip-tests }}
|
|
90
|
+
runs-on: ${{ matrix.os }}
|
|
91
|
+
strategy:
|
|
92
|
+
fail-fast: false
|
|
93
|
+
matrix:
|
|
94
|
+
python-version: ["3.12", "3.13"]
|
|
95
|
+
os: [ubuntu-latest]
|
|
96
|
+
include:
|
|
97
|
+
- python-version: "3.12"
|
|
98
|
+
os: windows-latest
|
|
99
|
+
- python-version: "3.12"
|
|
100
|
+
os: macos-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
with:
|
|
104
|
+
fetch-depth: 1
|
|
105
|
+
- uses: ./.github/actions/setup-python-uv
|
|
106
|
+
with:
|
|
107
|
+
python-version: ${{ matrix.python-version }}
|
|
108
|
+
- run: uv run pytest tests/unit_tests -v --cov=celeste --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=90
|
|
109
|
+
- uses: codecov/codecov-action@v4
|
|
110
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
111
|
+
with:
|
|
112
|
+
file: ./coverage.xml
|
|
113
|
+
flags: unittests
|
|
114
|
+
name: codecov-umbrella
|
|
115
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Claude Code Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
# Optional: Only run on specific file changes
|
|
7
|
+
# paths:
|
|
8
|
+
# - "src/**/*.ts"
|
|
9
|
+
# - "src/**/*.tsx"
|
|
10
|
+
# - "src/**/*.js"
|
|
11
|
+
# - "src/**/*.jsx"
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude-review:
|
|
15
|
+
# Optional: Filter by PR author
|
|
16
|
+
# if: |
|
|
17
|
+
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
+
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pull-requests: read
|
|
25
|
+
issues: read
|
|
26
|
+
id-token: write
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 1
|
|
33
|
+
|
|
34
|
+
- name: Run Claude Code Review
|
|
35
|
+
id: claude-review
|
|
36
|
+
uses: anthropics/claude-code-action@v1
|
|
37
|
+
with:
|
|
38
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
+
prompt: |
|
|
40
|
+
REPO: ${{ github.repository }}
|
|
41
|
+
PR NUMBER: ${{ github.event.pull_request.number }}
|
|
42
|
+
|
|
43
|
+
Please review this pull request and provide feedback on:
|
|
44
|
+
- Code quality and best practices
|
|
45
|
+
- Potential bugs or issues
|
|
46
|
+
- Performance considerations
|
|
47
|
+
- Security concerns
|
|
48
|
+
- Test coverage
|
|
49
|
+
|
|
50
|
+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
|
51
|
+
|
|
52
|
+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
|
53
|
+
|
|
54
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
55
|
+
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
|
|
56
|
+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Claude Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [created]
|
|
6
|
+
pull_request_review_comment:
|
|
7
|
+
types: [created]
|
|
8
|
+
issues:
|
|
9
|
+
types: [opened, assigned]
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types: [submitted]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
claude:
|
|
15
|
+
if: |
|
|
16
|
+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
pull-requests: read
|
|
24
|
+
issues: read
|
|
25
|
+
id-token: write
|
|
26
|
+
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout repository
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 1
|
|
32
|
+
|
|
33
|
+
- name: Run Claude Code
|
|
34
|
+
id: claude
|
|
35
|
+
uses: anthropics/claude-code-action@v1
|
|
36
|
+
with:
|
|
37
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
+
|
|
39
|
+
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
+
additional_permissions: |
|
|
41
|
+
actions: read
|
|
42
|
+
|
|
43
|
+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
+
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
+
|
|
46
|
+
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
+
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
|
|
49
|
+
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validate-release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
outputs:
|
|
15
|
+
version: ${{ steps.extract-version.outputs.tag_version }}
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- id: extract-version
|
|
19
|
+
run: |
|
|
20
|
+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
|
21
|
+
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
|
|
22
|
+
- id: read-version
|
|
23
|
+
run: |
|
|
24
|
+
python3 << EOF
|
|
25
|
+
import tomllib
|
|
26
|
+
with open('pyproject.toml', 'rb') as f:
|
|
27
|
+
data = tomllib.load(f)
|
|
28
|
+
version = data['project']['version']
|
|
29
|
+
print(f"pyproject_version={version}", file=open('$GITHUB_OUTPUT', 'a'))
|
|
30
|
+
EOF
|
|
31
|
+
- run: |
|
|
32
|
+
TAG_VERSION="${{ steps.extract-version.outputs.tag_version }}"
|
|
33
|
+
PYPROJECT_VERSION="${{ steps.read-version.outputs.pyproject_version }}"
|
|
34
|
+
if [ "$TAG_VERSION" != "$PYPROJECT_VERSION" ]; then
|
|
35
|
+
echo "Version mismatch: tag=$TAG_VERSION, pyproject=$PYPROJECT_VERSION"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
run-ci:
|
|
40
|
+
needs: validate-release
|
|
41
|
+
uses: ./.github/workflows/ci.yml
|
|
42
|
+
secrets: inherit
|
|
43
|
+
|
|
44
|
+
integration-test:
|
|
45
|
+
needs: [validate-release, run-ci]
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
environment:
|
|
48
|
+
name: integration-tests
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
with:
|
|
52
|
+
fetch-depth: 1
|
|
53
|
+
- uses: ./.github/actions/setup-python-uv
|
|
54
|
+
- name: Run integration tests
|
|
55
|
+
env:
|
|
56
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
57
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
58
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
59
|
+
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
|
60
|
+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
|
|
61
|
+
BYTEDANCE_API_KEY: ${{ secrets.BYTEDANCE_API_KEY }}
|
|
62
|
+
run: make integration-test
|
|
63
|
+
|
|
64
|
+
build:
|
|
65
|
+
needs: [validate-release, run-ci, integration-test]
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v4
|
|
69
|
+
with:
|
|
70
|
+
fetch-depth: 1
|
|
71
|
+
- uses: ./.github/actions/setup-python-uv
|
|
72
|
+
- run: uv build --all-packages
|
|
73
|
+
- run: |
|
|
74
|
+
uv pip install twine
|
|
75
|
+
uv run twine check dist/*
|
|
76
|
+
- uses: actions/upload-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: dist
|
|
79
|
+
path: dist/
|
|
80
|
+
|
|
81
|
+
publish-testpypi:
|
|
82
|
+
needs: [build]
|
|
83
|
+
runs-on: ubuntu-latest
|
|
84
|
+
environment:
|
|
85
|
+
name: testpypi
|
|
86
|
+
url: https://test.pypi.org/project/celeste-ai/
|
|
87
|
+
permissions:
|
|
88
|
+
id-token: write
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/download-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: dist
|
|
93
|
+
path: dist/
|
|
94
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
95
|
+
with:
|
|
96
|
+
repository-url: https://test.pypi.org/legacy/
|
|
97
|
+
skip-existing: true
|
|
98
|
+
print-hash: true
|
|
99
|
+
|
|
100
|
+
publish-pypi:
|
|
101
|
+
needs: [publish-testpypi]
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
environment:
|
|
104
|
+
name: pypi
|
|
105
|
+
url: https://pypi.org/project/celeste-ai/
|
|
106
|
+
permissions:
|
|
107
|
+
id-token: write
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/download-artifact@v4
|
|
110
|
+
with:
|
|
111
|
+
name: dist
|
|
112
|
+
path: dist/
|
|
113
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
114
|
+
with:
|
|
115
|
+
skip-existing: true
|
|
116
|
+
print-hash: true
|
|
117
|
+
|
|
118
|
+
github-release:
|
|
119
|
+
needs: [publish-pypi]
|
|
120
|
+
runs-on: ubuntu-latest
|
|
121
|
+
steps:
|
|
122
|
+
- uses: actions/checkout@v4
|
|
123
|
+
with:
|
|
124
|
+
fetch-depth: 0
|
|
125
|
+
- uses: actions/download-artifact@v4
|
|
126
|
+
with:
|
|
127
|
+
name: dist
|
|
128
|
+
path: dist/
|
|
129
|
+
- id: extract-version
|
|
130
|
+
run: |
|
|
131
|
+
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
|
132
|
+
echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT
|
|
133
|
+
- id: changelog
|
|
134
|
+
run: |
|
|
135
|
+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
136
|
+
if [ -z "$PREVIOUS_TAG" ]; then
|
|
137
|
+
CHANGELOG=$(git log --pretty=format:'- %s' --reverse || echo "Initial release")
|
|
138
|
+
else
|
|
139
|
+
CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:'- %s' || echo "No changes")
|
|
140
|
+
fi
|
|
141
|
+
{
|
|
142
|
+
echo 'changelog<<EOF'
|
|
143
|
+
echo "$CHANGELOG"
|
|
144
|
+
echo 'EOF'
|
|
145
|
+
} >> $GITHUB_OUTPUT
|
|
146
|
+
- uses: softprops/action-gh-release@v1
|
|
147
|
+
with:
|
|
148
|
+
tag_name: ${{ github.ref }}
|
|
149
|
+
name: Release v${{ steps.extract-version.outputs.version }}
|
|
150
|
+
body: |
|
|
151
|
+
## Release v${{ steps.extract-version.outputs.version }}
|
|
152
|
+
|
|
153
|
+
### Changes
|
|
154
|
+
${{ steps.changelog.outputs.changelog }}
|
|
155
|
+
|
|
156
|
+
### Installation
|
|
157
|
+
```bash
|
|
158
|
+
uv add "celeste-ai==${{ steps.extract-version.outputs.version }}"
|
|
159
|
+
```
|
|
160
|
+
files: dist/*
|
|
161
|
+
draft: false
|
|
162
|
+
prerelease: false
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
cover/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
local_settings.py
|
|
59
|
+
db.sqlite3
|
|
60
|
+
db.sqlite3-journal
|
|
61
|
+
|
|
62
|
+
# Flask stuff:
|
|
63
|
+
instance/
|
|
64
|
+
.webassets-cache
|
|
65
|
+
|
|
66
|
+
# Scrapy stuff:
|
|
67
|
+
.scrapy
|
|
68
|
+
|
|
69
|
+
# Sphinx documentation
|
|
70
|
+
docs/_build/
|
|
71
|
+
|
|
72
|
+
# PyBuilder
|
|
73
|
+
.pybuilder/
|
|
74
|
+
target/
|
|
75
|
+
|
|
76
|
+
# Jupyter Notebook
|
|
77
|
+
.ipynb_checkpoints
|
|
78
|
+
|
|
79
|
+
# IPython
|
|
80
|
+
profile_default/
|
|
81
|
+
ipython_config.py
|
|
82
|
+
|
|
83
|
+
# pyenv
|
|
84
|
+
.python-version
|
|
85
|
+
|
|
86
|
+
# pipenv
|
|
87
|
+
Pipfile.lock
|
|
88
|
+
|
|
89
|
+
# poetry
|
|
90
|
+
poetry.lock
|
|
91
|
+
|
|
92
|
+
# pdm
|
|
93
|
+
.pdm.toml
|
|
94
|
+
.pdm-python
|
|
95
|
+
.pdm-build/
|
|
96
|
+
|
|
97
|
+
# PEP 582
|
|
98
|
+
__pypackages__/
|
|
99
|
+
|
|
100
|
+
# Celery stuff
|
|
101
|
+
celerybeat-schedule
|
|
102
|
+
celerybeat.pid
|
|
103
|
+
|
|
104
|
+
# SageMath parsed files
|
|
105
|
+
*.sage.py
|
|
106
|
+
|
|
107
|
+
# Environments
|
|
108
|
+
.env
|
|
109
|
+
.venv
|
|
110
|
+
env/
|
|
111
|
+
venv/
|
|
112
|
+
ENV/
|
|
113
|
+
env.bak/
|
|
114
|
+
venv.bak/
|
|
115
|
+
|
|
116
|
+
# Spyder project settings
|
|
117
|
+
.spyderproject
|
|
118
|
+
.spyproject
|
|
119
|
+
|
|
120
|
+
# Rope project settings
|
|
121
|
+
.ropeproject
|
|
122
|
+
|
|
123
|
+
# mkdocs documentation
|
|
124
|
+
/site
|
|
125
|
+
|
|
126
|
+
# mypy
|
|
127
|
+
.mypy_cache/
|
|
128
|
+
.dmypy.json
|
|
129
|
+
dmypy.json
|
|
130
|
+
|
|
131
|
+
# Pyre type checker
|
|
132
|
+
.pyre/
|
|
133
|
+
|
|
134
|
+
# pytype static type analyzer
|
|
135
|
+
.pytype/
|
|
136
|
+
|
|
137
|
+
# Cython debug symbols
|
|
138
|
+
cython_debug/
|
|
139
|
+
|
|
140
|
+
# IDEs
|
|
141
|
+
.vscode/
|
|
142
|
+
.idea/
|
|
143
|
+
*.swp
|
|
144
|
+
*.swo
|
|
145
|
+
*~
|
|
146
|
+
.DS_Store
|
|
147
|
+
|
|
148
|
+
# Backup files
|
|
149
|
+
*.bak
|
|
150
|
+
|
|
151
|
+
# UV
|
|
152
|
+
.uv/
|
|
153
|
+
uv.lock
|
|
154
|
+
|
|
155
|
+
# Ruff
|
|
156
|
+
.ruff_cache/
|
|
157
|
+
|
|
158
|
+
# Security reports
|
|
159
|
+
bandit-report.json
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
4
|
+
rev: v6.0.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: no-commit-to-branch
|
|
7
|
+
name: "๐ซ Prevent commits to protected branches"
|
|
8
|
+
args: [--branch, main, --branch, master, --branch, develop]
|
|
9
|
+
- id: trailing-whitespace
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: check-yaml
|
|
12
|
+
- id: check-added-large-files
|
|
13
|
+
- id: check-toml
|
|
14
|
+
- id: check-merge-conflict
|
|
15
|
+
- id: check-json
|
|
16
|
+
- id: debug-statements # Prevents committing print()/pdb.set_trace() debug statements
|
|
17
|
+
|
|
18
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
19
|
+
rev: v0.14.3
|
|
20
|
+
hooks:
|
|
21
|
+
- id: ruff-check
|
|
22
|
+
args: [--fix]
|
|
23
|
+
files: ^(src/celeste|tests)/
|
|
24
|
+
name: "๐ Lint with Ruff"
|
|
25
|
+
- id: ruff-format
|
|
26
|
+
files: ^(src/celeste|tests)/
|
|
27
|
+
name: "๐ Format with Ruff"
|
|
28
|
+
|
|
29
|
+
- repo: local
|
|
30
|
+
hooks:
|
|
31
|
+
- id: mypy
|
|
32
|
+
name: "๐ Type check with mypy"
|
|
33
|
+
entry: uv run mypy -p celeste
|
|
34
|
+
language: system
|
|
35
|
+
types: [python]
|
|
36
|
+
pass_filenames: false
|
|
37
|
+
- id: mypy-tests
|
|
38
|
+
name: "๐ Type check tests with mypy"
|
|
39
|
+
entry: uv run mypy tests/
|
|
40
|
+
language: system
|
|
41
|
+
types: [python]
|
|
42
|
+
pass_filenames: false
|
|
43
|
+
|
|
44
|
+
- repo: https://github.com/PyCQA/bandit
|
|
45
|
+
rev: 1.8.6
|
|
46
|
+
hooks:
|
|
47
|
+
- id: bandit
|
|
48
|
+
name: "๐ Security check with Bandit"
|
|
49
|
+
args: ["-c", "pyproject.toml", "-r", "src/"]
|
|
50
|
+
additional_dependencies: ["bandit[toml]"]
|
|
51
|
+
|
|
52
|
+
- repo: local
|
|
53
|
+
hooks:
|
|
54
|
+
- id: pytest
|
|
55
|
+
name: "๐งช Run tests with coverage"
|
|
56
|
+
entry: uv run pytest tests/unit_tests --cov=celeste --cov-report=term-missing
|
|
57
|
+
language: system
|
|
58
|
+
types: [python]
|
|
59
|
+
pass_filenames: false
|
|
60
|
+
always_run: true
|
|
61
|
+
stages: [pre-push] # Run on push, not commit (keeps commits fast)
|