Skip to content
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
28 changes: 20 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,30 @@ $(VENV)/.venv-timestamp: uv.lock
uv venv --python 3.11 $(VENV)
uv pip install --prefix $(VENV) ruff
uv pip install --prefix $(VENV) mypy
uv pip install --prefix $(VENV) pytest
touch $(VENV)/.venv-timestamp

testenv: $(VENV)/.testenv

$(VENV)/.testenv: $(VENV)/bin/activate
. $(VENV_BIN)/activate && uv sync --active --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts" \
--link-mode=copy
# check uv version and use appropriate parameters
if . $(VENV_BIN)/activate && uv sync --help | grep -q -- "--active"; then \
. $(VENV_BIN)/activate && uv sync --active --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts" \
--link-mode=copy; \
else \
. $(VENV_BIN)/activate && uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts" \
--link-mode=copy; \
fi
cp .devcontainer/dbgpt.pth $(VENV)/lib/python3.11/site-packages
touch $(VENV)/.testenv

Expand Down Expand Up @@ -96,7 +108,7 @@ clean: ## Clean up the environment
rm -rf $(VENV)
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete
find . -type d -name '.pytest_cache' -delete
# find . -type d -name '.pytest_cache' -delete
find . -type d -name '.coverage' -delete

.PHONY: clean-dist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,8 @@ class ComplexConfig:
)

desc_list = _get_parameter_descriptions(ComplexConfig)

# Test union type
assert desc_list[0].param_name == "str_with_default"
assert desc_list[0].param_name == "union_field"
assert desc_list[0].param_type == "string"
assert desc_list[0].required is False

Expand Down Expand Up @@ -269,7 +268,7 @@ class TypeHintConfig:

# Test nested Optional with Union
assert desc_list[4].param_name == "nested_optional"
assert desc_list[4].param_type == "integer"
assert desc_list[4].param_type == "string"
assert desc_list[4].required is False

# Test nested | syntax
Expand Down