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

python3Packages.spleeter: init at 2.2.2 #133039

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

risicle
Copy link
Contributor

@risicle risicle commented Aug 7, 2021

Motivation for this change

A tensorflow-based audio source separation tool. I've got fairly decent results with it.

The only downside is that it's designed to pull its models down from github on-demand, which means they could be vulnerable to disappearance and it could be unhelpful if a user doesn't have great network access when they need it.

It might be nice to be able to include some of the models along with the package, however:

  • they're big (hundreds of megs) and this would bloat the package and unnecessarily add to the strain on cache.nixos.org.
  • there isn't any means to do this in the code. I'd have to do some hacking to get it to do this (without breaking the downloading functionality by giving it a readonly models directory), and upstream is very quiet meaning it would probably be our patch forever.

Note that this does actually download the smallest of the available models, but only as a build-time dependency for the tests.

Includes packaging of dependency norbert and also added as an application using toPythonApplication.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.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.

cc @magnetophon through interest in audio tools.

@risicle
Copy link
Contributor Author

risicle commented Aug 7, 2021

And now dependency typer is broken 🙄. Guess this will have to wait on #129479.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Aug 7, 2021
propagatedBuildInputs = [ scipy ];

checkInputs = [ pytestCheckHook ];
preCheck = ''
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
preCheck = ''
postPatch = ''

Comment on lines +85 to +89
meta = {
homepage = "https://github.com/deezer/spleeter";
description = "Audio source separation library including pretrained models";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ris ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
meta = {
homepage = "https://github.com/deezer/spleeter";
description = "Audio source separation library including pretrained models";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ris ];
meta = with lib; {
homepage = "https://github.com/deezer/spleeter";
description = "Audio source separation library including pretrained models";
license = licenses.mit;
maintainers = with maintainers; [ ris ];

@stale
Copy link

stale bot commented Apr 19, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 19, 2022
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@LennyPenny
Copy link
Contributor

LennyPenny commented Nov 7, 2024

I rebased this on master here: https://github.com/LennyPenny/nixpkgs/tree/lenny-spleeter

I then went ahead and cherry-picked the commits to nixpkgs-unstable to get more cache hits and tried building it.

 > INTERNALERROR>   File "/nix/store/vrkr01fqh2ifydwasf5yl1bd3n62k9b4-python3.11-pytest-forked-1.6.0/lib/python3.11/site-packages/pytest_forked/__init__.py", line 51, in pytest_runtest_protocol
   > INTERNALERROR>     reports = forked_run_report(item)
   > INTERNALERROR>               ^^^^^^^^^^^^^^^^^^^^^^^
   > INTERNALERROR>   File "/nix/store/vrkr01fqh2ifydwasf5yl1bd3n62k9b4-python3.11-pytest-forked-1.6.0/lib/python3.11/site-packages/pytest_forked/__init__.py", line 73, in forked_run_report
   > INTERNALERROR>     ff = py.process.ForkedFunc(runforked)
   > INTERNALERROR>          ^^^^^^^^^^
   > INTERNALERROR> AttributeError: module 'py' has no attribute 'process'
   >
   > ============================ 28 deselected in 4.08s ============================
   > /nix/store/d3dzfy4amjl826fb8j00qp1d9887h7hm-stdenv-linux/setup: line 1579: pop_var_context: head of shell_variables not a function context
   For full logs, run 'nix log /nix/store/5zcvfl6z85n66zwnn30gif9j3rgzh6fh-python3.11-spleeter-2.2.2.drv'.

Is what I'm getting. This comment mentions manually installing py solving the issue, I have not yet figured out how to add that to the derivation.

@risicle are you still interested in pursuing this? Otherwise, I'm happy to reach out to the python packaging matrix and get some help in fixing this.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 7, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants