Merge branch 'master' into staging-next

authored by Martin Weinelt and committed by GitHub 12e2b980 c0cb54f9

+138 -30
+28 -1
doc/languages-frameworks/vim.section.md
··· 120 121 If one of your favourite plugins isn't packaged, you can package it yourself: 122 123 - ``` 124 { config, pkgs, ... }: 125 126 let ··· 153 ]; 154 } 155 ``` 156 157 ## Managing plugins with vim-plug {#managing-plugins-with-vim-plug} 158
··· 120 121 If one of your favourite plugins isn't packaged, you can package it yourself: 122 123 + ```nix 124 { config, pkgs, ... }: 125 126 let ··· 153 ]; 154 } 155 ``` 156 + 157 + ### Specificities for some plugins 158 + #### Tree sitter 159 + 160 + By default `nvim-treesitter` encourages you to download, compile and install 161 + the required tree-sitter grammars at run time with `:TSInstall`. This works 162 + poorly on NixOS. Instead, to install the `nvim-treesitter` plugins with a set 163 + of precompiled grammars, you can use `nvim-treesitter.withPlugins` function: 164 + 165 + ```nix 166 + (pkgs.neovim.override { 167 + configure = { 168 + packages.myPlugins = with pkgs.vimPlugins; { 169 + start = [ 170 + (nvim-treesitter.withPlugins ( 171 + plugins: with plugins; [ 172 + tree-sitter-nix 173 + tree-sitter-python 174 + ] 175 + )) 176 + ]; 177 + }; 178 + }; 179 + }) 180 + ``` 181 + 182 + To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`. 183 184 ## Managing plugins with vim-plug {#managing-plugins-with-vim-plug} 185
+36
pkgs/development/python-modules/tomli/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , flit-core 5 + , pytestCheckHook 6 + , python-dateutil 7 + }: 8 + 9 + buildPythonPackage rec { 10 + pname = "tomli"; 11 + version = "1.0.4"; 12 + format = "pyproject"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "hukkin"; 16 + repo = pname; 17 + rev = version; 18 + sha256 = "sha256-ld0PsYnxVH3RbLG/NpvLDj9UhAe+QgwCQVXgGgqh8kE="; 19 + }; 20 + 21 + nativeBuildInputs = [ flit-core ]; 22 + 23 + checkInputs = [ 24 + pytestCheckHook 25 + python-dateutil 26 + ]; 27 + 28 + pythonImportsCheck = [ "tomli" ]; 29 + 30 + meta = with lib; { 31 + description = "A Python library for parsing TOML, fully compatible with TOML v1.0.0"; 32 + homepage = "https://github.com/hukkin/tomli"; 33 + license = licenses.mit; 34 + maintainers = with maintainers; [ veehaitch ]; 35 + }; 36 + }
+27 -6
pkgs/tools/backup/duplicity/default.nix
··· 1 { lib, stdenv 2 - , fetchurl 3 , python38 4 , librsync 5 , ncftp ··· 18 in 19 pythonPackages.buildPythonApplication rec { 20 pname = "duplicity"; 21 - version = "0.8.17"; 22 23 - src = fetchurl { 24 - url = "https://code.launchpad.net/duplicity/${majorMinor version}-series/${majorMinorPatch version}/+download/duplicity-${version}.tar.gz"; 25 - sha256 = "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2"; 26 }; 27 28 patches = [ ··· 32 # Our Python infrastructure runs test in installCheckPhase so we need 33 # to make the testing code stop assuming it is run from the source directory. 34 ./use-installed-scripts-in-test.patch 35 ] ++ lib.optionals stdenv.isLinux [ 36 # Broken on Linux in Nix' build environment 37 ./linux-disable-timezone-test.patch ··· 39 40 SETUPTOOLS_SCM_PRETEND_VERSION = version; 41 42 nativeBuildInputs = [ 43 makeWrapper 44 gettext ··· 51 52 pythonPath = with pythonPackages; [ 53 b2sdk 54 - boto 55 boto3 56 cffi 57 cryptography ··· 103 104 # Don't run developer-only checks (pep8, etc.). 105 export RUN_CODE_TESTS=0 106 '' + lib.optionalString stdenv.isDarwin '' 107 # Work around the following error when running tests: 108 # > Max open files of 256 is too low, should be >= 1024.
··· 1 { lib, stdenv 2 + , fetchFromGitLab 3 + , fetchpatch 4 , python38 5 , librsync 6 , ncftp ··· 19 in 20 pythonPackages.buildPythonApplication rec { 21 pname = "duplicity"; 22 + version = "0.8.20"; 23 24 + src = fetchFromGitLab { 25 + owner = "duplicity"; 26 + repo = "duplicity"; 27 + rev = "rel.${version}"; 28 + sha256 = "13ghra0myq6h6yx8qli55bh8dg91nf1hpd8l7d7xamgrw6b188sm"; 29 }; 30 31 patches = [ ··· 35 # Our Python infrastructure runs test in installCheckPhase so we need 36 # to make the testing code stop assuming it is run from the source directory. 37 ./use-installed-scripts-in-test.patch 38 + 39 + # https://gitlab.com/duplicity/duplicity/-/merge_requests/64 40 + # remove on next release 41 + (fetchpatch { 42 + url = "https://gitlab.com/duplicity/duplicity/-/commit/5c229a9b42f67257c747fbc0022c698fec405bbc.patch"; 43 + sha256 = "05v931rnawfv11cyxj8gykmal8rj5vq2ksdysyr2mb4sl81mi7v0"; 44 + }) 45 ] ++ lib.optionals stdenv.isLinux [ 46 # Broken on Linux in Nix' build environment 47 ./linux-disable-timezone-test.patch ··· 49 50 SETUPTOOLS_SCM_PRETEND_VERSION = version; 51 52 + preConfigure = '' 53 + # fix version displayed by duplicity --version 54 + # see SourceCopy in setup.py 55 + ls 56 + for i in bin/*.1 duplicity/__init__.py; do 57 + substituteInPlace "$i" --replace '$version' "${version}" 58 + done 59 + ''; 60 + 61 nativeBuildInputs = [ 62 makeWrapper 63 gettext ··· 70 71 pythonPath = with pythonPackages; [ 72 b2sdk 73 boto3 74 cffi 75 cryptography ··· 121 122 # Don't run developer-only checks (pep8, etc.). 123 export RUN_CODE_TESTS=0 124 + 125 + # check version string 126 + duplicity --version | grep ${version} 127 '' + lib.optionalString stdenv.isDarwin '' 128 # Work around the following error when running tests: 129 # > Max open files of 256 is too low, should be >= 1024.
+6 -4
pkgs/tools/backup/duplicity/gnutar-in-test.patch
··· 1 --- a/testing/functional/test_restart.py 2 +++ b/testing/functional/test_restart.py 3 - @@ -323,14 +323,7 @@ class RestartTestWithoutEncryption(RestartTest): 4 https://launchpad.net/bugs/929067 5 """ 6 - 7 - if platform.system().startswith(u'Linux'): 8 - tarcmd = u"tar" 9 - elif platform.system().startswith(u'Darwin'): ··· 13 - else: 14 - raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform()) 15 + tarcmd = u"tar" 16 - 17 # Intial normal backup 18 - self.backup("full", "testfiles/blocktartest")
··· 1 + diff --git a/testing/functional/test_restart.py b/testing/functional/test_restart.py 2 + index 6d972c82..e8435fd5 100644 3 --- a/testing/functional/test_restart.py 4 +++ b/testing/functional/test_restart.py 5 + @@ -350,14 +350,7 @@ class RestartTestWithoutEncryption(RestartTest): 6 https://launchpad.net/bugs/929067 7 """ 8 + 9 - if platform.system().startswith(u'Linux'): 10 - tarcmd = u"tar" 11 - elif platform.system().startswith(u'Darwin'): ··· 15 - else: 16 - raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform()) 17 + tarcmd = u"tar" 18 + 19 # Intial normal backup 20 + self.backup(u"full", u"{0}/testfiles/blocktartest".format(_runtest_dir))
+10 -4
pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
··· 1 --- a/testing/unit/test_statistics.py 2 +++ b/testing/unit/test_statistics.py 3 - @@ -59,6 +59,7 @@ class StatsObjTest(UnitTestCase): 4 s1 = StatsDeltaProcess() 5 - assert s1.get_stat('SourceFiles') == 0 6 - 7 + @unittest.skip("Broken on Linux in Nix' build environment") 8 def test_get_stats_string(self): 9 - """Test conversion of stat object into string""" 10 s = StatsObj()
··· 1 + commit f0142706c377b7c133753db57b5c4c90baa2de30 2 + Author: Guillaume Girol <symphorien+git@xlumurb.eu> 3 + Date: Sun Jul 11 17:48:15 2021 +0200 4 + 5 + diff --git a/testing/unit/test_statistics.py b/testing/unit/test_statistics.py 6 + index 4be5000c..80545853 100644 7 --- a/testing/unit/test_statistics.py 8 +++ b/testing/unit/test_statistics.py 9 + @@ -63,6 +63,7 @@ class StatsObjTest(UnitTestCase): 10 s1 = StatsDeltaProcess() 11 + assert s1.get_stat(u'SourceFiles') == 0 12 + 13 + @unittest.skip("Broken on Linux in Nix' build environment") 14 def test_get_stats_string(self): 15 + u"""Test conversion of stat object into string""" 16 s = StatsObj()
+29 -15
pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
··· 1 --- a/setup.py 2 +++ b/setup.py 3 - @@ -92,10 +92,6 @@ class TestCommand(test): 4 except Exception: 5 pass 6 - 7 - os.environ[u'PATH'] = u"%s:%s" % ( 8 - os.path.abspath(build_scripts_cmd.build_dir), 9 - os.environ.get(u'PATH')) 10 - 11 test.run(self) 12 - 13 - def run_tests(self): 14 --- a/testing/functional/__init__.py 15 +++ b/testing/functional/__init__.py 16 - @@ -107,7 +107,7 @@ class FunctionalTestCase(DuplicityTestCase): 17 - if basepython is not None: 18 - cmd_list.extend([basepython]) 19 cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"]) 20 - - cmd_list.extend([u"../bin/duplicity"]) 21 + cmd_list.extend([u"duplicity"]) 22 cmd_list.extend(options) 23 cmd_list.extend([u"-v0"]) 24 cmd_list.extend([u"--no-print-statistics"]) 25 --- a/testing/functional/test_log.py 26 +++ b/testing/functional/test_log.py 27 - @@ -47,9 +47,9 @@ class LogTest(FunctionalTestCase): 28 # Run actual duplicity command (will fail, because no arguments passed) 29 basepython = os.environ.get(u'TOXPYTHON', None) 30 if basepython is not None: 31 - - os.system(u"{} ../bin/duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile)) 32 - + os.system(u"{} duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile)) 33 else: 34 - - os.system(u"../bin/duplicity --log-file={} >/dev/null 2>&1".format(self.logfile)) 35 - + os.system(u"duplicity --log-file={} >/dev/null 2>&1".format(self.logfile)) 36 37 # The format of the file should be: 38 # """ERROR 2 39 --- a/testing/functional/test_rdiffdir.py 40 +++ b/testing/functional/test_rdiffdir.py 41 - @@ -42,7 +42,7 @@ class RdiffdirTest(FunctionalTestCase): 42 basepython = os.environ.get(u'TOXPYTHON', None) 43 if basepython is not None: 44 cmd_list.extend([basepython]) 45 - - cmd_list.extend([u"../bin/rdiffdir"]) 46 + cmd_list.extend([u"rdiffdir"]) 47 cmd_list.extend(argstring.split()) 48 cmdline = u" ".join([u'"%s"' % x for x in cmd_list])
··· 1 + commit ccd4dd92cd37acce1da20966ad9e4e0c7bcf1709 2 + Author: Guillaume Girol <symphorien+git@xlumurb.eu> 3 + Date: Sun Jul 11 12:00:00 2021 +0000 4 + 5 + use installed duplicity when running tests 6 + 7 + diff --git a/setup.py b/setup.py 8 + index fa474f20..604a242a 100755 9 --- a/setup.py 10 +++ b/setup.py 11 + @@ -205,10 +205,6 @@ class TestCommand(test): 12 except Exception: 13 pass 14 + 15 - os.environ[u'PATH'] = u"%s:%s" % ( 16 - os.path.abspath(build_scripts_cmd.build_dir), 17 - os.environ.get(u'PATH')) 18 - 19 test.run(self) 20 + 21 + 22 + diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py 23 + index 4221576d..3cf44945 100644 24 --- a/testing/functional/__init__.py 25 +++ b/testing/functional/__init__.py 26 + @@ -111,7 +111,7 @@ class FunctionalTestCase(DuplicityTestCase): 27 + run_coverage = os.environ.get(u'RUN_COVERAGE', None) 28 + if run_coverage is not None: 29 cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"]) 30 + - cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)]) 31 + cmd_list.extend([u"duplicity"]) 32 cmd_list.extend(options) 33 cmd_list.extend([u"-v0"]) 34 cmd_list.extend([u"--no-print-statistics"]) 35 + diff --git a/testing/functional/test_log.py b/testing/functional/test_log.py 36 + index 9dfc86a6..b9cb55db 100644 37 --- a/testing/functional/test_log.py 38 +++ b/testing/functional/test_log.py 39 + @@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase): 40 # Run actual duplicity command (will fail, because no arguments passed) 41 basepython = os.environ.get(u'TOXPYTHON', None) 42 if basepython is not None: 43 + - os.system(u"{0} {1}/bin/duplicity --log-file={2} >/dev/null 2>&1".format(basepython, _top_dir, self.logfile)) 44 + + os.system(u"{0} duplicity --log-file={1} >/dev/null 2>&1".format(basepython, self.logfile)) 45 else: 46 + - os.system(u"{0}/bin/duplicity --log-file={1} >/dev/null 2>&1".format(_top_dir, self.logfile)) 47 + + os.system(u"duplicity --log-file={0} >/dev/null 2>&1".format(self.logfile)) 48 49 # The format of the file should be: 50 # """ERROR 2 51 + diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py 52 + index 0cbfdb33..47acd029 100644 53 --- a/testing/functional/test_rdiffdir.py 54 +++ b/testing/functional/test_rdiffdir.py 55 + @@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase): 56 basepython = os.environ.get(u'TOXPYTHON', None) 57 if basepython is not None: 58 cmd_list.extend([basepython]) 59 + - cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)]) 60 + cmd_list.extend([u"rdiffdir"]) 61 cmd_list.extend(argstring.split()) 62 cmdline = u" ".join([u'"%s"' % x for x in cmd_list])
+2
pkgs/top-level/python-packages.nix
··· 8691 8692 toml = callPackage ../development/python-modules/toml { }; 8693 8694 tomlkit = callPackage ../development/python-modules/tomlkit { }; 8695 8696 toolz = callPackage ../development/python-modules/toolz { };
··· 8691 8692 toml = callPackage ../development/python-modules/toml { }; 8693 8694 + tomli = callPackage ../development/python-modules/tomli { }; 8695 + 8696 tomlkit = callPackage ../development/python-modules/tomlkit { }; 8697 8698 toolz = callPackage ../development/python-modules/toolz { };