Skip to content

[NA] [SDK] fix: entry point resolves to module so pip-install works (0.1.1) + pip E2E coverage #56

[NA] [SDK] fix: entry point resolves to module so pip-install works (0.1.1) + pip E2E coverage

[NA] [SDK] fix: entry point resolves to module so pip-install works (0.1.1) + pip E2E coverage #56

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
name: test (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package + dev deps
run: pip install -e ".[dev]"
- name: Run tests
run: python -m pytest tests/ -v
lint:
name: lint (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ruff
run: pip install ruff==0.15.5
- name: Lint
run: ruff check observability tests
- name: Format check
run: ruff format --check observability tests
build:
name: build (package + entry point)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist + wheel
run: |
pip install build
python -m build
- name: Verify the wheel exposes the plugin entry point
run: |
python - <<'PY'
import glob, zipfile, configparser
wheel = glob.glob("dist/*.whl")[0]
names = zipfile.ZipFile(wheel).namelist()
assert "opik_hermes/__init__.py" in names, "plugin module missing from wheel"
ep = next(n for n in names if n.endswith("entry_points.txt"))
body = zipfile.ZipFile(wheel).read(ep).decode()
cp = configparser.ConfigParser()
cp.read_string(body)
# Must resolve to the MODULE (opik = opik_hermes), not opik_hermes:register.
# Hermes does ep.load() then getattr(mod, "register"); a ":register"
# suffix loads the function instead and breaks plugin loading.
val = cp["hermes_agent.plugins"]["opik"].strip()
assert val == "opik_hermes", (
f"opik entry point must be 'opik_hermes' (module), got {val!r}"
)
print("OK:", wheel, "entry point opik ->", val)
PY