[Infra] Packaging: Relax Core Runtime Pins To Ranges #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check dependency floors | |
| on: | |
| pull_request: | |
| paths: | |
| - 'pyproject.toml' | |
| - '.github/workflows/check-dependency-floors.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| resolve-and-import: | |
| name: Install at lowest-direct + smoke-import litellm | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 | |
| with: | |
| version: "0.10.9" | |
| enable-cache: false | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Resolve litellm core deps at floor versions | |
| run: | | |
| uv venv --python ${{ matrix.python-version }} /tmp/floor-venv | |
| uv pip install --python /tmp/floor-venv/bin/python --resolution=lowest-direct . | |
| - name: Smoke-import litellm at floor versions | |
| run: | | |
| /tmp/floor-venv/bin/python <<'PY' | |
| import importlib | |
| # Import the SDK itself. | |
| import litellm # noqa: F401 | |
| # Import every openai-namespace symbol the codebase actually uses | |
| # at runtime. If a floor is set lower than the version that | |
| # introduced any of these, the install will silently succeed and | |
| # then fail at runtime in customer code. This list mirrors the | |
| # openai imports under litellm/ — keep it in sync. | |
| import openai # noqa: F401 | |
| from openai import ( # noqa: F401 | |
| AsyncAzureOpenAI, | |
| AsyncOpenAI, | |
| AzureOpenAI, | |
| OpenAI, | |
| APIError, | |
| APITimeoutError, | |
| Omit, | |
| ) | |
| from openai.types.responses import ( # noqa: F401 | |
| ResponseFunctionToolCall, | |
| ResponseInputImageParam, | |
| ResponseOutputMessage, | |
| ResponseReasoningItem, | |
| ) | |
| from openai.types.responses.response import ( # noqa: F401 | |
| IncompleteDetails, | |
| Response, | |
| ResponseOutputItem, | |
| Tool, | |
| ToolChoice, | |
| ) | |
| from openai.types.responses.response_output_item import ( # noqa: F401 | |
| ResponseApplyPatchToolCall, | |
| ) | |
| from openai.types.responses.response_text_config_param import ( # noqa: F401 | |
| ResponseTextConfigParam, | |
| ) | |
| from openai.types.responses.tool_param import ( # noqa: F401 | |
| FunctionToolParam, | |
| ) | |
| # Sanity-check the other direct deps load. | |
| for mod in ( | |
| "pydantic", | |
| "httpx", | |
| "aiohttp", | |
| "tokenizers", | |
| "tiktoken", | |
| "click", | |
| "jinja2", | |
| "jsonschema", | |
| "importlib_metadata", | |
| "fastuuid", | |
| "dotenv", | |
| ): | |
| importlib.import_module(mod) | |
| print("All floor-version imports OK") | |
| PY | |
| - name: Report resolved versions | |
| if: always() | |
| run: | | |
| /tmp/floor-venv/bin/python -c " | |
| from importlib.metadata import version | |
| for pkg in ['litellm', 'openai', 'pydantic', 'httpx', 'aiohttp', 'tokenizers', 'tiktoken', 'click', 'jinja2', 'jsonschema', 'importlib-metadata', 'fastuuid', 'python-dotenv']: | |
| try: | |
| print(f'{pkg}: {version(pkg)}') | |
| except Exception as e: | |
| print(f'{pkg}: <not installed> ({e})') | |
| " |