Skip to content

Commit 6960630

Browse files
authored
chore!: stackit - drop Python 3.9 and use X|Y typing (#2730)
1 parent 60bbfff commit 6960630

4 files changed

Lines changed: 20 additions & 26 deletions

File tree

integrations/stackit/pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ name = "stackit-haystack"
77
dynamic = ["version"]
88
description = 'An integration of STACKIT as a StackitChatGenerator'
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
license = "Apache-2.0"
1212
keywords = []
1313
authors = [{ name = "deepset GmbH", email = "info@deepset.ai" }]
1414
classifiers = [
1515
"License :: OSI Approved :: Apache Software License",
1616
"Development Status :: 4 - Beta",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
2322
"Programming Language :: Python :: Implementation :: CPython",
2423
"Programming Language :: Python :: Implementation :: PyPy",
2524
]
26-
dependencies = ["haystack-ai>=2.19.0"]
25+
dependencies = ["haystack-ai>=2.22.0"]
2726

2827
[project.urls]
2928
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/stackit#readme"
@@ -75,7 +74,6 @@ check_untyped_defs = true
7574
disallow_incomplete_defs = true
7675

7776
[tool.ruff]
78-
target-version = "py39"
7977
line-length = 120
8078

8179
[tool.ruff.lint]
@@ -122,10 +120,6 @@ ignore = [
122120
"B008",
123121
"S101",
124122
]
125-
unfixable = [
126-
# Don't touch unused imports
127-
"F401",
128-
]
129123

130124
[tool.ruff.lint.isort]
131125
known-first-party = ["haystack_integrations"]

integrations/stackit/src/haystack_integrations/components/embedders/stackit/document_embedder.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
22
#
33
# SPDX-License-Identifier: Apache-2.0
4-
from typing import Any, Optional
4+
from typing import Any
55

66
from haystack import component, default_to_dict
77
from haystack.components.embedders import OpenAIDocumentEmbedder
@@ -34,17 +34,17 @@ def __init__(
3434
self,
3535
model: str,
3636
api_key: Secret = Secret.from_env_var("STACKIT_API_KEY"),
37-
api_base_url: Optional[str] = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
37+
api_base_url: str | None = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
3838
prefix: str = "",
3939
suffix: str = "",
4040
batch_size: int = 32,
4141
progress_bar: bool = True,
42-
meta_fields_to_embed: Optional[list[str]] = None,
42+
meta_fields_to_embed: list[str] | None = None,
4343
embedding_separator: str = "\n",
4444
*,
45-
timeout: Optional[float] = None,
46-
max_retries: Optional[int] = None,
47-
http_client_kwargs: Optional[dict[str, Any]] = None,
45+
timeout: float | None = None,
46+
max_retries: int | None = None,
47+
http_client_kwargs: dict[str, Any] | None = None,
4848
):
4949
"""
5050
Creates a STACKITDocumentEmbedder component.

integrations/stackit/src/haystack_integrations/components/embedders/stackit/text_embedder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2023-present deepset GmbH <info@deepset.ai>
22
#
33
# SPDX-License-Identifier: Apache-2.0
4-
from typing import Any, Optional
4+
from typing import Any
55

66
from haystack import component, default_to_dict
77
from haystack.components.embedders import OpenAITextEmbedder
@@ -27,13 +27,13 @@ def __init__(
2727
self,
2828
model: str,
2929
api_key: Secret = Secret.from_env_var("STACKIT_API_KEY"),
30-
api_base_url: Optional[str] = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
30+
api_base_url: str | None = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
3131
prefix: str = "",
3232
suffix: str = "",
3333
*,
34-
timeout: Optional[float] = None,
35-
max_retries: Optional[int] = None,
36-
http_client_kwargs: Optional[dict[str, Any]] = None,
34+
timeout: float | None = None,
35+
max_retries: int | None = None,
36+
http_client_kwargs: dict[str, Any] | None = None,
3737
):
3838
"""
3939
Creates a STACKITTextEmbedder component.

integrations/stackit/src/haystack_integrations/components/generators/stackit/chat/chat_generator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: 2025-present deepset GmbH <info@deepset.ai>
22
#
33
# SPDX-License-Identifier: Apache-2.0
4-
from typing import Any, Optional
4+
from typing import Any
55

66
from haystack import component, default_to_dict
77
from haystack.components.generators.chat import OpenAIChatGenerator
@@ -42,13 +42,13 @@ def __init__(
4242
self,
4343
model: str,
4444
api_key: Secret = Secret.from_env_var("STACKIT_API_KEY"),
45-
streaming_callback: Optional[StreamingCallbackT] = None,
46-
api_base_url: Optional[str] = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
47-
generation_kwargs: Optional[dict[str, Any]] = None,
45+
streaming_callback: StreamingCallbackT | None = None,
46+
api_base_url: str | None = "https://api.openai-compat.model-serving.eu01.onstackit.cloud/v1",
47+
generation_kwargs: dict[str, Any] | None = None,
4848
*,
49-
timeout: Optional[float] = None,
50-
max_retries: Optional[int] = None,
51-
http_client_kwargs: Optional[dict[str, Any]] = None,
49+
timeout: float | None = None,
50+
max_retries: int | None = None,
51+
http_client_kwargs: dict[str, Any] | None = None,
5252
):
5353
"""
5454
Creates an instance of STACKITChatGenerator class.

0 commit comments

Comments
 (0)