diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index ef48cfe56e18..d79361ccbb7c 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -15,14 +15,13 @@ ## wandb buildPythonPackage, - replaceVars, # build-system hatchling, # dependencies click, - gitpython, + packaging, platformdirs, protobuf, pydantic, @@ -30,14 +29,12 @@ requests, sentry-sdk, setproctitle, - setuptools, pythonOlder, typing-extensions, # tests - pytestCheckHook, - azure-core, azure-containerregistry, + azure-core, azure-identity, azure-storage-blob, bokeh, @@ -54,6 +51,7 @@ kubernetes-asyncio, looptime, matplotlib, + moto, moviepy, pandas, parameterized, @@ -66,6 +64,7 @@ pytest-mock, pytest-timeout, pytest-xdist, + pytestCheckHook, rdkit, responses, scikit-learn, @@ -77,12 +76,12 @@ }: let - version = "0.28.0"; + version = "0.28.1"; src = fetchFromGitHub { owner = "wandb"; repo = "wandb"; tag = "v${version}"; - hash = "sha256-YdM/LrrWQFup/1Fkv49//eOFfYFCRgpuuH7+DZIOT1M="; + hash = "sha256-yXsSHyPOh3QXRRkTL4Rj8lLuFjp1LIKfPiacy4+obAk="; }; wandb-xpu = rustPlatform.buildRustPackage { @@ -198,13 +197,6 @@ buildPythonPackage (finalAttrs: { inherit src version; - patches = [ - # Replace git paths - (replaceVars ./hardcode-git-path.patch { - git = lib.getExe gitMinimal; - }) - ]; - postPatch = # Prevent hatch from building wandb-core and arrow-rs-wrapper '' @@ -218,6 +210,13 @@ buildPythonPackage (finalAttrs: { --replace-fail \ 'bin_path = pathlib.Path(__file__).parent / "bin" / "wandb-core"' \ 'bin_path = pathlib.Path("${lib.getExe wandb-core}")' + '' + # Hard-code the path to git in the python code + + '' + substituteInPlace wandb/cli/cli.py \ + --replace-fail \ + '["git", "apply",' \ + '["${lib.getExe gitMinimal}", "apply",' \ ''; env = { @@ -235,7 +234,7 @@ buildPythonPackage (finalAttrs: { dependencies = [ click - gitpython + packaging platformdirs protobuf pydantic @@ -243,8 +242,6 @@ buildPythonPackage (finalAttrs: { requests sentry-sdk setproctitle - # setuptools is necessary since pkg_resources is required at runtime. - setuptools ] ++ lib.optionals (pythonOlder "3.12") [ typing-extensions @@ -253,9 +250,8 @@ buildPythonPackage (finalAttrs: { __darwinAllowLocalNetworking = true; nativeCheckInputs = [ - pytestCheckHook - azure-core azure-containerregistry + azure-core azure-identity azure-storage-blob bokeh @@ -263,6 +259,7 @@ buildPythonPackage (finalAttrs: { cloudpickle cwsandbox flask + gitMinimal google-cloud-artifact-registry google-cloud-compute google-cloud-storage @@ -272,6 +269,7 @@ buildPythonPackage (finalAttrs: { kubernetes-asyncio looptime matplotlib + moto moviepy pandas parameterized @@ -284,11 +282,13 @@ buildPythonPackage (finalAttrs: { pytest-mock pytest-timeout pytest-xdist + pytestCheckHook rdkit responses scikit-learn soundfile tenacity + versionCheckHook torch torchvision tqdm @@ -448,6 +448,7 @@ buildPythonPackage (finalAttrs: { changelog = "https://github.com/wandb/wandb/blob/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ samuela ]; + mainProgram = "wandb"; broken = wandb-xpu.meta.broken || wandb-core.meta.broken; }; }) diff --git a/pkgs/development/python-modules/wandb/hardcode-git-path.patch b/pkgs/development/python-modules/wandb/hardcode-git-path.patch deleted file mode 100644 index cf1fb4e0d48c..000000000000 --- a/pkgs/development/python-modules/wandb/hardcode-git-path.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/tests/unit_tests/test_wandb_settings.py b/tests/unit_tests/test_wandb_settings.py -index 4089d0719..694715290 100644 ---- a/tests/unit_tests/test_wandb_settings.py -+++ b/tests/unit_tests/test_wandb_settings.py -@@ -698,7 +698,7 @@ def test_reports_invalid_system_settings( - def test_infer_git_root_finds_repo(tmp_path): - git_root = tmp_path / "repo" - git_root.mkdir() -- subprocess.run(["git", "init", str(git_root)], check=True, capture_output=True) -+ subprocess.run(["@git@", "init", str(git_root)], check=True, capture_output=True) - subdir = git_root / "subdir" - subdir.mkdir() - -@@ -718,7 +718,7 @@ def test_infer_git_root_no_repo(tmp_path): - def test_infer_git_root_skips_if_already_set(tmp_path): - git_root = tmp_path / "repo" - git_root.mkdir() -- subprocess.run(["git", "init", str(git_root)], check=True, capture_output=True) -+ subprocess.run(["@git@", "init", str(git_root)], check=True, capture_output=True) - - preset = "/some/other/path" - s = Settings(root_dir=str(git_root), git_root=preset) -@@ -730,7 +730,7 @@ def test_infer_git_root_skips_if_already_set(tmp_path): - def test_infer_git_root_skips_if_disable_git(tmp_path): - git_root = tmp_path / "repo" - git_root.mkdir() -- subprocess.run(["git", "init", str(git_root)], check=True, capture_output=True) -+ subprocess.run(["@git@", "init", str(git_root)], check=True, capture_output=True) - - s = Settings(root_dir=str(git_root), disable_git=True) - s.infer_git_root() -diff --git a/wandb/cli/cli.py b/wandb/cli/cli.py -index 0ec7996cc..973b10643 100644 ---- a/wandb/cli/cli.py -+++ b/wandb/cli/cli.py -@@ -3265,7 +3265,7 @@ def restore(ctx, run, no_git, branch, project, entity): - commit, json_config, patch_content, metadata = api.run_config( - project, run=run, entity=entity - ) -- repo = metadata.get("git", {}).get("repo") -+ repo = metadata.get("@git@", {}).get("repo") - image = metadata.get("docker") - restore_message = f"""`wandb restore` needs to be run from the same git repository as the original run. - Run `git clone {repo}` and restore from there or pass the --no-git flag.""" -@@ -3284,7 +3284,7 @@ Run `git clone {repo}` and restore from there or pass the --no-git flag.""" - - if commit and git.enabled: - wandb.termlog(f"Fetching origin and finding commit: {commit}") -- subprocess.check_call(["git", "fetch", "--all"]) -+ subprocess.check_call(["@git@", "fetch", "--all"]) - try: - git.repo.commit(commit) - except ValueError: -@@ -3337,7 +3337,7 @@ Run `git clone {repo}` and restore from there or pass the --no-git flag.""" - # --reject is necessary or else this fails any time a binary file - # occurs in the diff - exit_code = subprocess.call( -- ["git", "apply", "--reject", patch_rel_path], cwd=root -+ ["@git@", "apply", "--reject", patch_rel_path], cwd=root - ) - if exit_code == 0: - wandb.termlog("Applied patch")