diff --git a/pkgs/development/python-modules/folium/default.nix b/pkgs/development/python-modules/folium/default.nix index a63d9626fb87..0527ca262007 100644 --- a/pkgs/development/python-modules/folium/default.nix +++ b/pkgs/development/python-modules/folium/default.nix @@ -1,7 +1,7 @@ { lib, - branca, buildPythonPackage, + branca, fetchFromGitHub, geodatasets, geopandas, @@ -10,6 +10,7 @@ numpy, pandas, pillow, + pixelmatch, pytestCheckHook, pythonOlder, requests, @@ -52,16 +53,16 @@ buildPythonPackage rec { nbconvert pandas pillow + pixelmatch pytestCheckHook + selenium ]; disabledTests = [ # Tests require internet connection - "test__repr_png_is_bytes" - "test_geojson" - "test_heat_map_with_weights" "test_json_request" - "test_notebook" + # no selenium driver + "test__repr_png_is_bytes" "test_valid_png_size" "test_valid_png" # pooch tries to write somewhere it can, and geodatasets does not give us an env var to customize this. @@ -69,7 +70,8 @@ buildPythonPackage rec { ]; disabledTestPaths = [ - # Import issue with selenium.webdriver.common.fedcm + # Selenium cannot find chrome driver, even with chromedriver package + "tests/snapshots/test_snapshots.py" "tests/selenium" ]; diff --git a/pkgs/development/python-modules/pixelmatch/default.nix b/pkgs/development/python-modules/pixelmatch/default.nix new file mode 100644 index 000000000000..03bf5db92d6d --- /dev/null +++ b/pkgs/development/python-modules/pixelmatch/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchgit, + pillow, + poetry-core, + pytestCheckHook, + pytest-benchmark, + pythonOlder, +}: +let + owner = "whtsky"; + repo = "pixelmatch-py"; +in +buildPythonPackage rec { + pname = "pixelmatch"; + version = "0.3.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchgit { + url = "https://github.com/whtsky/pixelmatch-py.git"; + tag = "v${version}"; + hash = "sha256-xq0LT7v83YRz0baw24iDXiuUxiNPMEsiZNIewsH3JPw="; + fetchLFS = true; + }; + + build-system = [ + poetry-core + ]; + + nativeCheckInputs = [ + pillow + pytest-benchmark + pytestCheckHook + ]; + + pythonImportsCheck = [ "pixelmatch" ]; + + meta = { + description = "A pixel-level image comparison library"; + homepage = "https://github.com/whtsky/pixelmatch-py"; + changelog = "https://github.com/whtsky/pixelmatch-py/tree/v${version}#changelog"; + license = with lib.licenses; [ isc ]; + teams = [ lib.teams.geospatial ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b73b4fe1e4d8..faca7687844b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11859,6 +11859,8 @@ self: super: with self; { pixel-ring = callPackage ../development/python-modules/pixel-ring { }; + pixelmatch = callPackage ../development/python-modules/pixelmatch { }; + pizzapi = callPackage ../development/python-modules/pizzapi { }; pjsua2 =