Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python311Packages.nireports: init at 23.2.1 #317618

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcdarwin
Copy link
Member

@bcdarwin bcdarwin commented Jun 6, 2024

Description of changes

Add python311Packages.nireports, a package for generating reports on medical image processing pipelines.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Copy link
Contributor

@dani0854 dani0854 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed points
  • package path fits guidelines
  • package name fits guidelines
  • package version fits guidelines
  • package builds on x86_64-linux
  • meta.description is set and fits guidelines
  • meta.license fits upstream license
  • meta.maintainers is set
  • source is fetched using the appropriate function

pkgs/development/python-modules/nireports/default.nix Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests on python311 fail 50% of the time, while creating different tmp files. Looks like they don't work asynchronously. Specifically test_reportlets.py while importing templateflow on line 34. I have NIX_BUILD_CORE = 8.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabled this test.

@dani0854
Copy link
Contributor

dani0854 commented Jul 3, 2024

Also, python312 won't build due to nose dependency, #322103 should fix this.

@bcdarwin bcdarwin force-pushed the init-python3-nireports branch from 20e81af to 959c312 Compare July 4, 2024 01:36
@bcdarwin bcdarwin requested a review from natsukium as a code owner July 4, 2024 01:36
@bcdarwin bcdarwin requested a review from dani0854 July 4, 2024 01:37
"test_cifti_surfaces_plot"
"test_mriqc_plot_mosaic"
# fails when run under pytest-xdist
"test_reportlets.py"
Copy link
Contributor

@dani0854 dani0854 Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't disable the test, it still being run. I think to disable all tests in a file you have to use disabledTestPaths and specify path from repo root.

Another way this problem can be solved, is by forcing pytest-xdist to run things synchronously. Since there aren't that many tests, and they are quick, distribution is not that important. And running more test is a good thing.
I think number of processes is set by this hook:
https://github.com/NixOS/nixpkgs/blob/2d7a6fdc142af32d68d669658199926053b20d57/pkgs/development/python-modules/pytest-xdist/setup-hook.sh#L1C1-L5C2

However, specifying whole file in disabledTestPaths is fine.

Copy link
Contributor

@dani0854 dani0854 Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played around with flags and options.
Turns out that if you want to run it on 1 worker, you have to both disable the hook using dontUsePytestXdist = true;, since it will append --numprocesses=$NIX_BUILD_CORES overriding the one in pytestFlagsArray.
And add a flag --numprocesses=1 to pytestFlagsArray, to override -n auto which is specified in their pyproject.toml (I think).

If only one them set, test still run on amount of cores in /etc/nix/nix.conf.
When using only 1 core, it took 89 seconds for me, so not too long.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jul 7, 2024
@FliegendeWurst FliegendeWurst added the awaiting_changes (old Marvin label, do not use) label Dec 2, 2024
@SigmaSquadron SigmaSquadron removed the awaiting_changes (old Marvin label, do not use) label Jan 5, 2025
@FliegendeWurst FliegendeWurst added the 2.status: needs-changes This PR needs changes by the author label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: needs-changes This PR needs changes by the author 6.topic: python 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants