-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
python311Packages.scalene: init at 1.5.38 #293107
Conversation
4d84207
to
039f523
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be two commits with appropriate commit messages, one for maintainer and one for the package.
Please also set meta.mainProgram
.
@dotlambda Thank you. I'll squash commits appropriately before this is done. I'm working on switching it to a build from source w/ tests; that's going to take a bit. |
Closes #293086 |
1bb68c2
to
0b64fcf
Compare
@bcdarwin and @dotlambda -- This has everything except a build from github source (as the latter is going to require altering the original's build system it seems.) |
@bcdarwin and @dotlambda it's been a week since my last ping. Can we get this done? |
81d536c
to
2016299
Compare
Pushed update to 1.5.38 (with a Windows bugfix) |
@bcdarwin Hi Ben, are you available to complete the review? |
@dotlambda Hi Robert, are you available to complete the review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary for new reviewers:
Scalene is a high-performance profiler for python that includes cpu, memory, and gpu.
This builds from PyPi-downloaded package.
Addressing the open requests
- The build is entirely from source , not incorporating the binary blobs from the wheel.
meta.sourceProvenance
does not need to be set. - Building from the github source is infeasible due to the structure of setup.py -- it combines C header/source downloads and platform-specific compiles.
- The C headers and sources are included in the installable package so we are able to build from scratch. Only the unit tests are missing.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-already-reviewed/2617/1561 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. need to enable tests but there are a few failures that need to be delt with.
diff to enable tests
diff --git a/pkgs/development/python-modules/scalene/default.nix b/pkgs/development/python-modules/scalene/default.nix
index eb77ed083342..ac2bf8975716 100644
--- a/pkgs/development/python-modules/scalene/default.nix
+++ b/pkgs/development/python-modules/scalene/default.nix
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
+, fetchpatch
, setuptools
, setuptools-scm
, cloudpickle
@@ -10,6 +11,9 @@
, pynvml
, pythonOlder
, rich
+, pytestCheckHook
+, hypothesis
+, numpy
}:
buildPythonPackage rec {
@@ -23,6 +27,15 @@ buildPythonPackage rec {
hash = "sha256-LR1evkn2m6FNBmJnUUJubesxIPeHG6RDgLFBHDuxe38=";
};
+ patches = [
+ # fix scalene_config import. remove on next update
+ (fetchpatch {
+ name = "scalene_config-import-fix.patch";
+ url = "https://github.com/plasma-umass/scalene/commit/cd437be11f600ac0925ce77efa516e6d83934200.patch";
+ hash = "sha256-YjFh+mu5jyIJYUQFhmGqLXhec6lgQAdj4tWxij3NkwU=";
+ })
+ ];
+
nativeBuildInputs = [
cython
setuptools
@@ -37,6 +50,20 @@ buildPythonPackage rec {
rich
];
+ nativeCheckInputs = [
+ pytestCheckHook
+ ];
+
+ checkInputs = [
+ hypothesis
+ numpy
+ ];
+
+ # remove scalene directory to prevent pytest import confusion
+ preCheck = ''
+ rm -rf scalene
+ '';
+
pythonImportsCheck = [ "scalene" ];
meta = with lib; {
@a-n-n-a-l-e-e Thank you! Now, do you have an idea how I can enable or disable tests by platform? The failing tests (for me) are expecting Apple hardware. EDIT: The scalene repo has removed these failing tests. I'll mark them as disabled with a note to remove on the next update. |
the tests seem kind of broken given they are running on linux. i'd just disable them outright and report the issue upstream. disabledTestPaths = [
"tests/test_coverup_35.py"
"tests/test_coverup_42.py"
"tests/test_coverup_43.py"
]; or just specific tests using and to just use a platform can do disabledTests = [ ... ] ++ lib.optionals stdenv.isDarwin [ disabled tests for darwin ]; |
I added
as the failing tests are no longer in the source repo. There are also some test warnings; I'll file a PR against the scalene sources to fix. |
That's all the changes done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. built on x64/aarch64 darwin and x64 linux.
Description of changes
Scalene is a high-performance CPU, GPU and memory profiler for Python that does a number of things that other Python profilers do not and cannot do. It runs orders of magnitude faster than many other profilers while delivering far more detailed information. It is also incorporates AI-powered optimization suggestions.
homepage URL: https://github.com/plasma-umass/scalene
closes #293086
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 馃憤 reaction to pull requests you find important.