python3Packages.shiny: 1.4.0 -> 1.5.0 (#462093)
This commit is contained in:
168
pkgs/development/python-modules/chatlas/default.nix
Normal file
168
pkgs/development/python-modules/chatlas/default.nix
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
|
||||||
|
# build-system
|
||||||
|
hatch-vcs,
|
||||||
|
hatchling,
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
jinja2,
|
||||||
|
openai,
|
||||||
|
orjson,
|
||||||
|
pydantic,
|
||||||
|
requests,
|
||||||
|
rich,
|
||||||
|
|
||||||
|
# tests
|
||||||
|
anthropic,
|
||||||
|
google-genai,
|
||||||
|
htmltools,
|
||||||
|
matplotlib,
|
||||||
|
pillow,
|
||||||
|
pytest-asyncio,
|
||||||
|
pytest-snapshot,
|
||||||
|
pytestCheckHook,
|
||||||
|
tenacity,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "chatlas";
|
||||||
|
version = "0.13.2";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "posit-dev";
|
||||||
|
repo = "chatlas";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-uCgpNvDJZKwxX4HYF8tyvJ1AiQLmybuxrZkYK/u5xlg=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
hatch-vcs
|
||||||
|
hatchling
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
jinja2
|
||||||
|
openai
|
||||||
|
orjson
|
||||||
|
pydantic
|
||||||
|
requests
|
||||||
|
rich
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "chatlas" ];
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
anthropic
|
||||||
|
google-genai
|
||||||
|
htmltools
|
||||||
|
matplotlib
|
||||||
|
pillow
|
||||||
|
pytest-asyncio
|
||||||
|
pytest-snapshot
|
||||||
|
pytestCheckHook
|
||||||
|
tenacity
|
||||||
|
];
|
||||||
|
|
||||||
|
disabledTestPaths = [
|
||||||
|
# Require an Openai API key and/or internet access
|
||||||
|
"tests/test_batch_chat.py"
|
||||||
|
"tests/test_content.py"
|
||||||
|
"tests/test_provider_anthropic.py"
|
||||||
|
"tests/test_provider_azure.py"
|
||||||
|
"tests/test_provider_databricks.py"
|
||||||
|
"tests/test_provider_google.py"
|
||||||
|
"tests/test_provider_openai.py"
|
||||||
|
"tests/test_provider_snowflake.py"
|
||||||
|
"tests/test_register_tool_models.py"
|
||||||
|
];
|
||||||
|
|
||||||
|
disabledTests = [
|
||||||
|
# Require an Openai API key
|
||||||
|
"test_async_tool_yielding_multiple_results"
|
||||||
|
"test_basic_export"
|
||||||
|
"test_basic_repr"
|
||||||
|
"test_basic_str"
|
||||||
|
"test_chat_callbacks"
|
||||||
|
"test_chat_structured"
|
||||||
|
"test_chat_structured_async"
|
||||||
|
"test_chat_tool_request_reject"
|
||||||
|
"test_chat_tool_request_reject2"
|
||||||
|
"test_compute_cost"
|
||||||
|
"test_content_tool_request_serializable"
|
||||||
|
"test_cross_provider_compatibility"
|
||||||
|
"test_deepcopy_chat"
|
||||||
|
"test_get_token_prices"
|
||||||
|
"test_get_tools_after_registration"
|
||||||
|
"test_get_tools_empty"
|
||||||
|
"test_google_provider_model_params"
|
||||||
|
"test_google_provider_parameter_mapping"
|
||||||
|
"test_invoke_tool_returns_tool_result"
|
||||||
|
"test_json_serialize"
|
||||||
|
"test_last_turn_retrieval"
|
||||||
|
"test_model_params_integration_with_provider"
|
||||||
|
"test_model_params_kwargs_priority"
|
||||||
|
"test_model_params_preserved_across_calls"
|
||||||
|
"test_modify_system_prompt"
|
||||||
|
"test_old_style_tool_invocation_still_works"
|
||||||
|
"test_parameter_validation_edge_cases"
|
||||||
|
"test_provider_parameter_differences"
|
||||||
|
"test_register_tool"
|
||||||
|
"test_register_tool_duplicate_name_error"
|
||||||
|
"test_register_tool_force_overwrite"
|
||||||
|
"test_register_tool_instance_basic"
|
||||||
|
"test_register_tool_instance_force_overwrite"
|
||||||
|
"test_register_tool_instance_with_custom_name"
|
||||||
|
"test_register_tool_instance_with_model_override"
|
||||||
|
"test_register_tool_with_complex_parameters"
|
||||||
|
"test_register_tool_with_custom_name"
|
||||||
|
"test_register_tool_with_same_name_different_function"
|
||||||
|
"test_set_model_params_all_parameters"
|
||||||
|
"test_set_model_params_basic"
|
||||||
|
"test_set_model_params_empty_call"
|
||||||
|
"test_set_model_params_incremental_updates"
|
||||||
|
"test_set_model_params_invalid_temperature"
|
||||||
|
"test_set_model_params_invalid_top_p"
|
||||||
|
"test_set_model_params_kwargs"
|
||||||
|
"test_set_model_params_kwargs_replacement"
|
||||||
|
"test_set_model_params_missing_values"
|
||||||
|
"test_set_model_params_multiple_unsupported"
|
||||||
|
"test_set_model_params_none_reset"
|
||||||
|
"test_set_model_params_reset_specific_param"
|
||||||
|
"test_set_model_params_type_validation"
|
||||||
|
"test_set_model_params_unsupported_parameter"
|
||||||
|
"test_set_model_params_updates_existing"
|
||||||
|
"test_set_model_params_with_stop_sequences"
|
||||||
|
"test_set_tools_mixed"
|
||||||
|
"test_set_tools_replaces_existing"
|
||||||
|
"test_set_tools_with_functions"
|
||||||
|
"test_set_tools_with_tool_objects"
|
||||||
|
"test_simple_async_batch_chat"
|
||||||
|
"test_simple_batch_chat"
|
||||||
|
"test_simple_streaming_chat"
|
||||||
|
"test_simple_streaming_chat_async"
|
||||||
|
"test_supported_model_params_openai"
|
||||||
|
"test_system_prompt_retrieval"
|
||||||
|
"test_token_count_method"
|
||||||
|
"test_tokens_method"
|
||||||
|
"test_tool_custom_result"
|
||||||
|
"test_tool_yielding_content_tool_results"
|
||||||
|
"test_tool_yielding_multiple_results"
|
||||||
|
"test_tool_yielding_single_result_still_works"
|
||||||
|
"test_tool_yielding_with_error"
|
||||||
|
"test_translate_model_params_openai"
|
||||||
|
"test_unknown_tool_error_format_updated"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Friendly guide to building LLM chat apps in Python with less effort and more clarity";
|
||||||
|
homepage = "https://posit-dev.github.io/chatlas";
|
||||||
|
downloadPage = "https://github.com/posit-dev/chatlas";
|
||||||
|
changelog = "https://github.com/posit-dev/chatlas/blob/${src.tag}/CHANGELOG.md";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
setuptools-scm,
|
setuptools-scm,
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
appdirs,
|
|
||||||
asgiref,
|
asgiref,
|
||||||
click,
|
click,
|
||||||
htmltools,
|
htmltools,
|
||||||
@@ -19,9 +18,11 @@
|
|||||||
narwhals,
|
narwhals,
|
||||||
orjson,
|
orjson,
|
||||||
packaging,
|
packaging,
|
||||||
|
platformdirs,
|
||||||
prompt-toolkit,
|
prompt-toolkit,
|
||||||
python-multipart,
|
python-multipart,
|
||||||
questionary,
|
questionary,
|
||||||
|
shinychat,
|
||||||
starlette,
|
starlette,
|
||||||
typing-extensions,
|
typing-extensions,
|
||||||
uvicorn,
|
uvicorn,
|
||||||
@@ -47,14 +48,14 @@
|
|||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "shiny";
|
pname = "shiny";
|
||||||
version = "1.4.0";
|
version = "1.5.0";
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "posit-dev";
|
owner = "posit-dev";
|
||||||
repo = "py-shiny";
|
repo = "py-shiny";
|
||||||
tag = "v${version}";
|
tag = "v${version}";
|
||||||
hash = "sha256-SsMZ+aiGFtP6roTiuBZWnHqPso3ZiWLgBToaTLiC2ko=";
|
hash = "sha256-zRKfSY0rE+jzwYUcrRTIFW3OVmavhMDbAQEpry46zCI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
build-system = [
|
build-system = [
|
||||||
@@ -63,7 +64,6 @@ buildPythonPackage rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
appdirs
|
|
||||||
asgiref
|
asgiref
|
||||||
click
|
click
|
||||||
htmltools
|
htmltools
|
||||||
@@ -73,10 +73,12 @@ buildPythonPackage rec {
|
|||||||
narwhals
|
narwhals
|
||||||
orjson
|
orjson
|
||||||
packaging
|
packaging
|
||||||
|
platformdirs
|
||||||
prompt-toolkit
|
prompt-toolkit
|
||||||
python-multipart
|
python-multipart
|
||||||
questionary
|
questionary
|
||||||
setuptools
|
setuptools
|
||||||
|
shinychat
|
||||||
starlette
|
starlette
|
||||||
typing-extensions
|
typing-extensions
|
||||||
uvicorn
|
uvicorn
|
||||||
@@ -110,6 +112,14 @@ buildPythonPackage rec {
|
|||||||
]
|
]
|
||||||
++ lib.flatten (lib.attrValues optional-dependencies);
|
++ lib.flatten (lib.attrValues optional-dependencies);
|
||||||
|
|
||||||
|
pytestFlags = [
|
||||||
|
# ERROR: 'fixture' is not a valid asyncio_default_fixture_loop_scope.
|
||||||
|
# Valid scopes are: function, class, module, package, session.
|
||||||
|
# https://github.com/pytest-dev/pytest-asyncio/issues/924
|
||||||
|
"-o asyncio_mode=auto"
|
||||||
|
"-o asyncio_default_fixture_loop_scope=function"
|
||||||
|
];
|
||||||
|
|
||||||
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
|
||||||
disabledTests = [
|
disabledTests = [
|
||||||
|
|||||||
129
pkgs/development/python-modules/shinychat/default.nix
Normal file
129
pkgs/development/python-modules/shinychat/default.nix
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
|
||||||
|
# build-system
|
||||||
|
hatch-vcs,
|
||||||
|
hatchling,
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
htmltools,
|
||||||
|
|
||||||
|
# optional-dependencies
|
||||||
|
anthropic,
|
||||||
|
chatlas,
|
||||||
|
google-generativeai,
|
||||||
|
langchain-core,
|
||||||
|
ollama,
|
||||||
|
openai,
|
||||||
|
pydantic,
|
||||||
|
tokenizers,
|
||||||
|
|
||||||
|
# tests
|
||||||
|
pillow,
|
||||||
|
playwright,
|
||||||
|
pytest-playwright,
|
||||||
|
pytestCheckHook,
|
||||||
|
shiny,
|
||||||
|
shinychat,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "shinychat";
|
||||||
|
version = "0.2.8";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "posit-dev";
|
||||||
|
repo = "shinychat";
|
||||||
|
tag = "py/v${version}";
|
||||||
|
hash = "sha256-thdLaZ+rnD8yumxhjXOLhufcSBD0oNKOWSxxDdJ9tNU=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
hatch-vcs
|
||||||
|
hatchling
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonRemoveDeps = [
|
||||||
|
"shiny" # circular dependency
|
||||||
|
];
|
||||||
|
dependencies = [
|
||||||
|
htmltools
|
||||||
|
];
|
||||||
|
|
||||||
|
optional-dependencies = {
|
||||||
|
providers = [
|
||||||
|
anthropic
|
||||||
|
chatlas
|
||||||
|
google-generativeai
|
||||||
|
langchain-core
|
||||||
|
ollama
|
||||||
|
openai
|
||||||
|
pydantic
|
||||||
|
tokenizers
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# ImportError: cannot import name 'Chat' from partially initialized module 'shinychat' (most likely due to a circular import)
|
||||||
|
# "shinychat"
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
pillow
|
||||||
|
playwright
|
||||||
|
pytest-playwright
|
||||||
|
pytestCheckHook
|
||||||
|
shiny
|
||||||
|
]
|
||||||
|
++ lib.flatten (lib.attrValues optional-dependencies);
|
||||||
|
|
||||||
|
disabledTests = [
|
||||||
|
# AssertionError: assert False
|
||||||
|
"test_as_langchain_message"
|
||||||
|
|
||||||
|
# AssertionError: assert 'AIMessage' == 'BaseMessage'
|
||||||
|
"test_langchain_normalization"
|
||||||
|
|
||||||
|
# RuntimeError: Failed to download a default tokenizer
|
||||||
|
"test_chat_message_trimming"
|
||||||
|
|
||||||
|
# Require running a headless chromium browser
|
||||||
|
"test_latest_stream_result"
|
||||||
|
"test_validate_chat"
|
||||||
|
"test_validate_chat_append_user_message"
|
||||||
|
"test_validate_chat_append_user_message"
|
||||||
|
"test_validate_chat_basic"
|
||||||
|
"test_validate_chat_basic"
|
||||||
|
"test_validate_chat_basic"
|
||||||
|
"test_validate_chat_basic_error"
|
||||||
|
"test_validate_chat_input_suggestion"
|
||||||
|
"test_validate_chat_message_stream_context"
|
||||||
|
"test_validate_chat_shiny_output"
|
||||||
|
"test_validate_chat_shiny_output"
|
||||||
|
"test_validate_chat_stream_result"
|
||||||
|
"test_validate_chat_transform"
|
||||||
|
"test_validate_chat_transform_assistant"
|
||||||
|
"test_validate_chat_transform_assistant"
|
||||||
|
"test_validate_chat_update_user_input"
|
||||||
|
"test_validate_stream_basic"
|
||||||
|
"test_validate_stream_shiny_ui"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Circular dependency with shiny
|
||||||
|
doCheck = false;
|
||||||
|
passthru.tests.pytest = shinychat.overridePythonAttrs {
|
||||||
|
doCheck = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Chat UI component for Shiny";
|
||||||
|
homepage = "https://posit-dev.github.io/shinychat";
|
||||||
|
downloadPage = "https://github.com/posit-dev/shinychat";
|
||||||
|
changelog = "https://github.com/posit-dev/shinychat/releases/tag/${src.tag}";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -2567,6 +2567,8 @@ self: super: with self; {
|
|||||||
|
|
||||||
chat-downloader = callPackage ../development/python-modules/chat-downloader { };
|
chat-downloader = callPackage ../development/python-modules/chat-downloader { };
|
||||||
|
|
||||||
|
chatlas = callPackage ../development/python-modules/chatlas { };
|
||||||
|
|
||||||
check-manifest = callPackage ../development/python-modules/check-manifest { };
|
check-manifest = callPackage ../development/python-modules/check-manifest { };
|
||||||
|
|
||||||
checkdmarc = callPackage ../development/python-modules/checkdmarc { };
|
checkdmarc = callPackage ../development/python-modules/checkdmarc { };
|
||||||
@@ -16927,6 +16929,8 @@ self: super: with self; {
|
|||||||
|
|
||||||
shiny = callPackage ../development/python-modules/shiny { };
|
shiny = callPackage ../development/python-modules/shiny { };
|
||||||
|
|
||||||
|
shinychat = callPackage ../development/python-modules/shinychat { };
|
||||||
|
|
||||||
shippinglabel = callPackage ../development/python-modules/shippinglabel { };
|
shippinglabel = callPackage ../development/python-modules/shippinglabel { };
|
||||||
|
|
||||||
shiv = callPackage ../development/python-modules/shiv { };
|
shiv = callPackage ../development/python-modules/shiv { };
|
||||||
|
|||||||
Reference in New Issue
Block a user