neovim: drop python2 support (#1978)

Nixpkgs did the same in https://github.com/NixOS/nixpkgs/pull/121339.
This commit is contained in:
Robert Schütz 2021-05-04 05:47:08 +02:00 committed by GitHub
parent 225bf275ba
commit e0ee5068dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,14 +6,6 @@ let
cfg = config.programs.neovim; cfg = config.programs.neovim;
extraPythonPackageType = mkOptionType {
name = "extra-python-packages";
description = "python packages in python.withPackages format";
check = with types;
(x: if isFunction x then isList (x pkgs.pythonPackages) else false);
merge = mergeOneOption;
};
extraPython3PackageType = mkOptionType { extraPython3PackageType = mkOptionType {
name = "extra-python3-packages"; name = "extra-python3-packages";
description = "python3 packages in python.withPackages format"; description = "python3 packages in python.withPackages format";
@ -67,6 +59,13 @@ let
''--suffix PATH : "${lib.makeBinPath cfg.extraPackages}"''; ''--suffix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
in { in {
imports = [
(mkRemovedOptionModule [ "programs" "neovim" "withPython" ]
"Python2 support has been removed from neovim.")
(mkRemovedOptionModule [ "programs" "neovim" "extraPythonPackages" ]
"Python2 support has been removed from neovim.")
];
options = { options = {
programs.neovim = { programs.neovim = {
enable = mkEnableOption "Neovim"; enable = mkEnableOption "Neovim";
@ -104,26 +103,6 @@ in {
''; '';
}; };
withPython = mkOption {
type = types.bool;
default = true;
description = ''
Enable Python 2 provider. Set to <literal>true</literal> to
use Python 2 plugins.
'';
};
extraPythonPackages = mkOption {
type = with types; either extraPythonPackageType (listOf package);
default = (_: [ ]);
defaultText = "ps: []";
example = literalExample "(ps: with ps; [ pandas jedi ])";
description = ''
A function in python.withPackages format, which returns a
list of Python 2 packages required for your plugins to work.
'';
};
withRuby = mkOption { withRuby = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = true; default = true;
@ -245,8 +224,7 @@ in {
config = let config = let
neovimConfig = pkgs.neovimUtils.makeNeovimConfig { neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
inherit (cfg) inherit (cfg)
extraPython3Packages withPython3 extraPythonPackages withPython extraPython3Packages withPython3 withNodeJs withRuby viAlias vimAlias;
withNodeJs withRuby viAlias vimAlias;
configure = cfg.configure // moduleConfigure; configure = cfg.configure // moduleConfigure;
plugins = cfg.plugins; plugins = cfg.plugins;
}; };