git.iko.soy/typeable/nixpkgs
on master help sign in
neovim, neovimUtils, neovim-qt: drop python2 support

In 2a00e53bd pynvim support for python2 was disabled, this broke the neovim build. I really think it is time to let go of python2 support in neovim.

commitd942d4473d1165cf9d8a1171bbad154f77239ba0 authorMartin Weinelt <hexa@darmstadt.ccc.de> dateSat 1 May 2021, 02:29 (6 years ago) parentf5e695b
8 files changed+34−29
nixos/doc/manual/release-notes/rl-2105.xml+1−1 pkgs/applications/editors/neovim/default.nix+2−2 pkgs/applications/editors/neovim/neovim-qt.nix+2−2 pkgs/applications/editors/neovim/neovim-remote.nix+19−4 pkgs/applications/editors/neovim/qt.nix+1−2 pkgs/applications/editors/neovim/utils.nix+5−12 pkgs/applications/editors/neovim/wrapper.nix+3−5 pkgs/top-level/all-packages.nix+1−1
nixos/doc/manual/release-notes/rl-2105.xml+1−1
@@ -330,7 +330,7 @@
330330 </listitem>
331331 <listitem>
332332 <para>
333− <literal>vim</literal> switched to Python 3, dropping all Python 2 support.
333+ <literal>vim</literal> and <literal>neovim</literal> switched to Python 3, dropping all Python 2 support.
334334 </para>
335335 </listitem>
336336 <listitem>
pkgs/applications/editors/neovim/default.nix+2−2
@@ -6,7 +6,7 @@
66
77# now defaults to false because some tests can be flaky (clipboard etc)
88, doCheck ? false
9−, nodejs ? null, fish ? null, python ? null
9+, nodejs ? null, fish ? null, python3 ? null
1010}:
1111
1212with lib;
@@ -19,7 +19,7 @@ let
1919 ]
2020 ));
2121
22− pyEnv = python.withPackages(ps: [ ps.pynvim ps.msgpack ]);
22+ pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
2323
2424 # FIXME: this is verry messy and strange.
2525 # see https://github.com/NixOS/nixpkgs/pull/80528
pkgs/applications/editors/neovim/neovim-qt.nix+2−2
@@ -1,5 +1,5 @@
11{ lib, mkDerivation, fetchFromGitHub, cmake, doxygen, makeWrapper
2−, msgpack, neovim, pythonPackages, qtbase }:
2+, msgpack, neovim, python3Packages, qtbase }:
33
44mkDerivation rec {
55 pname = "neovim-qt-unwrapped";
@@ -20,7 +20,7 @@ mkDerivation rec {
2020 buildInputs = [
2121 neovim.unwrapped # only used to generate help tags at build time
2222 qtbase
23− ] ++ (with pythonPackages; [
23+ ] ++ (with python3Packages; [
2424 jinja2 python msgpack
2525 ]);
2626
pkgs/applications/editors/neovim/neovim-remote.nix+19−4
@@ -1,11 +1,14 @@
1−{ lib, fetchFromGitHub, pythonPackages }:
1+{ lib
2+, fetchFromGitHub
3+, python3
4+, neovim
5+}:
26
37with lib;
48
5−pythonPackages.buildPythonApplication rec {
9+with python3.pkgs; buildPythonApplication rec {
610 pname = "neovim-remote";
711 version = "2.4.0";
8− disabled = !pythonPackages.isPy3k;
912
1013 src = fetchFromGitHub {
1114 owner = "mhinz";
@@ -14,12 +17,24 @@ pythonPackages.buildPythonApplication rec {
1417 sha256 = "0jlw0qksak4bdzddpsj74pm2f2bgpj3cwrlspdjjy0j9qzg0mpl9";
1518 };
1619
17− propagatedBuildInputs = with pythonPackages; [
20+ propagatedBuildInputs = [
1821 pynvim
1922 psutil
2023 setuptools
2124 ];
2225
26+ checkInputs = [
27+ neovim
28+ pytestCheckHook
29+ ];
30+
31+ disabledTests = [
32+ # these tests get stuck and never return
33+ "test_escape_filenames_properly"
34+ "test_escape_single_quotes_in_filenames"
35+ "test_escape_double_quotes_in_filenames"
36+ ];
37+
2338 meta = {
2439 description = "A tool that helps controlling nvim processes from a terminal";
2540 homepage = "https://github.com/mhinz/neovim-remote/";
pkgs/applications/editors/neovim/qt.nix+1−2
@@ -1,5 +1,4 @@
1−{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, doxygen, makeWrapper
2−, msgpack, neovim, pythonPackages, qtbase, neovim-qt-unwrapped }:
1+{ stdenv, makeWrapper, neovim, neovim-qt-unwrapped }:
32
43let
54 unwrapped = neovim-qt-unwrapped;
pkgs/applications/editors/neovim/utils.nix+5−12
@@ -4,7 +4,6 @@
44, neovim-unwrapped
55, bundlerEnv
66, ruby
7−, pythonPackages
87, python3Packages
98, writeText
109, wrapNeovimUnstable
@@ -48,12 +47,6 @@ let
4847 requiredPlugins = vimUtils.requiredPlugins configure;
4948 getDeps = attrname: map (plugin: plugin.${attrname} or (_: [ ]));
5049
51− pluginPython2Packages = getDeps "pythonDependencies" requiredPlugins;
52− python2Env = pythonPackages.python.withPackages (ps:
53− [ ps.pynvim ]
54− ++ (extraPython2Packages ps)
55− ++ (lib.concatMap (f: f ps) pluginPython2Packages));
56−
5750 pluginPython3Packages = getDeps "python3Dependencies" requiredPlugins;
5851 python3Env = python3Packages.python.withPackages (ps:
5952 [ ps.pynvim ]
@@ -69,7 +62,6 @@ let
6962 # While the latter tells nvim that this provider is not available
7063 hostprog_check_table = {
7164 node = withNodeJs;
72− python = withPython2;
7365 python3 = withPython3;
7466 ruby = withRuby;
7567 };
@@ -99,11 +91,12 @@ let
9991 manifestRc = vimUtils.vimrcContent (configure // { customRC = ""; });
10092 neovimRcContent = vimUtils.vimrcContent configure;
10193 in
94+ assert withPython2 -> throw "Python2 support has been removed from neovim, please remove withPython2 and extraPython2Packages.";
95+
10296 args // {
10397 wrapperArgs = makeWrapperArgs;
10498 inherit neovimRcContent;
10599 inherit manifestRc;
106− inherit python2Env;
107100 inherit python3Env;
108101 inherit withNodeJs;
109102 } // lib.optionalAttrs withRuby {
@@ -120,7 +113,7 @@ let
120113 # to keep backwards compatibility
121114 legacyWrapper = neovim: {
122115 extraMakeWrapperArgs ? ""
123− , withPython ? true
116+ , withPython ? false
124117 /* the function you would have passed to python.withPackages */
125118 , extraPythonPackages ? (_: [])
126119 /* the function you would have passed to python.withPackages */
@@ -138,14 +131,14 @@ let
138131 else funOrList);
139132
140133 res = makeNeovimConfig {
141− withPython2 = withPython;
142− extraPythonPackages = compatFun extraPythonPackages;
143134 inherit withPython3;
144135 extraPython3Packages = compatFun extraPython3Packages;
145136 inherit withNodeJs withRuby viAlias vimAlias;
146137 inherit configure;
147138 };
148139 in
140+ assert withPython -> throw "Python2 support has been removed from neovim, please remove withPython and extraPythonPackages.";
141+
149142 wrapNeovimUnstable neovim (res // {
150143 wrapperArgs = lib.escapeShellArgs (
151144 res.wrapperArgs ++ lib.optionals (configure != {}) [
pkgs/applications/editors/neovim/wrapper.nix+3−5
@@ -3,7 +3,6 @@
33, bundlerEnv, ruby
44, nodejs
55, nodePackages
6−, pythonPackages
76, python3Packages
87}:
98with lib;
@@ -15,7 +14,7 @@ let
1514 # should contain all args but the binary
1615 wrapperArgs ? ""
1716 , manifestRc ? null
18− , withPython2 ? true, python2Env ? null
17+ , withPython2 ? false
1918 , withPython3 ? true, python3Env ? null
2019 , withNodeJs ? false
2120 , rubyEnv ? null
@@ -35,6 +34,8 @@ let
3534 [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] ++
3635 [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ];
3736 in
37+ assert withPython2 -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env.";
38+
3839 symlinkJoin {
3940 name = "neovim-${lib.getVersion neovim}";
4041 # Remove the symlinks created by symlinkJoin which we need to perform
@@ -44,9 +45,6 @@ let
4445 substitute ${neovim}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
4546 --replace 'Name=Neovim' 'Name=WrappedNeovim'
4647 ''
47− + optionalString withPython2 ''
48− makeWrapper ${python2Env}/bin/python $out/bin/nvim-python --unset PYTHONPATH
49− ''
5048 + optionalString withPython3 ''
5149 makeWrapper ${python3Env}/bin/python3 $out/bin/nvim-python3 --unset PYTHONPATH
5250 ''
pkgs/top-level/all-packages.nix+1−1
@@ -26626,7 +26626,7 @@ in
2662626626
2662726627 gnvim = callPackage ../applications/editors/neovim/gnvim/wrapper.nix { };
2662826628
26629− neovim-remote = callPackage ../applications/editors/neovim/neovim-remote.nix { pythonPackages = python3Packages; };
26629+ neovim-remote = callPackage ../applications/editors/neovim/neovim-remote.nix { };
2663026630
2663126631 vis = callPackage ../applications/editors/vis {
2663226632 inherit (lua52Packages) lpeg;