python3Packages.dedupe-pylbfgs: fix tests - #519894
Conversation
|
daniel-fahey
left a comment
There was a problem hiding this comment.
Thanks for getting to the bottom of this! Just one nit: I prefer to use fetchpatch2 instead of vendoring patch files (https://wiki.nixos.org/wiki/Nixpkgs/Patching_Nixpkgs)
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchFromGitHub, |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| }; | ||
|
|
||
| patches = [ | ||
| ./tests-numpy-2.4.patch # https://github.com/dedupeio/pylbfgs/pull/52 |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| diff --git a/tests/test_lbfgs.py b/tests/test_lbfgs.py | ||
| index 1af91ef..65e2da9 100644 | ||
| --- a/tests/test_lbfgs.py | ||
| +++ b/tests/test_lbfgs.py | ||
| @@ -28,16 +28,16 @@ class TestOWLQN: | ||
|
|
||
| def test_owl_line_search_default(self): | ||
| def f(x, g, *args): | ||
| - g[0] = 2 * x | ||
| - return x ** 2 | ||
| + g[0] = 2 * x[0] | ||
| + return x[0] ** 2 | ||
|
|
||
| with pytest.warns(UserWarning, match="OWL-QN"): | ||
| xmin = fmin_lbfgs(f, 100., orthantwise_c=1) | ||
|
|
||
| def test_owl_line_search_warning_explicit(self): | ||
| def f(x, g, *args): | ||
| - g[0] = 2 * x | ||
| - return x ** 2 | ||
| + g[0] = 2 * x[0] | ||
| + return x[0] ** 2 | ||
|
|
||
| with pytest.warns(UserWarning, match="OWL-QN"): | ||
| xmin = fmin_lbfgs(f, 100., orthantwise_c=1, line_search='default') |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
|
@daniel-fahey gotcha; for some reason I thought |
|
You might want to add e.g. |
Yeah, I'd also say it's especially useful since it's not been merged yet, I find it a lot easier to replace one url, get a new hash, than carefully fiddle around with patch files. |
|
OK makes sense! I'll swap it out once I'm back at my desk in a couple hours. |
Good, because after double checking the documentation I think you were right not to use Lines 637 to 638 in 8b02b33 I'm "reasonably sure that the used URL is stable", but you've done it by the book, I withdraw my nit. |
|
Oh OK! I'll leave this PR as-is, then. |
SkohTV
left a comment
There was a problem hiding this comment.
nixpkgs-review result for #519894
Generated using nixpkgs-review-gha
Command: nixpkgs-review pr 519894
Commit: c2a9b1d1895e1ce781a168c017a6949e7987e589 (subsequent changes)
Merge: 5d7d954eec1071c63cfdf9877638fb7d14086f26
Logs: https://github.com/SkohTV/nixpkgs-review-gha/actions/runs/25919509522
x86_64-linux
✅ 16 packages built:
- python313Packages.dedupe
- python313Packages.dedupe-pylbfgs
- python313Packages.dedupe-pylbfgs.dist
- python313Packages.dedupe.dist
- python313Packages.highered
- python313Packages.highered.dist
- python313Packages.pyhacrf-datamade
- python313Packages.pyhacrf-datamade.dist
- python314Packages.dedupe
- python314Packages.dedupe-pylbfgs
- python314Packages.dedupe-pylbfgs.dist
- python314Packages.dedupe.dist
- python314Packages.highered
- python314Packages.highered.dist
- python314Packages.pyhacrf-datamade
- python314Packages.pyhacrf-datamade.dist
aarch64-linux
✅ 16 packages built:
- python313Packages.dedupe
- python313Packages.dedupe-pylbfgs
- python313Packages.dedupe-pylbfgs.dist
- python313Packages.dedupe.dist
- python313Packages.highered
- python313Packages.highered.dist
- python313Packages.pyhacrf-datamade
- python313Packages.pyhacrf-datamade.dist
- python314Packages.dedupe
- python314Packages.dedupe-pylbfgs
- python314Packages.dedupe-pylbfgs.dist
- python314Packages.dedupe.dist
- python314Packages.highered
- python314Packages.highered.dist
- python314Packages.pyhacrf-datamade
- python314Packages.pyhacrf-datamade.dist
x86_64-darwin (sandbox = relaxed)
✅ 16 packages built:
- python313Packages.dedupe
- python313Packages.dedupe-pylbfgs
- python313Packages.dedupe-pylbfgs.dist
- python313Packages.dedupe.dist
- python313Packages.highered
- python313Packages.highered.dist
- python313Packages.pyhacrf-datamade
- python313Packages.pyhacrf-datamade.dist
- python314Packages.dedupe
- python314Packages.dedupe-pylbfgs
- python314Packages.dedupe-pylbfgs.dist
- python314Packages.dedupe.dist
- python314Packages.highered
- python314Packages.highered.dist
- python314Packages.pyhacrf-datamade
- python314Packages.pyhacrf-datamade.dist
aarch64-darwin (sandbox = relaxed)
✅ 16 packages built:
- python313Packages.dedupe
- python313Packages.dedupe-pylbfgs
- python313Packages.dedupe-pylbfgs.dist
- python313Packages.dedupe.dist
- python313Packages.highered
- python313Packages.highered.dist
- python313Packages.pyhacrf-datamade
- python313Packages.pyhacrf-datamade.dist
- python314Packages.dedupe
- python314Packages.dedupe-pylbfgs
- python314Packages.dedupe-pylbfgs.dist
- python314Packages.dedupe.dist
- python314Packages.highered
- python314Packages.highered.dist
- python314Packages.pyhacrf-datamade
- python314Packages.pyhacrf-datamade.dist
Assisted-by: Codex:gpt-5.5
c2a9b1d to
bf36349
Compare
This package got broken by #488406 bumping NumPy from 2.3 to 2.4; see dedupeio/pylbfgs#52.
Disclosure: this patch was written by GPT-5.5 via Codex.
ZHF: #516381
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.