Unverified Commit 9a7f31ff authored by natsukium's avatar natsukium
Browse files

python312Packages.jupyter-collaboration: 2.1.4 -> 3.0.0

parent 627c69be
Loading
Loading
Loading
Loading
+13 −44
Original line number Diff line number Diff line
@@ -4,73 +4,42 @@
  fetchPypi,

  # build-system
  hatch-jupyter-builder,
  hatch-nodejs-version,
  hatchling,
  jupyterlab,

  # dependencies
  jsonschema,
  jupyter-events,
  jupyter-server,
  jupyter-server-fileid,
  jupyter-ydoc,
  pycrdt,
  pycrdt-websocket,
  jupyter-collaboration-ui,
  jupyter-docprovider,
  jupyter-server-ydoc,

  # tests
  pytest-jupyter,
  pytestCheckHook,
  websockets,
  callPackage,
}:

buildPythonPackage rec {
  pname = "jupyter-collaboration";
  version = "2.1.4";
  version = "3.0.0";
  pyproject = true;

  src = fetchPypi {
    pname = "jupyter_collaboration";
    inherit version;
    hash = "sha256-YT3wrTQ8imuTK8zeJbwscHtawtqspf1oItGzMMfg5io=";
    hash = "sha256-eewAsh/EI8DV4FNWgjEhT61RUbaYE6suOAny4bf1CCw=";
  };

  postPatch = ''
    sed -i "/^timeout/d" pyproject.toml
  '';

  build-system = [
    hatch-jupyter-builder
    hatch-nodejs-version
    hatchling
    jupyterlab
  ];
  build-system = [ hatchling ];

  dependencies = [
    jsonschema
    jupyter-events
    jupyter-server
    jupyter-server-fileid
    jupyter-ydoc
    pycrdt
    pycrdt-websocket
  ];

  nativeCheckInputs = [
    pytest-jupyter
    pytestCheckHook
    websockets
    jupyter-collaboration-ui
    jupyter-docprovider
    jupyter-server-ydoc
  ];

  pythonImportsCheck = [ "jupyter_collaboration" ];

  preCheck = ''
    export HOME=$TEMP
  '';

  pytestFlagsArray = [ "-Wignore::DeprecationWarning" ];
  # no tests
  doCheck = false;

  __darwinAllowLocalNetworking = true;
  passthru.tests = callPackage ./test.nix { };

  meta = {
    description = "JupyterLab Extension enabling Real-Time Collaboration";
+39 −0
Original line number Diff line number Diff line
{
  stdenvNoCC,
  fetchFromGitHub,
  jupyter-collaboration,
  pytest-jupyter,
  pytestCheckHook,
  websockets,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "jupyter-collaboration-test";
  inherit (jupyter-collaboration) version;

  src = fetchFromGitHub {
    owner = "jupyterlab";
    repo = "jupyter-collaboration";
    rev = "refs/tags/v${finalAttrs.version}";
    hash = "sha256-6hDYB1uC0WraB37s9EKLJF7jyFu0B3xLocuLYyKj4hs=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "timeout = 300" ""
  '';

  installPhase = ''
    touch $out
  '';

  env.HOME = "$TMPDIR";

  doCheck = true;

  nativeCheckInputs = [
    jupyter-collaboration
    pytest-jupyter
    pytestCheckHook
    websockets
  ];
})