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

Installing Jupyter #573

Open
TyberiusPrime opened this issue Aug 22, 2023 · 0 comments
Open

Installing Jupyter #573

TyberiusPrime opened this issue Aug 22, 2023 · 0 comments

Comments

@TyberiusPrime
Copy link
Collaborator

These are todays workarounds to get jupyter (6.x) running in mach-nix,
with todays pypi-deps-db.

One of them is a genuine bug that needs tracking down eventually.

May this example flake be of use to somebody.

{
  description = "A very basic flake";
  inputs = {
    mach-nix = {
      url = "/home/finkernagel/upstream/mach-nix2";
    };
    pypi-deps-db = {
      url = "github:DavHau/pypi-deps-db?rev=6a09e5b6a604d76dcb8c5262be78dd6f64c99d33";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.mach-nix.follows = "mach-nix";
    };
    flake-utils = {
      url = "github:numtide/flake-utils?rev=7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19";
    };
  };

  outputs = {
    self,
    nixpkgs,
    mach-nix,
    pypi-deps-db,
    flake-utils,
  }:
    flake-utils.lib.eachDefaultSystem (
      system: let
        pkgs = import nixpkgs {
          inherit system;
          config = {allowUnfree = false;};
        };

        mn = (import mach-nix) {
          inherit pkgs;
          python = "python310";
        };
      in {
        defaultPackage = mn.mkPython {
          # there is a bug somewhere in mach-nix,
          # so that the [format-nongpl] extra on jsonschema
          # coming from jupyter get's ignored.
          # handing it in individually does help.
          requirements = ''
            jupyter>7
            jsonschema[format-nongpl]
          '';
          _.tornado.doCheck = false;
          _.tornado.doInstallCheck = false;
         # python has no file level isolation between packages, apparently.
          _."jupyter-core".postInstall = ''
            rm $out/lib/python*/site-packages/jupyter.py
            rm $out/lib/python*/site-packages/__pycache__/jupyter.cpython*.pyc
          '';
        };
      }
    );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant