diff --git a/pkgs/development/python-modules/cwsandbox/default.nix b/pkgs/development/python-modules/cwsandbox/default.nix new file mode 100644 index 000000000000..33f1ddd727c6 --- /dev/null +++ b/pkgs/development/python-modules/cwsandbox/default.nix @@ -0,0 +1,77 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatchling, + + # dependencies + googleapis-common-protos, + grpcio, + protobuf, + + # optional-dependencies + click, + + # tests + pytest-asyncio, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "cwsandbox"; + version = "0.23.0"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "coreweave"; + repo = "cwsandbox-client"; + tag = "v${finalAttrs.version}"; + hash = "sha256-y9rsuAXmpMok0ZqdLhAfavglXh5Hz4VPy1UByYMM1WA="; + }; + + build-system = [ + hatchling + ]; + + pythonRelaxDeps = [ + "protobuf" + ]; + dependencies = [ + googleapis-common-protos + grpcio + protobuf + ]; + + optional-dependencies = { + cli = [ + click + ]; + }; + + pythonImportsCheck = [ "cwsandbox" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ] + ++ finalAttrs.passthru.optional-dependencies.cli; + + disabledTests = [ + # Failed: DID NOT RAISE any of (, ) + "test_stop_while_waiting" + ]; + + meta = { + description = "Python client library for CoreWeave Sandbox"; + homepage = "https://github.com/coreweave/cwsandbox-client"; + changelog = "https://github.com/coreweave/cwsandbox-client/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = with lib.licenses; [ + asl20 + bsd3 + ]; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index 2bbc8c5923ec..5882f46164d6 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -43,6 +43,7 @@ bokeh, boto3, cloudpickle, + cwsandbox, flask, google-cloud-artifact-registry, google-cloud-compute, @@ -75,12 +76,12 @@ }: let - version = "0.26.1"; + version = "0.27.0"; src = fetchFromGitHub { owner = "wandb"; repo = "wandb"; tag = "v${version}"; - hash = "sha256-QtMjiRqE9ZhA1S8gHt1F8NBXTq7QQ3ENhk02Lry80F4="; + hash = "sha256-A/tEyY47BDgahOhQWlmeF2koEDpIsV9QVoYMIBEbKqA="; }; wandb-xpu = rustPlatform.buildRustPackage { @@ -90,7 +91,7 @@ let sourceRoot = "${src.name}/xpu"; - cargoHash = "sha256-RPvtMV9Mrzb6lJhMR+fi58h/ncvbNkbIjAP35sdaOO0="; + cargoHash = "sha256-vB0LZjfnf//U1BXCzvaQBjlXLlGx/4g+emSZWcS+oGU="; checkFlags = [ # fails in sandbox @@ -120,13 +121,15 @@ let sourceRoot = "${src.name}/parquet-rust-wrapper"; - cargoHash = "sha256-w98wliTcVJr4IlmKFVU+glmawMJl5qVCSUSJ8LeceJ8="; + cargoHash = "sha256-BkeSRbZoehYGHj15KcInugRBvOLXJlh1NqTHhRnNOK8="; # The original build script renames the library: # https://github.com/wandb/wandb/blob/v0.26.0/parquet-rust-wrapper/build.sh#L37-L68 postInstall = '' mv $out/lib/libarrow_rs_wrapper${sharedLibrary} $out/lib/${libRustParquet} ''; + + __darwinAllowLocalNetworking = true; }; wandb-core = buildGoModule { @@ -136,8 +139,15 @@ let sourceRoot = "${src.name}/core"; postPatch = - # hardcode the `wandb-xpu` binary path. + # Relax the Go toolchain requirement; nixpkgs ships 1.26.2. '' + substituteInPlace go.mod \ + --replace-fail \ + "go 1.26.3" \ + "go 1.26.2" + '' + # hardcode the `wandb-xpu` binary path. + + '' substituteInPlace internal/monitor/xpuresourcemanager.go \ --replace-fail \ 'cmdPath, err := getXPUCmdPath()' \ @@ -250,6 +260,7 @@ buildPythonPackage (finalAttrs: { bokeh boto3 cloudpickle + cwsandbox flask google-cloud-artifact-registry google-cloud-compute diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1b0154130a67..725d9fc87a4f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3476,6 +3476,8 @@ self: super: with self; { cwlformat = callPackage ../development/python-modules/cwlformat { }; + cwsandbox = callPackage ../development/python-modules/cwsandbox { }; + cx-freeze = callPackage ../development/python-modules/cx-freeze { }; cx-logging = callPackage ../development/python-modules/cx-logging { };