Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"] # todo, "3.12"
python-version: ["3.10", "3.11"] # todo, "3.12"
include:
- { os: "macos-latest", python-version: "3.12" }
- { os: "windows-latest", python-version: "3.11" }
- { os: "ubuntu-22.04", python-version: "3.9", requires: "oldest" }
- { os: "ubuntu-22.04", python-version: "3.10", requires: "oldest" }

timeout-minutes: 35
env:
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = {text = "Apache-2.0"}
authors = [
{name = "Lightning-AI et al.", email = "community@lightning.ai"}
]
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["deep learning", "pytorch", "AI"]
classifiers = [
"Environment :: Console",
Expand All @@ -23,8 +23,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -110,7 +108,7 @@ blank = true

[tool.ruff]
line-length = 120
target-version = "py39"
target-version = "py310"
# Enable Pyflakes `E` and `F` codes by default.
lint.select = [
"E", "W", # see: https://pypi.org/project/pycodestyle
Expand All @@ -129,6 +127,8 @@ lint.extend-select = [
]
lint.ignore = [
"E731", # Do not assign a lambda expression, use a def
"UP045", # TODO: non-pep604-annotation-optional
"UP007", # TODO: non-pep604-annotation-union
]
# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down
4 changes: 2 additions & 2 deletions src/litserve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import json
import warnings
from abc import ABC
from collections.abc import Awaitable
from collections.abc import Awaitable, Callable
from queue import Queue
from typing import TYPE_CHECKING, Callable, Optional, Union
from typing import TYPE_CHECKING, Optional, Union

from pydantic import BaseModel

Expand Down
4 changes: 2 additions & 2 deletions src/litserve/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import warnings
from abc import ABC, abstractmethod
from collections import deque
from collections.abc import Iterable, Sequence
from collections.abc import Callable, Iterable, Sequence
from contextlib import asynccontextmanager
from queue import Queue
from typing import TYPE_CHECKING, Callable, Literal, Optional, Union
from typing import TYPE_CHECKING, Literal, Optional, Union

import uvicorn
import uvicorn.server
Expand Down
4 changes: 2 additions & 2 deletions src/litserve/specs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from abc import abstractmethod
from collections.abc import AsyncGenerator, Generator
from typing import TYPE_CHECKING, Callable, Optional, Union
from collections.abc import AsyncGenerator, Callable, Generator
from typing import TYPE_CHECKING, Optional, Union

if TYPE_CHECKING:
from litserve import LitAPI, LitServer
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test_ensure_lightning_installed(mock_check_call, mock_is_package_installed):
mock_check_call.assert_called_once_with([sys.executable, "-m", "pip", "install", "-U", "lightning-sdk"])


# TODO: Remove this once we have a fix for Python 3.9 and 3.10
@pytest.mark.skipif(sys.version_info[:2] in [(3, 9), (3, 10)], reason="Test fails on Python 3.9 and 3.10")
# TODO: Remove this once we have a fix for Python 3.10
@pytest.mark.skipif(sys.version_info[:2] in [(3, 10)], reason="Test fails on Python 3.10")
@patch("litserve.cli.is_package_installed")
@patch("subprocess.check_call")
@patch("builtins.__import__")
Expand All @@ -69,7 +69,7 @@ def side_effect(name, *args, **kwargs):
mock_check_call.assert_called_once_with([sys.executable, "-m", "pip", "install", "-U", "lightning-sdk"])


@pytest.mark.skipif(sys.version_info[:2] in [(3, 9), (3, 10)], reason="Test fails on Python 3.9 and 3.10")
@pytest.mark.skipif(sys.version_info[:2] in [(3, 10)], reason="Test fails on Python 3.10")
@patch("importlib.util.find_spec")
@patch("builtins.__import__")
def test_cli_main_import_error(mock_import, mock_find_spec, capsys):
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/test_mcp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import inspect
import sys
from typing import Optional
from unittest.mock import patch

Expand All @@ -8,9 +7,6 @@
from pydantic import BaseModel, Field
from starlette.applications import Starlette

if sys.version_info < (3, 10):
pytest.skip("Skipping test_mcp.py on Python < 3.10", allow_module_level=True)

import litserve as ls
from litserve.mcp import (
MCP,
Expand Down
Loading