Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyterlab 0.31.12 #38566

Merged
merged 4 commits into from Apr 11, 2018
Merged

Jupyterlab 0.31.12 #38566

merged 4 commits into from Apr 11, 2018

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Apr 7, 2018

Motivation for this change

updates and ofborg sanity check

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@zimbatm zimbatm requested a review from FRidh as a code owner April 7, 2018 18:08
@dotlambda
Copy link
Member

Please rebase on staging: https://groups.google.com/forum/#!topic/nix-devel/IA6o_CRI0NY

@zimbatm zimbatm changed the base branch from master to staging April 7, 2018 18:16
@zimbatm
Copy link
Member Author

zimbatm commented Apr 7, 2018

@GrahamcOfBorg build python3Packages.jupyterlab

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python3Packages.jupyterlab

Partial log (click to expand)

patching script interpreter paths in /nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /tmp/nix-build-python3.6-jupyterlab-0.31.12.drv-0 in /nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12...
wrapping `/nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12/bin/jlpm'...
wrapping `/nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12/bin/jupyter-labhub'...
wrapping `/nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12/bin/jupyter-lab'...
wrapping `/nix/store/8inm9adsvgsj649bjs3drcwnx7dzywc9-python3.6-jupyterlab-0.31.12/bin/jupyter-labextension'...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: python3Packages.jupyterlab

Partial log (click to expand)

/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
/nix/store/gpy3r9ss5ngfkib8ylx7jzgahq7m0x5b-patch-shebangs.sh: line 22: warning: command substitution: ignored null byte in input
checking for references to /build in /nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12...
wrapping `/nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12/bin/jupyter-labhub'...
wrapping `/nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12/bin/jupyter-labextension'...
wrapping `/nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12/bin/jupyter-lab'...
wrapping `/nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12/bin/jlpm'...
/nix/store/w1jg8vyv7yn5hwpyymwl9avn6qawm3xl-python3.6-jupyterlab-0.31.12

];

# No tests in archive
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there are tests in jupyterlab/tests. However, it seems like node is required:

Please install nodejs 5+ and npm before continuing.

