From c3a8a2ad62f19366ae8d8f04cb8d4c8a03413f77 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 20:19:03 +0300 Subject: [PATCH 01/10] python311Packages.pyct: modernize --- .../python-modules/pyct/default.nix | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pyct/default.nix b/pkgs/development/python-modules/pyct/default.nix index 5509173bd985..9a752750945d 100644 --- a/pkgs/development/python-modules/pyct/default.nix +++ b/pkgs/development/python-modules/pyct/default.nix @@ -2,17 +2,24 @@ lib, buildPythonPackage, fetchPypi, - param, - pytestCheckHook, pythonAtLeast, + + # build-system + setuptools, + + # dependencies + param, pyyaml, requests, + + # tests + pytestCheckHook, }: buildPythonPackage rec { pname = "pyct"; version = "0.5.0"; - format = "setuptools"; + pyproject = true; disabled = pythonAtLeast "3.12"; @@ -21,22 +28,28 @@ buildPythonPackage rec { hash = "sha256-3Z9KxcvY43w1LAQDYGLTxfZ+/sdtQEdh7xawy/JqpqA="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ param pyyaml requests ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + ]; pythonImportsCheck = [ "pyct" ]; - meta = with lib; { + meta = { description = "ClI for Python common tasks for users"; mainProgram = "pyct"; homepage = "https://github.com/pyviz/pyct"; changelog = "https://github.com/pyviz-dev/pyct/releases/tag/v${version}"; - license = licenses.bsd3; + license = lib.licenses.bsd3; maintainers = [ ]; }; } From b453927e0134dc50daaeb359a39416ae43a63566 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 20:19:47 +0300 Subject: [PATCH 02/10] python312Packages.pyct: enable --- pkgs/development/python-modules/pyct/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pyct/default.nix b/pkgs/development/python-modules/pyct/default.nix index 9a752750945d..96aad663367f 100644 --- a/pkgs/development/python-modules/pyct/default.nix +++ b/pkgs/development/python-modules/pyct/default.nix @@ -21,8 +21,6 @@ buildPythonPackage rec { version = "0.5.0"; pyproject = true; - disabled = pythonAtLeast "3.12"; - src = fetchPypi { inherit pname version; hash = "sha256-3Z9KxcvY43w1LAQDYGLTxfZ+/sdtQEdh7xawy/JqpqA="; @@ -41,6 +39,11 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + # Only the command line doesn't work on with Python 3.12, due to usage of + # deprecated distutils module. Not disabling it totally. + disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [ + "pyct/tests/test_cmd.py" + ]; pythonImportsCheck = [ "pyct" ]; From e0490b14aebb8cbd64dca91d291551269241f675 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 21:00:03 +0300 Subject: [PATCH 03/10] python312Packages.hvplot: 0.10.0 -> 0.11.1 Changelog: https://github.com/holoviz/hvplot/releases/tag/v0.11.1 --- pkgs/development/python-modules/hvplot/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hvplot/default.nix b/pkgs/development/python-modules/hvplot/default.nix index 7884f61cbcb6..e266c2d8f098 100644 --- a/pkgs/development/python-modules/hvplot/default.nix +++ b/pkgs/development/python-modules/hvplot/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "hvplot"; - version = "0.10.0"; + version = "0.11.1"; pyproject = true; disabled = pythonOlder "3.9"; src = fetchPypi { inherit pname version; - hash = "sha256-6HSGqVv+FRq1LvFjpek9nL0EOZLPC3Vcyt0r82/t03Y="; + hash = "sha256-mJ7QOJGJrcR+3NJgHS6rGL82bnSwf14oc+AhMjxKFLs="; }; build-system = [ setuptools-scm ]; From 1cd19c7ac46711ba34c33a9417b8d536c093c792 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 22:21:50 +0300 Subject: [PATCH 04/10] python312Packages.holoview: order inputs; no with lib; in meta --- .../development/python-modules/holoviews/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/holoviews/default.nix b/pkgs/development/python-modules/holoviews/default.nix index eb17dd053400..51f7dbeedabd 100644 --- a/pkgs/development/python-modules/holoviews/default.nix +++ b/pkgs/development/python-modules/holoviews/default.nix @@ -1,15 +1,19 @@ { lib, buildPythonPackage, - colorcet, fetchPypi, + pythonOlder, + + # build-system hatch-vcs, hatchling, + + # dependencies + colorcet, numpy, pandas, panel, param, - pythonOlder, pyviz-comms, }: @@ -44,11 +48,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "holoviews" ]; - meta = with lib; { + meta = { description = "Python data analysis and visualization seamless and simple"; mainProgram = "holoviews"; homepage = "https://www.holoviews.org/"; - license = licenses.bsd3; + license = lib.licenses.bsd3; maintainers = [ ]; }; } From 45d55e1d2086536191acb4c7005b1011b7f948fd Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 22:22:21 +0300 Subject: [PATCH 05/10] python312Packages.holoview: enable tests --- .../python-modules/holoviews/default.nix | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/holoviews/default.nix b/pkgs/development/python-modules/holoviews/default.nix index 51f7dbeedabd..5f1963bcdc38 100644 --- a/pkgs/development/python-modules/holoviews/default.nix +++ b/pkgs/development/python-modules/holoviews/default.nix @@ -15,6 +15,11 @@ panel, param, pyviz-comms, + + # tests + pytestCheckHook, + pytest-cov, + flaky, }: buildPythonPackage rec { @@ -43,8 +48,24 @@ buildPythonPackage rec { pyviz-comms ]; - # tests not fully included with pypi release - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + pytest-cov + flaky + ]; + + disabledTests = [ + # All the below fail due to some change in flaky API + "test_periodic_param_fn_non_blocking" + "test_callback_cleanup" + "test_poly_edit_callback" + "test_launch_server_with_complex_plot" + "test_launch_server_with_stream" + "test_launch_simple_server" + "test_server_dynamicmap_with_dims" + "test_server_dynamicmap_with_stream" + "test_server_dynamicmap_with_stream_dims" + ]; pythonImportsCheck = [ "holoviews" ]; From 84cdacd319e469aa7db108c092c3b78adddaa4a7 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 22:24:35 +0300 Subject: [PATCH 06/10] python312Packages.hvplot: order inputs; no with lib; in meta --- .../python-modules/hvplot/default.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/hvplot/default.nix b/pkgs/development/python-modules/hvplot/default.nix index e266c2d8f098..39d0b08c52b6 100644 --- a/pkgs/development/python-modules/hvplot/default.nix +++ b/pkgs/development/python-modules/hvplot/default.nix @@ -1,13 +1,17 @@ { lib, - bokeh, buildPythonPackage, - colorcet, fetchPypi, + pythonOlder, + + # build-system + setuptools-scm, + + # dependencies + bokeh, + colorcet, holoviews, pandas, - pythonOlder, - setuptools-scm, }: buildPythonPackage rec { @@ -22,7 +26,9 @@ buildPythonPackage rec { hash = "sha256-mJ7QOJGJrcR+3NJgHS6rGL82bnSwf14oc+AhMjxKFLs="; }; - build-system = [ setuptools-scm ]; + build-system = [ + setuptools-scm + ]; dependencies = [ bokeh @@ -36,11 +42,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "hvplot.pandas" ]; - meta = with lib; { + meta = { description = "High-level plotting API for the PyData ecosystem built on HoloViews"; homepage = "https://hvplot.pyviz.org"; changelog = "https://github.com/holoviz/hvplot/releases/tag/v${version}"; - license = licenses.bsd3; + license = lib.licenses.bsd3; maintainers = [ ]; }; } From 72ddbd5caeb228e53a7c0018aee828c594139f60 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 22:41:05 +0300 Subject: [PATCH 07/10] python31{1,2}Packages.bokeh-sampledata: init at 2024.2 --- .../bokeh-sampledata/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/bokeh-sampledata/default.nix diff --git a/pkgs/development/python-modules/bokeh-sampledata/default.nix b/pkgs/development/python-modules/bokeh-sampledata/default.nix new file mode 100644 index 000000000000..e4bba2b69f1c --- /dev/null +++ b/pkgs/development/python-modules/bokeh-sampledata/default.nix @@ -0,0 +1,46 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + + # build-system + setuptools, + setuptools-git-versioning, + + # dependencies + icalendar, + pandas, +}: + +buildPythonPackage rec { + pname = "bokeh-sampledata"; + version = "2024.2"; + pyproject = true; + + src = fetchPypi { + pname = "bokeh_sampledata"; + inherit version; + hash = "sha256-5j2qluedVj7IuE8gZy/+lPkFshRV+rjYPuM05G2jNiQ="; + }; + + build-system = [ + setuptools + setuptools-git-versioning + ]; + + dependencies = [ + icalendar + pandas + ]; + + pythonImportsCheck = [ + "bokeh_sampledata" + ]; + + meta = { + description = "Sample datasets for Bokeh examples"; + homepage = "https://pypi.org/project/bokeh-sampledata"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6b4ce7eebdcc..bda968196ccd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1753,6 +1753,8 @@ self: super: with self; { bokeh = callPackage ../development/python-modules/bokeh { }; + bokeh-sampledata = callPackage ../development/python-modules/bokeh-sampledata { }; + boltons = callPackage ../development/python-modules/boltons { }; boltztrap2 = callPackage ../development/python-modules/boltztrap2 { }; From 3b43bfd340ad531bcc14b60cf3ae1321c252cf5c Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 22:51:38 +0300 Subject: [PATCH 08/10] python31{1,2}Packages.hvplot: enable (most) tests --- .../python-modules/hvplot/default.nix | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hvplot/default.nix b/pkgs/development/python-modules/hvplot/default.nix index 39d0b08c52b6..4831f14335c0 100644 --- a/pkgs/development/python-modules/hvplot/default.nix +++ b/pkgs/development/python-modules/hvplot/default.nix @@ -12,6 +12,17 @@ colorcet, holoviews, pandas, + + # tests + pytestCheckHook, + dask, + xarray, + bokeh-sampledata, + parameterized, + selenium, + matplotlib, + scipy, + plotly, }: buildPythonPackage rec { @@ -37,8 +48,26 @@ buildPythonPackage rec { pandas ]; - # Many tests require a network connection - doCheck = false; + nativeCheckInputs = [ + pytestCheckHook + dask + xarray + bokeh-sampledata + parameterized + selenium + matplotlib + scipy + plotly + ]; + + disabledTestPaths = [ + # All of the following below require xarray.tutorial files that require + # downloading files from the internet (not possible in the sandbox). + "hvplot/tests/testgeo.py" + "hvplot/tests/testinteractive.py" + "hvplot/tests/testui.py" + "hvplot/tests/testutil.py" + ]; pythonImportsCheck = [ "hvplot.pandas" ]; From edbe0026d341fab446ee2aa2abba7c6f440984c1 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 27 Oct 2024 10:44:30 +0200 Subject: [PATCH 09/10] python312Packages.intake: 2.0.3 -> 2.0.7 Diff: https://github.com/intake/intake/compare/refs/tags/2.0.3...2.0.7 Changelog: https://github.com/intake/intake/blob/2.0.7/docs/source/changelog.rst --- pkgs/development/python-modules/intake/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/intake/default.nix b/pkgs/development/python-modules/intake/default.nix index 7ee914aca70f..f01195764762 100644 --- a/pkgs/development/python-modules/intake/default.nix +++ b/pkgs/development/python-modules/intake/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, - appdirs, + platformdirs, bokeh, buildPythonPackage, dask, @@ -20,6 +20,7 @@ python-snappy, pythonOlder, pyyaml, + networkx, requests, setuptools, setuptools-scm, @@ -28,7 +29,7 @@ buildPythonPackage rec { pname = "intake"; - version = "2.0.3"; + version = "2.0.7"; pyproject = true; disabled = pythonOlder "3.8"; @@ -37,7 +38,7 @@ buildPythonPackage rec { owner = "intake"; repo = "intake"; rev = "refs/tags/${version}"; - hash = "sha256-Fyv85HkoE9OPOoSHR1sgCG0iAFuSiQMT7cyZcQyLvv0="; + hash = "sha256-F13jbAQP3G3cKeAegM1w/t32xyC0BgL9/67aIlzA4SE="; }; nativeBuildInputs = [ @@ -46,7 +47,7 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - appdirs + platformdirs dask entrypoints fsspec @@ -54,6 +55,7 @@ buildPythonPackage rec { jinja2 pandas pyyaml + networkx ]; nativeCheckInputs = [ From a7bc20eede1da3f3bd01bb9b6e10abb2dca82f54 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 27 Oct 2024 10:56:19 +0200 Subject: [PATCH 10/10] python312Packages.intake: remove failing tests (conditionally) --- .../python-modules/intake/default.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/intake/default.nix b/pkgs/development/python-modules/intake/default.nix index f01195764762..1422752b3230 100644 --- a/pkgs/development/python-modules/intake/default.nix +++ b/pkgs/development/python-modules/intake/default.nix @@ -19,6 +19,7 @@ pytestCheckHook, python-snappy, pythonOlder, + pythonAtLeast, pyyaml, networkx, requests, @@ -126,12 +127,18 @@ buildPythonPackage rec { # Timing-based, flaky on darwin and possibly others "test_idle_timer" ] - ++ lib.optionals - (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") - [ - # Flaky with older low-res mtime on darwin < 10.13 (#143987) - "test_second_load_timestamp" - ]; + ++ lib.optionals (pythonAtLeast "3.12") [ + # Require deprecated distutils + "test_which" + "test_load" + ] + ++ + lib.optionals + (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") + [ + # Flaky with older low-res mtime on darwin < 10.13 (#143987) + "test_second_load_timestamp" + ]; pythonImportsCheck = [ "intake" ];