Unverified Commit dde249ab authored by Valentin Chassignol's avatar Valentin Chassignol
Browse files

python310Packages.altair: 4.2.2 -> 5.0.1

parent 09011d34
Loading
Loading
Loading
Loading
+42 −30
Original line number Diff line number Diff line
{ lib, buildPythonPackage, fetchPypi, isPy27
, entrypoints
, glibcLocales
, ipython
, jinja2
, jsonschema
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder

# Runtime dependencies
, hatchling
, toolz
, numpy
, jsonschema
, typing-extensions
, pandas
, jinja2
, importlib-metadata

# Build, dev and test dependencies
, ipython
, pytestCheckHook
, pythonOlder
, recommonmark
, six
, sphinx
, toolz
, typing ? null
, vega_datasets
, sphinx
}:

buildPythonPackage rec {
  pname = "altair";
  version = "4.2.2";
  disabled = isPy27;
  version = "5.0.1";
  format = "pyproject";
  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-OTmaJnxJsw0QLBBBHmerJjdBVqhLGuufzRUUBCm6ScU=";
  src = fetchFromGitHub {
    owner = "altair-viz";
    repo = "altair";
    rev = "refs/tags/v${version}";
    hash = "sha256-7bTrfryu4oaodVGNFNlVk9vXmDA5/9ahvCmvUGzZ5OQ=";
  };

  nativeBuildInputs = [
    hatchling
  ];

  propagatedBuildInputs = [
    entrypoints
    jinja2
    jsonschema
    numpy
    pandas
    six
    toolz
    jinja2
  ] ++ lib.optionals (pythonOlder "3.5") [ typing ];
  ] ++ lib.optional (pythonOlder "3.8") importlib-metadata
    ++ lib.optional (pythonOlder "3.11") typing-extensions;

  nativeCheckInputs = [
    glibcLocales
    ipython
    pytestCheckHook
    recommonmark
    sphinx
    vega_datasets
    pytestCheckHook
  ];

  pythonImportsCheck = [ "altair" ];

  # avoid examples directory, which fetches web resources
  preCheck = ''
    cd altair/tests
  '';
  disabledTestPaths = [
    # Disabled because it requires internet connectivity
    "tests/test_examples.py"
    # TODO: Disabled because of missing altair_viewer package
    "tests/vegalite/v5/test_api.py"
    # avoid updating files and dependency on black
    "tests/test_toplevel.py"
  ];

  meta = with lib; {
    description = "A declarative statistical visualization library for Python.";
    homepage = "https://github.com/altair-viz/altair";
    homepage = "https://altair-viz.github.io";
    downloadPage = "https://github.com/altair-viz/altair";
    license = licenses.bsd3;
    maintainers = with maintainers; [ teh ];
    platforms = platforms.unix;
  };
}