Unverified Commit a0e53310 authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

python3Packages.smolagents: skip failing test on python>=3.14 (#478704)

parents 23e6b8c3 5590adb3
Loading
Loading
Loading
Loading
+36 −16
Original line number Diff line number Diff line
@@ -2,23 +2,30 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,

  # build-system
  hatchling,
  anywidget,
  ipython,
  ipywidgets,

  # dependencies
  jinja2,
  jsonschema,
  mistune,
  narwhals,
  numpy,
  packaging,
  pandas,
  toolz,
  typing-extensions,

  # tests
  anywidget,
  ipython,
  ipywidgets,
  mistune,
  polars,
  pytest-xdist,
  pytestCheckHook,
  pythonOlder,
  toolz,
  typing-extensions,
  vega-datasets,
  vl-convert-python,
  writableTmpDirAsHomeHook,
}:
@@ -46,7 +53,9 @@ buildPythonPackage (finalAttrs: {
    pandas
    toolz
  ]
  ++ lib.optional (pythonOlder "3.14") typing-extensions;
  ++ lib.optionals (pythonOlder "3.14") [
    typing-extensions
  ];

  nativeCheckInputs = [
    anywidget
@@ -56,6 +65,7 @@ buildPythonPackage (finalAttrs: {
    polars
    pytest-xdist
    pytestCheckHook
    vega-datasets
    vl-convert-python
    writableTmpDirAsHomeHook
  ];
@@ -69,26 +79,36 @@ buildPythonPackage (finalAttrs: {
  disabledTests = [
    # ValueError: Saving charts in 'svg' format requires the vl-convert-python or altair_saver package: see http://github.com/altair-viz/altair_saver/
    "test_renderer_with_none_embed_options"

    # Sometimes conflict due to parallelism
    "test_dataframe_to_csv[polars]"
    "test_dataframe_to_csv[pandas]"

    # Network access
    "test_theme_remote_lambda"
    "test_chart_validation_errors"
    "test_data_consistency"
    "test_load_call"
    "test_loader_call"
    "test_multiple_field_strings_in_condition"
    "test_no_remote_connection"
    "test_pandas_date_parse"
    "test_pandas_date_parse"
    "test_polars_date_read_json_roundtrip"
    "test_polars_date_read_json_roundtrip"
    "test_polars_date_read_json_roundtrip"
    "test_polars_date_read_json_roundtrip"
    "test_reader_cache"
    "test_theme_remote_lambda"
    "test_tsv"
  ];

  disabledTestPaths = [
    # Disabled because it requires internet connectivity
    "tests/test_examples.py"
    "tests/test_datasets.py"
    # Network access
    "altair/datasets/_data.py"
    # TODO: Disabled because of missing altair_viewer package
    "tests/vegalite/v6/test_api.py"
    "tests/test_examples.py"

    # avoid updating files and dependency on black
    "tests/test_toplevel.py"
    # require vl-convert package
    "tests/utils/test_compiler.py"
  ];

  meta = {
+27 −11
Original line number Diff line number Diff line
@@ -2,18 +2,32 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,

  # build-system
  setuptools,

  # dependencies
  jinja2,
  prettytable,
  simplejson,

  # optional-dependencies
  pillow,

  # tests
  numpy,
  pandas,
  pillow,
  prettytable,
  pytestCheckHook,
  requests,
  setuptools,
  simplejson,
}:

buildPythonPackage rec {
let
  optional-dependencies = {
    images = [ pillow ];
  };
in
buildPythonPackage (finalAttrs: {
  pname = "pyecharts";
  version = "2.0.9";
  pyproject = true;
@@ -21,7 +35,7 @@ buildPythonPackage rec {
  src = fetchFromGitHub {
    owner = "pyecharts";
    repo = "pyecharts";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-AMdPsTQsndc0fr4NF2AnJy98k4I2832/GNWeY4IWSRA=";
  };

@@ -33,9 +47,7 @@ buildPythonPackage rec {
    simplejson
  ];

  optional-dependencies = {
    images = [ pillow ];
  };
  inherit optional-dependencies;

  nativeCheckInputs = [
    numpy
@@ -52,13 +64,17 @@ buildPythonPackage rec {
    "test_render_embed_js"
    "test_display_javascript_v2"
    "test_lines3d_base"
  ]
  ++ lib.optionals (pythonAtLeast "3.14") [
    # pyecharts.exceptions.WordCloudMaskImageException
    "test_wordcloud_encode_image_to_base64_os_error"
  ];

  meta = {
    description = "Python Echarts Plotting Library";
    homepage = "https://github.com/pyecharts/pyecharts";
    changelog = "https://github.com/pyecharts/pyecharts/releases/tag/${src.tag}";
    changelog = "https://github.com/pyecharts/pyecharts/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}
})
+34 −25
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,

  # build-system
  setuptools,
@@ -50,29 +51,7 @@
  wikipedia-api,
}:

buildPythonPackage rec {
  pname = "smolagents";
  version = "1.21.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "huggingface";
    repo = "smolagents";
    tag = "v${version}";
    hash = "sha256-X9tJfNxF2icULyma0dWIQEllY9oKaCB+MQ4JJTdzhz4=";
  };

  build-system = [ setuptools ];

  dependencies = [
    huggingface-hub
    jinja2
    pillow
    python-dotenv
    requests
    rich
  ];

let
  optional-dependencies = lib.fix (self: {
    audio = [ soundfile ] ++ self.torch;
    bedrock = [ boto3 ];
@@ -122,6 +101,32 @@ buildPythonPackage rec {
    # ];
  });

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
@@ -157,6 +162,10 @@ buildPythonPackage rec {
    "test_visit_webpage"
    "test_wikipedia_search"
  ]
  ++ lib.optionals (pythonAtLeast "3.14") [
    # TypeError: 'function' object is not subscriptable
    "test_stream_to_gradio_memory_step"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # Missing dependencies
    "test_get_mlx"
@@ -175,8 +184,8 @@ buildPythonPackage rec {
  meta = {
    description = "Barebones library for agents";
    homepage = "https://github.com/huggingface/smolagents";
    changelog = "https://github.com/huggingface/smolagents/releases/tag/${src.tag}";
    changelog = "https://github.com/huggingface/smolagents/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ fab ];
  };
}
})