llmentary 0.2.0__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.
- llmentary-0.2.0/.github/CODEOWNERS +1 -0
- llmentary-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yml +121 -0
- llmentary-0.2.0/.github/ISSUE_TEMPLATE/config.yml +11 -0
- llmentary-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yml +31 -0
- llmentary-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +19 -0
- llmentary-0.2.0/.github/labels.yml +48 -0
- llmentary-0.2.0/.github/workflows/ci.yml +204 -0
- llmentary-0.2.0/.github/workflows/hygiene.yml +283 -0
- llmentary-0.2.0/.github/workflows/labels.yml +32 -0
- llmentary-0.2.0/.github/workflows/release-please.yml +39 -0
- llmentary-0.2.0/.github/workflows/release.yml +134 -0
- llmentary-0.2.0/.github/workflows/scorecard.yml +53 -0
- llmentary-0.2.0/.github/workflows/security.yml +133 -0
- llmentary-0.2.0/.gitignore +10 -0
- llmentary-0.2.0/.gitleaks.toml +18 -0
- llmentary-0.2.0/.release-please-manifest.json +3 -0
- llmentary-0.2.0/CHANGELOG.md +36 -0
- llmentary-0.2.0/CODE_OF_CONDUCT.md +77 -0
- llmentary-0.2.0/CONTRIBUTING.md +138 -0
- llmentary-0.2.0/LICENSE +21 -0
- llmentary-0.2.0/PKG-INFO +179 -0
- llmentary-0.2.0/PROXY_VERSION +1 -0
- llmentary-0.2.0/README.md +141 -0
- llmentary-0.2.0/SECURITY.md +86 -0
- llmentary-0.2.0/codecov.yml +19 -0
- llmentary-0.2.0/docs/api.md +150 -0
- llmentary-0.2.0/docs/binaries.md +35 -0
- llmentary-0.2.0/docs/pytest.md +121 -0
- llmentary-0.2.0/docs/releasing.md +78 -0
- llmentary-0.2.0/licenses/AGPL-3.0.txt +235 -0
- llmentary-0.2.0/pyproject.toml +105 -0
- llmentary-0.2.0/release-please-config.json +14 -0
- llmentary-0.2.0/renovate.json +76 -0
- llmentary-0.2.0/scripts/build_release_wheels.py +487 -0
- llmentary-0.2.0/scripts/check-dist-license-files.py +332 -0
- llmentary-0.2.0/scripts/check-gitleaks-config.sh +82 -0
- llmentary-0.2.0/scripts/check-pinned-actions.sh +119 -0
- llmentary-0.2.0/scripts/check-pr-oidc.sh +253 -0
- llmentary-0.2.0/scripts/check-readme.sh +61 -0
- llmentary-0.2.0/scripts/check-ref-on-main.sh +123 -0
- llmentary-0.2.0/scripts/check-secret-scope.sh +515 -0
- llmentary-0.2.0/scripts/check-workflow-policy.sh +508 -0
- llmentary-0.2.0/scripts/e2e-gate.sh +80 -0
- llmentary-0.2.0/scripts/inspect-release-wheels.sh +16 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/docker-tag.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/main.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/no-comment.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/release-branch.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/short-sha.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/bad/tag.yml +7 -0
- llmentary-0.2.0/scripts/testdata/pinned-actions/good/workflow.yml +10 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/bad/job-id-token.yml +11 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/bad/list-on-pr.yml +9 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/bad/matrix-id-token.yml +13 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/bad/workflow-call-unrestricted.yml +10 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/bad/write-all.yml +9 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/good/pr-no-oidc.yml +10 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/good/release-style.yml +14 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/good/scorecard-push.yml +12 -0
- llmentary-0.2.0/scripts/testdata/pr-oidc/good/workflow-call-restricted.yml +12 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/e2e-gate-no-always/ci.yml +14 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/e2e-missing-environment/ci.yml +16 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/job-env-secret.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/missing-e2e-gate/ci.yml +8 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/openai-e2e-env-other-job.yml +9 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/openai-key-fallback-other-job.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/openai-key-other-job.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/prt-mapping.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/prt-string.yml +8 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/raw-secret-two-steps.yml +15 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-go-mod-download.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-in-run.yml +8 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-in-with.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-npm-ci.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-pip-install.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secret-uv-sync.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/secrets-inherit.yml +7 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/bad/workflow-env-secret.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/boolean-and-raw.yml +15 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/checkout-token.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/ci.yml +16 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/comment-secrets-at-job.yml +8 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/openai-presence-other-job.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/reusable-named-secret.yml +7 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/step-scoped.yml +10 -0
- llmentary-0.2.0/scripts/testdata/secret-scope/good/two-env-same-secret.yml +11 -0
- llmentary-0.2.0/scripts/testdata/workflow-policy/bad/empty-gh-repo/release-please.yml +39 -0
- llmentary-0.2.0/scripts/testdata/workflow-policy/bad/release-please.yml +38 -0
- llmentary-0.2.0/src/llmentary/__init__.py +28 -0
- llmentary-0.2.0/src/llmentary/assertions.py +407 -0
- llmentary-0.2.0/src/llmentary/binary.py +102 -0
- llmentary-0.2.0/src/llmentary/client.py +473 -0
- llmentary-0.2.0/src/llmentary/py.typed +1 -0
- llmentary-0.2.0/src/llmentary/pytest_plugin.py +125 -0
- llmentary-0.2.0/src/llmentary/types.py +885 -0
- llmentary-0.2.0/tests/conftest.py +78 -0
- llmentary-0.2.0/tests/e2e/conftest.py +9 -0
- llmentary-0.2.0/tests/e2e/e2e_helpers.py +273 -0
- llmentary-0.2.0/tests/e2e/test_chat.py +307 -0
- llmentary-0.2.0/tests/e2e/test_passthrough_and_assertions.py +81 -0
- llmentary-0.2.0/tests/e2e/test_responses.py +299 -0
- llmentary-0.2.0/tests/e2e/test_usage_isolation.py +112 -0
- llmentary-0.2.0/tests/fake_upstream.py +145 -0
- llmentary-0.2.0/tests/test_assertions.py +386 -0
- llmentary-0.2.0/tests/test_binary.py +57 -0
- llmentary-0.2.0/tests/test_build_release_wheels.py +528 -0
- llmentary-0.2.0/tests/test_go_session_schema.py +661 -0
- llmentary-0.2.0/tests/test_proxy_integration.py +107 -0
- llmentary-0.2.0/tests/test_public_api.py +117 -0
- llmentary-0.2.0/tests/test_start_command.py +111 -0
- llmentary-0.2.0/tests/test_wait_session.py +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @barzoj
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a bug in the Python client or pytest plugin
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: [bug, needs-triage]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for a report. Remove API keys, tokens, and private prompts before
|
|
10
|
+
you submit. Security issues go to
|
|
11
|
+
https://github.com/barzoj-co/llmentary-python/security/advisories/new
|
|
12
|
+
— not here. Proxy bugs go to https://github.com/barzoj-co/llmentary.
|
|
13
|
+
- type: input
|
|
14
|
+
id: package-version
|
|
15
|
+
attributes:
|
|
16
|
+
label: Package version
|
|
17
|
+
description: The installed `llmentary` version (`python -c "import llmentary; print(llmentary.__version__)"`).
|
|
18
|
+
placeholder: "0.1.0"
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: input
|
|
22
|
+
id: proxy-version
|
|
23
|
+
attributes:
|
|
24
|
+
label: Bundled proxy version
|
|
25
|
+
description: The `VERSION` file next to the wheel binary, or the `LLMENTARY_BIN` path if you did not use a bundled binary.
|
|
26
|
+
placeholder: "0.1.0 or /path/to/llmentary"
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
- type: input
|
|
30
|
+
id: python-version
|
|
31
|
+
attributes:
|
|
32
|
+
label: Python version
|
|
33
|
+
description: "`python --version`"
|
|
34
|
+
placeholder: "3.13.2"
|
|
35
|
+
validations:
|
|
36
|
+
required: true
|
|
37
|
+
- type: input
|
|
38
|
+
id: pytest-version
|
|
39
|
+
attributes:
|
|
40
|
+
label: pytest version
|
|
41
|
+
description: "`pytest --version` (leave blank if you are not using the plugin)"
|
|
42
|
+
placeholder: "8.4.2"
|
|
43
|
+
validations:
|
|
44
|
+
required: false
|
|
45
|
+
- type: input
|
|
46
|
+
id: os-arch
|
|
47
|
+
attributes:
|
|
48
|
+
label: OS and architecture
|
|
49
|
+
placeholder: "Ubuntu 24.04 x86_64"
|
|
50
|
+
validations:
|
|
51
|
+
required: true
|
|
52
|
+
- type: dropdown
|
|
53
|
+
id: install-method
|
|
54
|
+
attributes:
|
|
55
|
+
label: Install method
|
|
56
|
+
options:
|
|
57
|
+
- Platform wheel
|
|
58
|
+
- sdist
|
|
59
|
+
- Editable (`pip install -e`)
|
|
60
|
+
- Other
|
|
61
|
+
validations:
|
|
62
|
+
required: true
|
|
63
|
+
- type: input
|
|
64
|
+
id: provider
|
|
65
|
+
attributes:
|
|
66
|
+
label: Provider
|
|
67
|
+
description: Upstream LLM provider the proxy talked to.
|
|
68
|
+
placeholder: OpenAI
|
|
69
|
+
validations:
|
|
70
|
+
required: true
|
|
71
|
+
- type: dropdown
|
|
72
|
+
id: api
|
|
73
|
+
attributes:
|
|
74
|
+
label: API
|
|
75
|
+
options:
|
|
76
|
+
- Chat Completions
|
|
77
|
+
- Responses
|
|
78
|
+
- Both
|
|
79
|
+
- Neither / not applicable
|
|
80
|
+
validations:
|
|
81
|
+
required: true
|
|
82
|
+
- type: dropdown
|
|
83
|
+
id: streaming
|
|
84
|
+
attributes:
|
|
85
|
+
label: Streaming
|
|
86
|
+
options:
|
|
87
|
+
- "Yes"
|
|
88
|
+
- "No"
|
|
89
|
+
- Both
|
|
90
|
+
- Not applicable
|
|
91
|
+
validations:
|
|
92
|
+
required: true
|
|
93
|
+
- type: textarea
|
|
94
|
+
id: repro
|
|
95
|
+
attributes:
|
|
96
|
+
label: Minimal reproduction
|
|
97
|
+
description: Smallest snippet or test that shows the bug. Strip keys and private prompts.
|
|
98
|
+
placeholder: |
|
|
99
|
+
def test_example(llmentary):
|
|
100
|
+
...
|
|
101
|
+
validations:
|
|
102
|
+
required: true
|
|
103
|
+
- type: textarea
|
|
104
|
+
id: expected
|
|
105
|
+
attributes:
|
|
106
|
+
label: Expected
|
|
107
|
+
validations:
|
|
108
|
+
required: true
|
|
109
|
+
- type: textarea
|
|
110
|
+
id: actual
|
|
111
|
+
attributes:
|
|
112
|
+
label: Actual
|
|
113
|
+
validations:
|
|
114
|
+
required: true
|
|
115
|
+
- type: checkboxes
|
|
116
|
+
id: no-secrets
|
|
117
|
+
attributes:
|
|
118
|
+
label: Secrets
|
|
119
|
+
options:
|
|
120
|
+
- label: I removed keys and private prompts
|
|
121
|
+
required: true
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Report a security vulnerability
|
|
4
|
+
url: https://github.com/barzoj-co/llmentary-python/security/advisories/new
|
|
5
|
+
about: Never file a public issue for a security report. Use GitHub private reporting.
|
|
6
|
+
- name: Proxy bugs
|
|
7
|
+
url: https://github.com/barzoj-co/llmentary/issues
|
|
8
|
+
about: Bugs in the recording proxy binary belong in barzoj-co/llmentary.
|
|
9
|
+
- name: Questions and ideas
|
|
10
|
+
url: https://github.com/barzoj-co/llmentary/discussions
|
|
11
|
+
about: Ask questions and discuss ideas with the llmentary community.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a change to the Python client or pytest plugin
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: [enhancement, needs-triage]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Describe the problem and the change you want. Proxy-side features belong
|
|
10
|
+
in https://github.com/barzoj-co/llmentary.
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: problem
|
|
13
|
+
attributes:
|
|
14
|
+
label: Problem
|
|
15
|
+
description: What is hard or impossible today?
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: proposal
|
|
20
|
+
attributes:
|
|
21
|
+
label: Proposal
|
|
22
|
+
description: What should the client or plugin do?
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: alternatives
|
|
27
|
+
attributes:
|
|
28
|
+
label: Alternatives
|
|
29
|
+
description: Other approaches you considered.
|
|
30
|
+
validations:
|
|
31
|
+
required: false
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this change, and why? -->
|
|
4
|
+
|
|
5
|
+
## Linked issue
|
|
6
|
+
|
|
7
|
+
<!-- Fixes #nnn or N/A -->
|
|
8
|
+
|
|
9
|
+
## Conventional type
|
|
10
|
+
|
|
11
|
+
<!-- feat | fix | docs | ci | chore | refactor | test | perf | revert -->
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
- [ ] Tests cover the change (`pytest -m "not e2e"`; live e2e only when relevant)
|
|
16
|
+
- [ ] `ruff check .` and `mypy` pass
|
|
17
|
+
- [ ] Docs describe only implemented behavior
|
|
18
|
+
- [ ] No secrets, API keys, or private prompts in the diff or logs
|
|
19
|
+
- [ ] Breaking change is called out above (or this is not breaking)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
- name: bug
|
|
2
|
+
color: "d73a4a"
|
|
3
|
+
description: Something is broken
|
|
4
|
+
- name: enhancement
|
|
5
|
+
color: "a2eeef"
|
|
6
|
+
description: New feature or request
|
|
7
|
+
- name: documentation
|
|
8
|
+
color: "0075ca"
|
|
9
|
+
description: Documentation only
|
|
10
|
+
- name: question
|
|
11
|
+
color: "d876e3"
|
|
12
|
+
description: Further information is requested
|
|
13
|
+
- name: needs-triage
|
|
14
|
+
color: "e4e669"
|
|
15
|
+
description: Not yet reviewed
|
|
16
|
+
- name: good first issue
|
|
17
|
+
color: "7057ff"
|
|
18
|
+
description: Good for newcomers
|
|
19
|
+
- name: help wanted
|
|
20
|
+
color: "008672"
|
|
21
|
+
description: Extra attention is needed
|
|
22
|
+
- name: breaking-change
|
|
23
|
+
color: "b60205"
|
|
24
|
+
description: Introduces a breaking change
|
|
25
|
+
- name: security
|
|
26
|
+
color: "ee0701"
|
|
27
|
+
description: Security-related
|
|
28
|
+
- name: dependencies
|
|
29
|
+
color: "0366d6"
|
|
30
|
+
description: Dependency updates
|
|
31
|
+
- name: ci
|
|
32
|
+
color: "000000"
|
|
33
|
+
description: Continuous integration
|
|
34
|
+
- name: "area: pytest-plugin"
|
|
35
|
+
color: "c5def5"
|
|
36
|
+
description: Pytest plugin
|
|
37
|
+
- name: "area: assertions"
|
|
38
|
+
color: "c5def5"
|
|
39
|
+
description: Assertion helpers
|
|
40
|
+
- name: "area: packaging"
|
|
41
|
+
color: "c5def5"
|
|
42
|
+
description: Packaging and wheels
|
|
43
|
+
- name: "autorelease: pending"
|
|
44
|
+
color: "ededed"
|
|
45
|
+
description: release-please release PR
|
|
46
|
+
- name: "autorelease: tagged"
|
|
47
|
+
color: "0e8a16"
|
|
48
|
+
description: release-please has tagged a release
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
14
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
name: Python ${{ matrix.python-version }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 15
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
strategy:
|
|
24
|
+
fail-fast: false
|
|
25
|
+
matrix:
|
|
26
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
27
|
+
env:
|
|
28
|
+
LLMENTARY_BIN: /tmp/llmentary
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout Python client
|
|
31
|
+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
32
|
+
with:
|
|
33
|
+
persist-credentials: false
|
|
34
|
+
|
|
35
|
+
- name: Fail clearly if llmentary repo token is missing
|
|
36
|
+
env:
|
|
37
|
+
HAS_REPO_TOKEN: ${{ secrets.LLMTESTLAB_REPO_TOKEN != '' }}
|
|
38
|
+
run: |
|
|
39
|
+
if [ "$HAS_REPO_TOKEN" != "true" ]; then
|
|
40
|
+
echo "::error title=Missing secret::Add secrets.LLMTESTLAB_REPO_TOKEN with read access to barzoj-co/llmentary."
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
- name: Checkout llmentary proxy
|
|
45
|
+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
46
|
+
with:
|
|
47
|
+
repository: barzoj-co/llmentary
|
|
48
|
+
token: ${{ secrets.LLMTESTLAB_REPO_TOKEN }}
|
|
49
|
+
path: llmentary-proxy
|
|
50
|
+
persist-credentials: false
|
|
51
|
+
|
|
52
|
+
- name: Set up Go
|
|
53
|
+
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
|
54
|
+
with:
|
|
55
|
+
go-version: "1.26"
|
|
56
|
+
cache-dependency-path: llmentary-proxy/go.sum
|
|
57
|
+
|
|
58
|
+
- name: Build llmentary proxy
|
|
59
|
+
working-directory: llmentary-proxy
|
|
60
|
+
run: go build -o "$LLMENTARY_BIN" ./cmd/llmentary
|
|
61
|
+
|
|
62
|
+
- name: Set up Python
|
|
63
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
64
|
+
with:
|
|
65
|
+
python-version: ${{ matrix.python-version }}
|
|
66
|
+
cache: pip
|
|
67
|
+
|
|
68
|
+
- name: Install package and dev tools
|
|
69
|
+
run: python -m pip install -e ".[dev]"
|
|
70
|
+
|
|
71
|
+
- name: Ruff
|
|
72
|
+
run: ruff check .
|
|
73
|
+
|
|
74
|
+
- name: Mypy
|
|
75
|
+
run: mypy
|
|
76
|
+
|
|
77
|
+
- name: Unit and fake-upstream integration tests
|
|
78
|
+
if: matrix.python-version != '3.13'
|
|
79
|
+
run: pytest -m "not e2e"
|
|
80
|
+
|
|
81
|
+
- name: Unit and fake-upstream integration tests
|
|
82
|
+
if: matrix.python-version == '3.13'
|
|
83
|
+
run: pytest -m "not e2e" --cov --cov-report=xml:coverage.xml
|
|
84
|
+
|
|
85
|
+
- name: Upload coverage artifact
|
|
86
|
+
if: matrix.python-version == '3.13'
|
|
87
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
88
|
+
with:
|
|
89
|
+
name: coverage-xml
|
|
90
|
+
path: coverage.xml
|
|
91
|
+
if-no-files-found: error
|
|
92
|
+
|
|
93
|
+
coverage:
|
|
94
|
+
name: coverage
|
|
95
|
+
needs: test
|
|
96
|
+
if: ${{ !cancelled() }}
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
timeout-minutes: 10
|
|
99
|
+
permissions:
|
|
100
|
+
contents: read
|
|
101
|
+
steps:
|
|
102
|
+
- name: Checkout
|
|
103
|
+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
104
|
+
with:
|
|
105
|
+
persist-credentials: false
|
|
106
|
+
|
|
107
|
+
- name: Download coverage artifact
|
|
108
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
109
|
+
with:
|
|
110
|
+
name: coverage-xml
|
|
111
|
+
|
|
112
|
+
- name: Upload coverage
|
|
113
|
+
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5
|
|
114
|
+
with:
|
|
115
|
+
use_oidc: false
|
|
116
|
+
disable_search: true
|
|
117
|
+
files: ./coverage.xml
|
|
118
|
+
flags: unit
|
|
119
|
+
fail_ci_if_error: ${{ vars.CODECOV_REQUIRED == 'true' }}
|
|
120
|
+
|
|
121
|
+
openai-e2e:
|
|
122
|
+
name: OpenAI E2E
|
|
123
|
+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
|
|
124
|
+
# Required reviewers on this environment gate OPENAI_API_KEY. Unit and
|
|
125
|
+
# fake-upstream jobs do not use it and run without approval.
|
|
126
|
+
environment: openai-e2e
|
|
127
|
+
runs-on: ubuntu-latest
|
|
128
|
+
timeout-minutes: 20
|
|
129
|
+
env:
|
|
130
|
+
LLMENTARY_BIN: /tmp/llmentary
|
|
131
|
+
LLMENTARY_E2E: "1"
|
|
132
|
+
LLMENTARY_UPSTREAM_BASE_URL: https://api.openai.com/v1
|
|
133
|
+
LLMENTARY_WAIT_TIMEOUT: "30"
|
|
134
|
+
steps:
|
|
135
|
+
- name: Checkout Python client
|
|
136
|
+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
137
|
+
with:
|
|
138
|
+
persist-credentials: false
|
|
139
|
+
|
|
140
|
+
- name: Fail clearly if required secrets are missing
|
|
141
|
+
env:
|
|
142
|
+
HAS_REPO_TOKEN: ${{ secrets.LLMTESTLAB_REPO_TOKEN != '' }}
|
|
143
|
+
HAS_OPENAI_KEY: ${{ secrets.OPENAI_API_KEY != '' }}
|
|
144
|
+
run: |
|
|
145
|
+
if [ "$HAS_REPO_TOKEN" != "true" ]; then
|
|
146
|
+
echo "::error title=Missing secret::Add secrets.LLMTESTLAB_REPO_TOKEN with read access to barzoj-co/llmentary."
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
if [ "$HAS_OPENAI_KEY" != "true" ]; then
|
|
150
|
+
echo "::error title=Missing secret::Add secrets.OPENAI_API_KEY for real OpenAI E2E tests."
|
|
151
|
+
exit 1
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
- name: Checkout llmentary proxy
|
|
155
|
+
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
156
|
+
with:
|
|
157
|
+
repository: barzoj-co/llmentary
|
|
158
|
+
token: ${{ secrets.LLMTESTLAB_REPO_TOKEN }}
|
|
159
|
+
path: llmentary-proxy
|
|
160
|
+
persist-credentials: false
|
|
161
|
+
|
|
162
|
+
- name: Set up Go
|
|
163
|
+
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
|
164
|
+
with:
|
|
165
|
+
go-version: "1.26"
|
|
166
|
+
cache-dependency-path: llmentary-proxy/go.sum
|
|
167
|
+
|
|
168
|
+
- name: Build llmentary proxy
|
|
169
|
+
working-directory: llmentary-proxy
|
|
170
|
+
run: go build -o "$LLMENTARY_BIN" ./cmd/llmentary
|
|
171
|
+
|
|
172
|
+
- name: Set up Python
|
|
173
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
174
|
+
with:
|
|
175
|
+
python-version: "3.13"
|
|
176
|
+
cache: pip
|
|
177
|
+
|
|
178
|
+
- name: Install package and dev tools
|
|
179
|
+
run: python -m pip install -e ".[dev,openai]"
|
|
180
|
+
|
|
181
|
+
- name: Real OpenAI E2E tests
|
|
182
|
+
env:
|
|
183
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
184
|
+
LLMENTARY_UPSTREAM_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
185
|
+
run: pytest -m e2e -vv --tb=short --durations=0
|
|
186
|
+
|
|
187
|
+
e2e-gate:
|
|
188
|
+
name: e2e-gate
|
|
189
|
+
if: ${{ always() }}
|
|
190
|
+
needs: [openai-e2e]
|
|
191
|
+
runs-on: ubuntu-latest
|
|
192
|
+
timeout-minutes: 5
|
|
193
|
+
permissions:
|
|
194
|
+
contents: read
|
|
195
|
+
steps:
|
|
196
|
+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
|
197
|
+
with:
|
|
198
|
+
persist-credentials: false
|
|
199
|
+
- name: Require live e2e success
|
|
200
|
+
env:
|
|
201
|
+
E2E_RESULT: ${{ needs.openai-e2e.result }}
|
|
202
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
203
|
+
IS_FORK: ${{ github.event.pull_request.head.repo.fork == true }}
|
|
204
|
+
run: bash scripts/e2e-gate.sh
|