Skip to content

Commit 1f9cbcd

Browse files
committedDec 3, 2016
beets: Set Python version via top-level attribute
This largely reverts commit 5993127. The main reason is that it breaks the plugins, because the mentioned commit didn't change the attributes for the plugins as well. But instead of just fixing the attributes when we import the plugin packages, let's just override pythonPackages in all-packages.nix. Right now, Beets is in transition to Python 3, so we don't need to wait that long until we can remove the dependency on Python 2: https://github.com/beetbox/beets/releases/tag/v1.4.1 Once Python 3 support is no longer beta, we can just change this by changing one line only instead of several. Tested this by building beets with both external plugins. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @FRidh
1 parent a76f524 commit 1f9cbcd

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed
 

‎pkgs/tools/audio/beets/default.nix

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{ stdenv, fetchFromGitHub, writeScript, glibcLocales
2-
, python2Packages, imagemagick
2+
, pythonPackages, imagemagick
33

44
, enableAcousticbrainz ? true
55
, enableAcoustid ? true
@@ -22,17 +22,17 @@
2222
, bashInteractive, bash-completion
2323
}:
2424

25-
assert enableAcoustid -> python2Packages.pyacoustid != null;
25+
assert enableAcoustid -> pythonPackages.pyacoustid != null;
2626
assert enableBadfiles -> flac != null && mp3val != null;
2727
assert enableConvert -> ffmpeg != null;
28-
assert enableDiscogs -> python2Packages.discogs_client != null;
29-
assert enableFetchart -> python2Packages.responses != null;
28+
assert enableDiscogs -> pythonPackages.discogs_client != null;
29+
assert enableFetchart -> pythonPackages.responses != null;
3030
assert enableKeyfinder -> keyfinder-cli != null;
31-
assert enableLastfm -> python2Packages.pylast != null;
32-
assert enableMpd -> python2Packages.mpd != null;
31+
assert enableLastfm -> pythonPackages.pylast != null;
32+
assert enableMpd -> pythonPackages.mpd != null;
3333
assert enableReplaygain -> bs1770gain != null;
34-
assert enableThumbnails -> python2Packages.pyxdg != null;
35-
assert enableWeb -> python2Packages.flask != null;
34+
assert enableThumbnails -> pythonPackages.pyxdg != null;
35+
assert enableWeb -> pythonPackages.flask != null;
3636

3737
with stdenv.lib;
3838

@@ -72,7 +72,7 @@ let
7272
testShell = "${bashInteractive}/bin/bash --norc";
7373
completion = "${bash-completion}/share/bash-completion/bash_completion";
7474

75-
in python2Packages.buildPythonApplication rec {
75+
in pythonPackages.buildPythonApplication rec {
7676
name = "beets-${version}";
7777
version = "1.4.1";
7878

@@ -84,34 +84,34 @@ in python2Packages.buildPythonApplication rec {
8484
};
8585

8686
propagatedBuildInputs = [
87-
python2Packages.enum34
88-
python2Packages.jellyfish
89-
python2Packages.munkres
90-
python2Packages.musicbrainzngs
91-
python2Packages.mutagen
92-
python2Packages.pathlib
93-
python2Packages.pyyaml
94-
python2Packages.unidecode
95-
] ++ optional enableAcoustid python2Packages.pyacoustid
87+
pythonPackages.enum34
88+
pythonPackages.jellyfish
89+
pythonPackages.munkres
90+
pythonPackages.musicbrainzngs
91+
pythonPackages.mutagen
92+
pythonPackages.pathlib
93+
pythonPackages.pyyaml
94+
pythonPackages.unidecode
95+
] ++ optional enableAcoustid pythonPackages.pyacoustid
9696
++ optional (enableFetchart
9797
|| enableEmbyupdate
9898
|| enableAcousticbrainz)
99-
python2Packages.requests2
99+
pythonPackages.requests2
100100
++ optional enableConvert ffmpeg
101-
++ optional enableDiscogs python2Packages.discogs_client
101+
++ optional enableDiscogs pythonPackages.discogs_client
102102
++ optional enableKeyfinder keyfinder-cli
103-
++ optional enableLastfm python2Packages.pylast
104-
++ optional enableMpd python2Packages.mpd
105-
++ optional enableThumbnails python2Packages.pyxdg
106-
++ optional enableWeb python2Packages.flask
103+
++ optional enableLastfm pythonPackages.pylast
104+
++ optional enableMpd pythonPackages.mpd
105+
++ optional enableThumbnails pythonPackages.pyxdg
106+
++ optional enableWeb pythonPackages.flask
107107
++ optional enableAlternatives (import ./alternatives-plugin.nix {
108-
inherit stdenv python2Packages fetchFromGitHub;
108+
inherit stdenv pythonPackages fetchFromGitHub;
109109
})
110110
++ optional enableCopyArtifacts (import ./copyartifacts-plugin.nix {
111-
inherit stdenv python2Packages fetchFromGitHub;
111+
inherit stdenv pythonPackages fetchFromGitHub;
112112
});
113113

114-
buildInputs = with python2Packages; [
114+
buildInputs = with pythonPackages; [
115115
beautifulsoup4
116116
imagemagick
117117
mock

‎pkgs/top-level/all-packages.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,9 @@ in
10181018

10191019
beanstalkd = callPackage ../servers/beanstalkd { };
10201020

1021-
beets = callPackage ../tools/audio/beets { };
1021+
beets = callPackage ../tools/audio/beets {
1022+
pythonPackages = python2Packages;
1023+
};
10221024

10231025
bgs = callPackage ../tools/X11/bgs { };
10241026

0 commit comments

Comments
 (0)
Please sign in to comment.