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

mps-youtube: 0.2.8 -> unstable-2020-01-28 #80269

Merged
merged 1 commit into from Feb 20, 2020
Merged

Conversation

k0ral
Copy link
Contributor

@k0ral k0ral commented Feb 16, 2020

Motivation for this change

mps-youtube-0.2.8 is no longer compatible with the version of mpv included in nixpkgs (cf this issue).
There haven't been any mps-youtube release since then, so the only way to fix it is to point at a git revision.

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 pkgs 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@k0ral k0ral changed the title mps-youtube: 0.2.8 -> 2010-01-28 mps-youtube: 0.2.8 -> unstable-2010-01-28 Feb 16, 2020
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

this commit is broken

$ ./results/python37Packages.mps-youtube/bin/mpsyt
could not load MPRIS interface. missing libraries.
Traceback (most recent call last):
  File "/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/bin/.mpsyt-wrapped", line 6, in <module>
    from mps_youtube import main
  File "/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/__init__.py", line 9, in <module>
    from . import main
  File "/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/main.py", line 30, in <module>
    from . import g, c, commands, screen, history, util
  File "/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/commands/__init__.py", line 5, in <module>
    from ..main import completer
ImportError: cannot import name 'completer' from 'mps_youtube.main' (/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/main.py)

[nix-shell:/nix/store/fiwc2apkmm7840d5vb2fmhh5lml2dhwy-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages]$ cd mps_youtube
__init__.py  c.py      commands   content.py       description_parser.py  helptext.py  init.py   main.py   paths.py   players      playlists.py  streams.py       util.py
__pycache__  cache.py  config.py  contentquery.py  g.py                   history.py   listview  mpris.py  player.py  playlist.py  screen.py     terminalsize.py

they reference a module that doesn't exist anymore

@k0ral
Copy link
Contributor Author

k0ral commented Feb 16, 2020

Works on my side (it feels weird to say this when using NixOS):

$ grep completer /nix/store/d3yrji9kp1kn2jvnb056wlkz60k8503d-python3.7-mps-youtube-unstable-2020-01-28                                                                                Sun 16 Feb 2020 06:52:34 PM CET
/nix/store/d3yrji9kp1kn2jvnb056wlkz60k8503d-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/main.py
34:completer = None
39:    completer = util.CommandCompleter()
41:    readline.set_completer(completer.complete_command)
42:    readline.set_completer_delims('')

/nix/store/d3yrji9kp1kn2jvnb056wlkz60k8503d-python3.7-mps-youtube-unstable-2020-01-28/lib/python3.7/site-packages/mps_youtube/commands/__init__.py
5:from ..main import completer
28:        completer.add_cmd(command)

completer is well defined inside main module.

@jonringer
Copy link
Contributor

is this supposed to be used as a standalone application? (like a cli utility?)

@k0ral
Copy link
Contributor Author

k0ral commented Feb 17, 2020

Yes, this is a standalone CLI application.

@jonringer
Copy link
Contributor

The reason why I ask is that we could export this as a top level mps-youtube command using buildPythonApplication, and not mess with package (which is much more fragile as to what environment is calling it)

@k0ral
Copy link
Contributor Author

k0ral commented Feb 17, 2020

I've just replaced buildPythonPackage with buildPythonApplication, as suggested. Today I learned :) .

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

Please move the expression out of python-modules and into an appropriate directory

pkgs/top-level/python-packages.nix Show resolved Hide resolved
@k0ral
Copy link
Contributor Author

k0ral commented Feb 18, 2020

Moved to pkgs/applications/misc, added deprecation notice in python-packages.

@jonringer
Copy link
Contributor

would still like @FRidh to sign off

@worldofpeace do you have any strong feelings?

@jonringer
Copy link
Contributor

LGTM, for what it's worth

@@ -20371,6 +20371,10 @@ in

mpc-qt = libsForQt5.callPackage ../applications/video/mpc-qt { };

mps-youtube = callPackage ../applications/misc/mps-youtube {
pythonPackages = python3Packages;
Copy link
Member

Choose a reason for hiding this comment

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

remove the argument

{ lib, buildPythonPackage, fetchFromGitHub, isPy3k
, pafy
}:
{ lib, pythonPackages, fetchFromGitHub }:
Copy link
Member

Choose a reason for hiding this comment

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

use python3Packages here

@@ -6383,7 +6383,7 @@ in {

maildir-deduplicate = callPackage ../development/python-modules/maildir-deduplicate { };

mps-youtube = callPackage ../development/python-modules/mps-youtube { };
mps-youtube = throw "mps-youtube has moved to all-packages, and is no longer available as a python module.";
Copy link
Contributor

Choose a reason for hiding this comment

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

would love to do this, but we really need an removed-python.nix.
I don't think this should be a throw though, mps-youtube and python3Packages.mps-youtube should be equivalent, and I have no reason to believe anyone used it as a module.

I would suggest the following

Suggested change
mps-youtube = throw "mps-youtube has moved to all-packages, and is no longer available as a python module.";
mps-youtube = pkgs.mps-youtube;

but we really shouldn't be having aliases in python-packages.nix, we'd have the same situation that created aliases.nix in the first place.

Copy link
Contributor

Choose a reason for hiding this comment

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

you would need to do something like mps-youtube = pkgs.mps-youtube.override { inherit python;}; otherwisei you'll get different interpreter versions.

Copy link
Member

Choose a reason for hiding this comment

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

Right, so no alias or warning at all. Maybe not the best UI, but easiest for Nixpkgs maintainers. I like that.

@worldofpeace worldofpeace changed the title mps-youtube: 0.2.8 -> unstable-2010-01-28 mps-youtube: 0.2.8 -> unstable-2020-01-28 Feb 18, 2020
@worldofpeace
Copy link
Contributor

@k0ral Your commit message has the wrong date 785fe19.
It should be 2020-01-28 not 2010

@k0ral
Copy link
Contributor Author

k0ral commented Feb 18, 2020

Updated with all your comments taken into account.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

please squash commits, and just make a mention in the body that the package was moved from python-modules to all-packages :)

Also move derivation from python-packages to all-packages,
as this is a standalone application.
@k0ral
Copy link
Contributor Author

k0ral commented Feb 20, 2020

Squashed commits.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

LGTM
executable shows usage

[2 built, 7 copied (59.3 MiB), 16.9 MiB DL]
https://github.com/NixOS/nixpkgs/pull/80269
1 package built:
mps-youtube

@jonringer jonringer merged commit d57c05a into NixOS:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants