diff --git a/pkgs/development/python-modules/argostranslate/default.nix b/pkgs/development/python-modules/argostranslate/default.nix index 0edd7661d687..77a29a1f659d 100644 --- a/pkgs/development/python-modules/argostranslate/default.nix +++ b/pkgs/development/python-modules/argostranslate/default.nix @@ -1,9 +1,12 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, + # build-system setuptools, + # dependencies ctranslate2, ctranslate2-cpp, @@ -12,6 +15,7 @@ sentencepiece, spacy, stanza, + # tests pytestCheckHook, writableTmpDirAsHomeHook, @@ -24,6 +28,9 @@ let withOpenblas = false; }; }; + + inherit (stdenv.hostPlatform) isDarwin isLinux isAarch64; + isAarch64Linux = isLinux && isAarch64; in buildPythonPackage (finalAttrs: { pname = "argostranslate"; @@ -39,6 +46,9 @@ buildPythonPackage (finalAttrs: { build-system = [ setuptools ]; + pythonRelaxDeps = [ + "stanza" + ]; dependencies = [ ctranslate2OneDNN minisbd @@ -53,14 +63,13 @@ buildPythonPackage (finalAttrs: { writableTmpDirAsHomeHook ]; - pythonRelaxDeps = [ - "stanza" - ]; - - pythonImportsCheck = [ + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optionals (!isAarch64Linux) [ "argostranslate" "argostranslate.translate" ]; + doCheck = !isAarch64Linux; meta = { description = "Open-source offline translation library written in Python"; diff --git a/pkgs/development/python-modules/confection/default.nix b/pkgs/development/python-modules/confection/default.nix index 14dc49f4b260..b1d01a453869 100644 --- a/pkgs/development/python-modules/confection/default.nix +++ b/pkgs/development/python-modules/confection/default.nix @@ -19,14 +19,14 @@ buildPythonPackage (finalAttrs: { pname = "confection"; - version = "1.2.2"; + version = "1.3.2"; pyproject = true; src = fetchFromGitHub { owner = "explosion"; repo = "confection"; tag = "release-v${finalAttrs.version}"; - hash = "sha256-C7TAfr7Xq4C+JJI7/XWX1mTf2IvvOQT+q/nnGojhbFU="; + hash = "sha256-14e2aOE9HyqrLE6i8ljA81pi7PYdQL+AReo/HPzOwck="; }; build-system = [ diff --git a/pkgs/development/python-modules/minisbd/default.nix b/pkgs/development/python-modules/minisbd/default.nix index da486a37d448..1c2495777ba6 100644 --- a/pkgs/development/python-modules/minisbd/default.nix +++ b/pkgs/development/python-modules/minisbd/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, # build-system @@ -29,9 +30,11 @@ buildPythonPackage (finalAttrs: { onnxruntime ]; - pythonImportsCheck = [ - "minisbd" - ]; + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox: + # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException' + pythonImportsCheck = lib.optionals ( + !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) + ) [ "minisbd" ]; meta = { description = "Free and open source library for fast sentence boundary detection"; diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix index 41fb2a9ecf06..c54b938fabd3 100644 --- a/pkgs/development/python-modules/spacy/default.nix +++ b/pkgs/development/python-modules/spacy/default.nix @@ -47,21 +47,16 @@ buildPythonPackage (finalAttrs: { pname = "spacy"; - version = "3.8.11"; + version = "3.8.13"; pyproject = true; src = fetchFromGitHub { owner = "explosion"; repo = "spaCy"; tag = "release-v${finalAttrs.version}"; - hash = "sha256-pLn3fq6SDstkRIv+1fj1yEGTlAd1IAiVgRu25CnEV8E="; + hash = "sha256-mjl4s3uUEdwPTvyq5HGDtxxREdnHAmUU8IpN/7+YxTc="; }; - postPatch = '' - substituteInPlace requirements.txt setup.cfg \ - --replace-fail typer-slim typer - ''; - build-system = [ cymem cython @@ -123,6 +118,10 @@ buildPythonPackage (finalAttrs: { # Tests for presence of outdated (and thus missing) spacy models # https://github.com/explosion/spaCy/issues/13856 "test_registry_entries" + + # AssertionError: confection has different version in setup.cfg and in requirements.txt: + # >=1.3.2,<2.0.0 and >=1.1.0,<2.0.0 respectively + "test_build_dependencies" ]; pythonImportsCheck = [ "spacy" ]; diff --git a/pkgs/development/python-modules/srsly/default.nix b/pkgs/development/python-modules/srsly/default.nix index 429ce5dff2f6..72aeeff6e996 100644 --- a/pkgs/development/python-modules/srsly/default.nix +++ b/pkgs/development/python-modules/srsly/default.nix @@ -1,26 +1,34 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system cython, + setuptools, + + # dependencies catalogue, + + # tests mock, numpy, psutil, pytest, ruamel-yaml, - setuptools, tornado, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "srsly"; - version = "2.5.2"; + version = "2.5.3"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-QJK8hDxxt1lcbJCgMCoZeFjFuf5DBn9irmpFvDuqHBk="; + src = fetchFromGitHub { + owner = "explosion"; + repo = "srsly"; + tag = "release-v${finalAttrs.version}"; + hash = "sha256-dZuw0+tNIMseznGBQwIS6uICZEozkBWzF7FMQIo0Tbo="; }; build-system = [ @@ -42,9 +50,9 @@ buildPythonPackage rec { pythonImportsCheck = [ "srsly" ]; meta = { - changelog = "https://github.com/explosion/srsly/releases/tag/v${version}"; description = "Modern high-performance serialization utilities for Python"; homepage = "https://github.com/explosion/srsly"; + changelog = "https://github.com/explosion/srsly/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; }; -} +}) diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index df12a0c3af7f..087bd114b1a4 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -16,6 +16,7 @@ ## wandb buildPythonPackage, replaceVars, + fetchpatch, # build-system hatchling, @@ -75,12 +76,12 @@ }: let - version = "0.25.0"; + version = "0.25.1"; src = fetchFromGitHub { owner = "wandb"; repo = "wandb"; tag = "v${version}"; - hash = "sha256-ouJHMPcWiHn2p0mFatmC28xUmjzxsoDW9WBX6FzjyDc="; + hash = "sha256-jrHj+dNW/eUMcqT5XJbiAz1tlviVBhdtroJ8dA7GBr4="; }; gpu-stats = rustPlatform.buildRustPackage { @@ -107,7 +108,7 @@ let }; }; - wandb-core = buildGoModule rec { + wandb-core = buildGoModule { pname = "wandb-core"; inherit src version; @@ -162,6 +163,13 @@ buildPythonPackage (finalAttrs: { (replaceVars ./hardcode-git-path.patch { git = lib.getExe gitMinimal; }) + + # https://github.com/wandb/wandb/pull/11552 + (fetchpatch { + name = "add-protobuf-7-compatibility"; + url = "https://github.com/wandb/wandb/commit/4ef09f3dd1ee408eb9194ea8b7feea2b1128839c.patch"; + hash = "sha256-6weMJI51cWXz2mCxOGWYGrh0QCxtMGqz6HAVRF5b1xs="; + }) ]; postPatch = diff --git a/pkgs/development/python-modules/wandb/hardcode-git-path.patch b/pkgs/development/python-modules/wandb/hardcode-git-path.patch index bb9a5fb6cafc..9ebfb4d21ea0 100644 --- a/pkgs/development/python-modules/wandb/hardcode-git-path.patch +++ b/pkgs/development/python-modules/wandb/hardcode-git-path.patch @@ -1,39 +1,26 @@ -diff --git a/landfill/functional_tests/kfp/wandb_probe.py b/landfill/functional_tests/kfp/wandb_probe.py -index 86b18a438..23e237e3b 100644 ---- a/landfill/functional_tests/kfp/wandb_probe.py -+++ b/landfill/functional_tests/kfp/wandb_probe.py -@@ -5,7 +5,7 @@ import subprocess - def wandb_probe_package(): - if not os.environ.get("WB_PROBE_PACKAGE"): - return -- s, o = subprocess.getstatusoutput("git rev-parse HEAD") -+ s, o = subprocess.getstatusoutput("@git@ rev-parse HEAD") - if s: - return - wandb_local = f"git+https://github.com/wandb/wandb.git@{o}#egg=wandb" diff --git a/wandb/cli/cli.py b/wandb/cli/cli.py -index 1453100cc..9dc468201 100644 +index a87b17c96..21c851992 100644 --- a/wandb/cli/cli.py +++ b/wandb/cli/cli.py -@@ -2531,7 +2531,7 @@ def restore(ctx, run, no_git, branch, project, entity): +@@ -2672,7 +2672,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 = """`wandb restore` needs to be run from the same git repository as the original run. - Run `git clone {}` and restore from there or pass the --no-git flag.""".format(repo) -@@ -2547,7 +2547,7 @@ Run `git clone {}` and restore from there or pass the --no-git flag.""".format(r + 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.""" +@@ -2691,7 +2691,7 @@ Run `git clone {repo}` and restore from there or pass the --no-git flag.""" - if commit and api.git.enabled: + 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: - api.git.repo.commit(commit) + git.repo.commit(commit) except ValueError: -@@ -2604,7 +2604,7 @@ Run `git clone {}` and restore from there or pass the --no-git flag.""".format(r +@@ -2744,7 +2744,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( diff --git a/pkgs/development/python-modules/weasel/default.nix b/pkgs/development/python-modules/weasel/default.nix index 08ec267adb12..196a3982cf64 100644 --- a/pkgs/development/python-modules/weasel/default.nix +++ b/pkgs/development/python-modules/weasel/default.nix @@ -59,6 +59,11 @@ buildPythonPackage (finalAttrs: { "test_project_assets" "test_project_git_dir_asset" "test_project_git_file_asset" + + # configparser.InterpolationMissingOptionError: Bad value substitution: option 'commands' in + # section 'project' contains an interpolation key 'vars.b.e' which is not a valid option name. + # Raw value: '[{"name": "x", "script": ["hello ${vars.a} ${vars.b.e}"]}]' + "test_project_config_interpolation" ]; passthru = {