Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pinned versions for dev dependencies. #612

Merged
merged 3 commits into from
Jan 22, 2025
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
13 changes: 6 additions & 7 deletions autogen/coding/func_with_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# Portions derived from https://github.com/microsoft/autogen are under the MIT License.
# SPDX-License-Identifier: MIT
from __future__ import annotations

import functools
import importlib
Expand All @@ -20,7 +19,7 @@
P = ParamSpec("P")


def _to_code(func: FunctionWithRequirements[T, P] | Callable[P, T] | FunctionWithRequirementsStr) -> str:
def _to_code(func: Union["FunctionWithRequirements[T, P]", Callable[P, T], "FunctionWithRequirementsStr"]) -> str:
if isinstance(func, FunctionWithRequirementsStr):
return func.func

Expand All @@ -40,7 +39,7 @@ class Alias:
@dataclass
class ImportFromModule:
module: str
imports: list[str | Alias]
imports: list[Union[str, Alias]]


Import = Union[str, ImportFromModule, Alias]
Expand All @@ -53,7 +52,7 @@ def _import_to_str(im: Import) -> str:
return f"import {im.name} as {im.alias}"
else:

def to_str(i: str | Alias) -> str:
def to_str(i: Union[str, Alias]) -> str:
if isinstance(i, str):
return i
else:
Expand Down Expand Up @@ -123,7 +122,7 @@ class FunctionWithRequirements(Generic[T, P]):
@classmethod
def from_callable(
cls, func: Callable[P, T], python_packages: list[str] = [], global_imports: list[Import] = []
) -> FunctionWithRequirements[T, P]:
) -> "FunctionWithRequirements[T, P]":
return cls(python_packages=python_packages, global_imports=global_imports, func=func)

@staticmethod
Expand Down Expand Up @@ -162,7 +161,7 @@ def wrapper(func: Callable[P, T]) -> FunctionWithRequirements[T, P]:


def _build_python_functions_file(
funcs: list[FunctionWithRequirements[Any, P] | Callable[..., Any] | FunctionWithRequirementsStr],
funcs: list[Union[FunctionWithRequirements[Any, P], Callable[..., Any], FunctionWithRequirementsStr]],
) -> str:
# First collect all global imports
global_imports: set[str] = set()
Expand All @@ -178,7 +177,7 @@ def _build_python_functions_file(
return content


def to_stub(func: Callable[..., Any] | FunctionWithRequirementsStr) -> str:
def to_stub(func: Union[Callable[..., Any], FunctionWithRequirementsStr]) -> str:
"""Generate a stub for a function as a string

Args:
Expand Down
25 changes: 12 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,21 @@ bedrock = ["boto3>=1.34.149"]

# test dependencies
test = [
"ipykernel",
"nbconvert",
"nbformat",
"pre-commit",
"pytest-cov>=5",
"pytest-asyncio",
"pytest>=8,<9",
"pandas",
"fastapi>=0.115.0,<1",
"ipykernel==6.29.5",
"nbconvert==7.16.5",
"nbformat==5.10.4",
"pytest-cov==6.0.0",
"pytest-asyncio==0.25.2",
"pytest==8.3.4",
"pandas==2.2.3",
"fastapi==0.115.6",
]

docs = [
"pydoc-markdown",
"pydoc-markdown==4.8.2",
"pyyaml==6.0.2",
"termcolor",
"nbclient",
"termcolor==2.5.0",
"nbclient==0.10.2",
]

types = [
Expand All @@ -211,7 +210,7 @@ lint = [

dev = [
"pyautogen[lint,test,types,docs]",
"pre-commit==4.0.1",
"pre-commit==4.1.0",
"detect-secrets==1.5.0",
"uv==0.5.21",
]
Expand Down
Loading