python3Packages.smolagents: move optional-attrs in the main scope

This commit is contained in:
Gaetan Lepage
2026-01-10 22:33:48 +00:00
parent 0cfc14a4e3
commit 599cb4b210
@@ -51,7 +51,29 @@
wikipedia-api,
}:
let
buildPythonPackage (finalAttrs: {
pname = "smolagents";
version = "1.21.3";
pyproject = true;
src = fetchFromGitHub {
owner = "huggingface";
repo = "smolagents";
tag = "v${finalAttrs.version}";
hash = "sha256-X9tJfNxF2icULyma0dWIQEllY9oKaCB+MQ4JJTdzhz4=";
};
build-system = [ setuptools ];
dependencies = [
huggingface-hub
jinja2
pillow
python-dotenv
requests
rich
];
optional-dependencies = lib.fix (self: {
audio = [ soundfile ] ++ self.torch;
bedrock = [ boto3 ];
@@ -101,39 +123,13 @@ let
# ];
});
in
buildPythonPackage (finalAttrs: {
pname = "smolagents";
version = "1.21.3";
pyproject = true;
src = fetchFromGitHub {
owner = "huggingface";
repo = "smolagents";
tag = "v${finalAttrs.version}";
hash = "sha256-X9tJfNxF2icULyma0dWIQEllY9oKaCB+MQ4JJTdzhz4=";
};
build-system = [ setuptools ];
dependencies = [
huggingface-hub
jinja2
pillow
python-dotenv
requests
rich
];
inherit optional-dependencies;
nativeCheckInputs = [
ipython
pytest-datadir
pytestCheckHook
wikipedia-api
]
++ lib.concatAttrValues optional-dependencies;
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
pythonImportsCheck = [ "smolagents" ];