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
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
test:
runs-on: ubuntu-latest
env:
py38: 3.8
py39: 3.9
py38: "3.8"
py39: "3.9"
py310: "3.10"
py311: "3.11"
py312: "3.12"
Expand All @@ -55,7 +55,11 @@ jobs:
with:
python-version: ${{ env[matrix.python-version] }}
architecture: "x64"
- run: pip install -r dev-requirements.txt
- if: ${{ env[matrix.python-version] == '3.8' || env[matrix.python-version] == '3.9' }}
run: pip install -r dev-requirements-3.9.txt
working-directory: ${{ matrix.working-dir }}
- if: ${{ env[matrix.python-version] != '3.8' && env[matrix.python-version] != '3.9' }}
run: pip install -r dev-requirements.txt
working-directory: ${{ matrix.working-dir }}
- run: pytest
working-directory: ${{ matrix.working-dir }}
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ However, unit test recordings should use the authoritative OpenAI platform unles
about a specific portability corner case.

To refresh a test, delete its cassette file in tests/cassettes and make sure you have the
following environment variables set:
following environment variables set for OpenAI recordings:

* `OPENAI_API_KEY` - from https://platform.openai.com/settings/profile?tab=api-keys
* It should look like `sk-...`
* `OPENAI_ORG_ID` - from https://platform.openai.com/settings/organization/general
* It should look like `org-...`
* `OPENAI_PROJECT_ID` - from https://platform.openai.com/settings/profile (click Project)
* It should look like `proj_...`

and the following for Azure recordings, deployment url and api key are available for each deployment
in https://oai.azure.com/resource/deployments:

* `AZURE_CHAT_COMPLETIONS_DEPLOYMENT_URL`
* `AZURE_CHAT_COMPLETIONS_API_KEY`
* `AZURE_EMBEDDINGS_DEPLOYMENT_URL`
* `AZURE_EMBEDDINGS_API_KEY`

If writing a new test, start with the test logic with no assertions. If extending an existing unit test
rather than writing a new one, remove the corresponding recorded response from [cassettes](./tests/cassettes/)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --extra=dev --output-file=dev-requirements-3.9.txt --strip-extras pyproject.toml
#
annotated-types==0.7.0
# via pydantic
anyio==4.5.2
# via
# httpx
# openai
asgiref==3.8.1
# via opentelemetry-test-utils
build==1.2.2.post1
# via pip-tools
certifi==2024.8.30
# via
# httpcore
# httpx
click==8.1.7
# via pip-tools
deprecated==1.2.14
# via
# opentelemetry-api
# opentelemetry-semantic-conventions
distro==1.9.0
# via openai
exceptiongroup==1.2.2
# via
# anyio
# pytest
h11==0.14.0
# via httpcore
httpcore==1.0.6
# via httpx
httpx==0.27.2
# via openai
idna==3.10
# via
# anyio
# httpx
# yarl
importlib-metadata==8.5.0
# via
# build
# opentelemetry-api
iniconfig==2.0.0
# via pytest
jiter==0.7.1
# via openai
multidict==6.1.0
# via yarl
numpy==1.24.4
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
openai==1.54.4
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
opentelemetry-api==1.28.1
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# opentelemetry-instrumentation
# opentelemetry-sdk
# opentelemetry-semantic-conventions
# opentelemetry-test-utils
opentelemetry-instrumentation==0.49b1
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
opentelemetry-sdk==1.28.1
# via opentelemetry-test-utils
opentelemetry-semantic-conventions==0.49b1
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# opentelemetry-instrumentation
# opentelemetry-sdk
opentelemetry-test-utils==0.49b1
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
packaging==24.2
# via
# build
# opentelemetry-instrumentation
# pytest
pip-tools==7.4.1
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
pluggy==1.5.0
# via pytest
propcache==0.2.0
# via yarl
pydantic==2.9.2
# via openai
pydantic-core==2.23.4
# via pydantic
pyproject-hooks==1.2.0
# via
# build
# pip-tools
pytest==8.3.3
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# pytest-asyncio
# pytest-vcr
pytest-asyncio==0.24.0
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
pytest-vcr==1.0.2
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
pyyaml==6.0.2
# via vcrpy
sniffio==1.3.1
# via
# anyio
# httpx
# openai
tomli==2.1.0
# via
# build
# pip-tools
# pytest
tqdm==4.67.0
# via openai
typing-extensions==4.12.2
# via
# annotated-types
# anyio
# asgiref
# multidict
# openai
# opentelemetry-sdk
# pydantic
# pydantic-core
urllib3==1.26.20
# via vcrpy
vcrpy==6.0.2
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# pytest-vcr
wheel==0.45.0
# via pip-tools
wrapt==1.16.0
# via
# deprecated
# opentelemetry-instrumentation
# vcrpy
yarl==1.15.2
# via vcrpy
zipp==3.20.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jiter==0.5.0
# via openai
multidict==6.1.0
# via yarl
numpy==2.1.3
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
openai==1.50.2
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
opentelemetry-api==1.27.0
Expand Down Expand Up @@ -85,6 +87,13 @@ pyproject-hooks==1.1.0
# build
# pip-tools
pytest==8.3.3
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# pytest-asyncio
# pytest-vcr
pytest-asyncio==0.24.0
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
pytest-vcr==1.0.2
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
pyyaml==6.0.2
# via vcrpy
Expand All @@ -110,7 +119,9 @@ typing-extensions==4.12.2
# pydantic
# pydantic-core
vcrpy==6.0.1
# via elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# via
# elastic-opentelemetry-instrumentation-openai (pyproject.toml)
# pytest-vcr
wheel==0.44.0
# via pip-tools
wrapt==1.16.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Homepage = "https://github.com/elastic/elastic-otel-python-instrumentations"
"Bug Tracker" = "https://github.com/elastic/elastic-otel-python-instrumentations/issues"

[project.optional-dependencies]
dev = ["pytest", "pip-tools", "openai", "opentelemetry-test-utils", "vcrpy"]
dev = ["pytest", "pip-tools", "openai", "numpy", "opentelemetry-test-utils", "vcrpy", "pytest-asyncio", "pytest-vcr"]
instruments = [
"openai >= 1.0.0",
]
Expand Down
Loading