Skip to content

Commit

Permalink
Merge pull request NixOS#118737 from FRidh/panel
Browse files Browse the repository at this point in the history
python3Packages.{panel,bokeh}: update packages
  • Loading branch information
FRidh authored Apr 8, 2021
2 parents 47ef2bf + c6ed645 commit 4117f54
Show file tree
Hide file tree
Showing 6 changed files with 1,215 additions and 7 deletions.
5 changes: 3 additions & 2 deletions pkgs/development/python-modules/bokeh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@

buildPythonPackage rec {
pname = "bokeh";
version = "2.2.3"; # update together with panel which is not straightforward
# update together with panel which is not straightforward
version = "2.3.0";

src = fetchPypi {
inherit pname version;
sha256 = "c4a3f97afe5f525019dd58ee8c4e3d43f53fe1b1ac264ccaae9b02c07b2abc17";
sha256 = "dd417708f90702190222b1068a645acae99e66d4b58d7a336d545aeaa04e9b40";
};

patches = [
Expand Down
34 changes: 29 additions & 5 deletions pkgs/development/python-modules/panel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,39 @@
, pyct
, testpath
, tqdm
, callPackage
}:

buildPythonPackage rec {
let
node = callPackage ./node {};
in buildPythonPackage rec {
pname = "panel";
version = "0.9.7";
# Version 10 attempts to download models from the web during build-time
# https://github.com/holoviz/panel/issues/1819
version = "0.11.1";

# Don't forget to also update the node packages
# 1. retrieve the package.json file
# 2. nix shell nixpkgs#nodePackages.node2nix
# 3. node2nix
src = fetchPypi {
inherit pname version;
sha256 = "2e86d82bdd5e7664bf49558eedad62b664d5403ec9e422e5ddfcf69e3bd77318";
sha256 = "ce531e5c0c8a8ae74d523762aeb1666650caebbe1867aba16129d29791e921f9";
};

# Since 0.10.0 panel attempts to fetch from the web.
# We avoid this:
# - we use node2nix to fetch assets
# - we disable bundling (which also tries to fetch assets)
# Downside of disabling bundling is that in an airgapped environment
# one may miss assets.
# https://github.com/holoviz/panel/issues/1819
preBuild = ''
substituteInPlace setup.py --replace "bundle_resources()" ""
pushd panel
ln -s ${node.nodeDependencies}/lib/node_modules
export PATH="${node.nodeDependencies}/bin:$PATH"
popd
'';

propagatedBuildInputs = [
bokeh
param
Expand All @@ -34,6 +54,10 @@ buildPythonPackage rec {
# infinite recursion in test dependencies (hvplot)
doCheck = false;

passthru = {
inherit node; # For convenience
};

meta = with lib; {
description = "A high level dashboarding library for python visualization libraries";
homepage = "https://pyviz.org";
Expand Down
17 changes: 17 additions & 0 deletions pkgs/development/python-modules/panel/node/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:

let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
Loading

0 comments on commit 4117f54

Please sign in to comment.