meta = with lib; {
description = "Jupyter lab environment notebook server extension.";
license = with licenses; [ bsd3 ];
homepage = "http://jupyter.org/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no quotes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no consensus on that in nixpkgs. URL literals get transformed into strings so it doesn't make any practical difference. This is unlike path literals which do have a different type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a strong opinion to get rid of the type and use strings instead, but no such (formal) decision has been made. Would it not make sense to keep using the dedicated type for it until decided otherwise? I mean, if people want this they can open an RFC instead of increasing incoherence in the package set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should have the discussion at some point.

nixpkgs is already incoherent so going one way or another doesn't make much difference for new packages. In either case we can write a script that converts existing packages once the above discussion has been resolved.

meta = with lib; {
description = "This package is used to launch an application built using JupyterLab";
license = with licenses; [ bsd3 ];
homepage = "http://jupyter.org/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no quotes

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: python3Packages.jupyterlab

Partial log (click to expand)

cannot build derivation '/nix/store/ggvp6ww093vzhianqwklp745903n5pvq-python3.6-nbformat-4.4.0.drv': 13 dependencies couldn't be built
cannot build derivation '/nix/store/80c22z9cpzl917ld1g442wk3b7z5yq6m-python3.6-pyOpenSSL-17.5.0.drv': 11 dependencies couldn't be built
cannot build derivation '/nix/store/fwzn24m965c9w8xz682hqnlycalvfgvz-python3.6-ipykernel-4.8.2.drv': 13 dependencies couldn't be built
cannot build derivation '/nix/store/8lyzbxr3vbhc7ilkxaggj8cj1y2mnb9s-python3.6-urllib3-1.22.drv': 12 dependencies couldn't be built
cannot build derivation '/nix/store/mg1d3awm5ybk7qmla8i725da3zhkwcj7-python3.6-nbconvert-5.3.1.drv': 22 dependencies couldn't be built
cannot build derivation '/nix/store/9slg9qzmlc4q7l086c61ahpmiqzs8xzn-python3.6-requests-2.18.4.drv': 12 dependencies couldn't be built
cannot build derivation '/nix/store/k8w68s7cji4amywz64qigcnmbiwfz5aw-python3.6-notebook-5.4.1.drv': 22 dependencies couldn't be built
cannot build derivation '/nix/store/h4r8i1iwvyhxasx5r2174j98l65c55f9-python3.6-jupyterlab_launcher-0.10.5.drv': 10 dependencies couldn't be built
cannot build derivation '/nix/store/rn62f6p5zv35qaj1p8yycmbc3bz36y96-python3.6-jupyterlab-0.31.12.drv': 11 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/rn62f6p5zv35qaj1p8yycmbc3bz36y96-python3.6-jupyterlab-0.31.12.drv' failed

@veprbl
Copy link
Member

veprbl commented Apr 8, 2018

I've tested this on macOS. There was a problem with launching jupyter-lab:

[I 18:51:45.038 LabApp] JupyterLab beta preview extension loaded from /nix/store/9wck59c4s6jnf1hiln23mw57qlvd4wj2-python3.6-jupyterlab-0.31.12/lib/python3.6/site-packages/jupyterlab
[I 18:51:45.038 LabApp] JupyterLab application directory is /nix/store/mxrl6zan6h63cwl62bd91bgaghz2d94y-python3-3.6.4/share/jupyter/lab

It can not determine application directory correctly and that breaks the web GUI. There is also missing (seemingly optional) dependency on nodejs.

Would you mind applying a following fix:

--- a/pkgs/development/python-modules/jupyterlab/default.nix
+++ b/pkgs/development/python-modules/jupyterlab/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, isPy3k, fetchPypi, ipython_genutils, jupyterlab_launcher, notebook }:
+{ lib, buildPythonPackage, isPy3k, fetchPypi, ipython_genutils, jupyterlab_launcher, nodejs, notebook }:
 buildPythonPackage rec {
   pname = "jupyterlab";
   version = "0.31.12";
@@ -12,12 +12,17 @@ buildPythonPackage rec {
   propagatedBuildInputs = [
     ipython_genutils
     jupyterlab_launcher
+    nodejs
     notebook
   ];
 
   # Depends on npm
   doCheck = false;
 
+  makeWrapperArgs = [
+    "--set" "JUPYTERLAB_DIR" "$out/share/jupyter/lab"
+  ];
+
   meta = with lib; {
     description = "Jupyter lab environment notebook server extension.";
     license = with licenses; [ bsd3 ];

Thank you!

@veprbl
Copy link
Member

veprbl commented Apr 9, 2018

Other than that it works very nice!

@FRidh
Copy link
Member

FRidh commented Apr 9, 2018

+  postInstall = ''
+    for prog in "$out"/bin/*; do
+      wrapProgram "$prog" --set JUPYTERLAB_DIR $out/share/jupyter/lab
+    done
+  '';
+

Wrappers are already created by buildPython*. There is a flag for buildPython* to add more things to the wrappers. makeWrapper is also already part of the nativeBuildInputs.

@veprbl
Copy link
Member

veprbl commented Apr 9, 2018

@FRidh
Thank you. I've updated the patch in my original message.

without this option jupyterlab will look into the system python installation directories
@zimbatm
Copy link
Member Author

zimbatm commented Apr 9, 2018

@veprbl thanks for the wrapper. I didn't add nodejs because it breaks the build in sandbox mode:

setting SOURCE_DATE_EPOCH to timestamp 1520372440 of file jupyterlab-0.31.12/PKG-INFO
patching sources
configuring
building
running bdist_wheel
running jsdeps
Installing build dependencies with npm.  This may take a while...
> node /build/jupyterlab-0.31.12/jupyterlab/staging/yarn.js install
yarn install v1.3.2
warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
warning Skipping preferred cache folder "/homeless-shelter/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/build/.yarn-cache-1000".

@FRidh
Copy link
Member

FRidh commented Apr 11, 2018

If I am correct nodejs is only needed for extensions. We could take that part in a different PR.

@FRidh FRidh merged commit e5c1c3b into NixOS:staging Apr 11, 2018
@zimbatm zimbatm deleted the jupyterlab-0.31.12 branch April 12, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants