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 120 121 121 If one of your favourite plugins isn't packaged, you can package it yourself: 122 122 123 - ``` 123 + ```nix 124 124 { config, pkgs, ... }: 125 125 126 126 let ··· 153 153 ]; 154 154 } 155 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))`. 156 183 157 184 ## Managing plugins with vim-plug {#managing-plugins-with-vim-plug} 158 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 1 { lib, stdenv 2 - , fetchurl 2 + , fetchFromGitLab 3 + , fetchpatch 3 4 , python38 4 5 , librsync 5 6 , ncftp ··· 18 19 in 19 20 pythonPackages.buildPythonApplication rec { 20 21 pname = "duplicity"; 21 - version = "0.8.17"; 22 + version = "0.8.20"; 22 23 23 - src = fetchurl { 24 - url = "https://code.launchpad.net/duplicity/${majorMinor version}-series/${majorMinorPatch version}/+download/duplicity-${version}.tar.gz"; 25 - sha256 = "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2"; 24 + src = fetchFromGitLab { 25 + owner = "duplicity"; 26 + repo = "duplicity"; 27 + rev = "rel.${version}"; 28 + sha256 = "13ghra0myq6h6yx8qli55bh8dg91nf1hpd8l7d7xamgrw6b188sm"; 26 29 }; 27 30 28 31 patches = [ ··· 32 35 # Our Python infrastructure runs test in installCheckPhase so we need 33 36 # to make the testing code stop assuming it is run from the source directory. 34 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 + }) 35 45 ] ++ lib.optionals stdenv.isLinux [ 36 46 # Broken on Linux in Nix' build environment 37 47 ./linux-disable-timezone-test.patch ··· 39 49 40 50 SETUPTOOLS_SCM_PRETEND_VERSION = version; 41 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 + 42 61 nativeBuildInputs = [ 43 62 makeWrapper 44 63 gettext ··· 51 70 52 71 pythonPath = with pythonPackages; [ 53 72 b2sdk 54 - boto 55 73 boto3 56 74 cffi 57 75 cryptography ··· 103 121 104 122 # Don't run developer-only checks (pep8, etc.). 105 123 export RUN_CODE_TESTS=0 124 + 125 + # check version string 126 + duplicity --version | grep ${version} 106 127 '' + lib.optionalString stdenv.isDarwin '' 107 128 # Work around the following error when running tests: 108 129 # > Max open files of 256 is too low, should be >= 1024.
+6 -4
pkgs/tools/backup/duplicity/gnutar-in-test.patch
··· 1 + diff --git a/testing/functional/test_restart.py b/testing/functional/test_restart.py 2 + index 6d972c82..e8435fd5 100644 1 3 --- a/testing/functional/test_restart.py 2 4 +++ b/testing/functional/test_restart.py 3 - @@ -323,14 +323,7 @@ class RestartTestWithoutEncryption(RestartTest): 5 + @@ -350,14 +350,7 @@ class RestartTestWithoutEncryption(RestartTest): 4 6 https://launchpad.net/bugs/929067 5 7 """ 6 - 8 + 7 9 - if platform.system().startswith(u'Linux'): 8 10 - tarcmd = u"tar" 9 11 - elif platform.system().startswith(u'Darwin'): ··· 13 15 - else: 14 16 - raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform()) 15 17 + tarcmd = u"tar" 16 - 18 + 17 19 # Intial normal backup 18 - self.backup("full", "testfiles/blocktartest") 20 + self.backup(u"full", u"{0}/testfiles/blocktartest".format(_runtest_dir))
+10 -4
pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
··· 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 1 7 --- a/testing/unit/test_statistics.py 2 8 +++ b/testing/unit/test_statistics.py 3 - @@ -59,6 +59,7 @@ class StatsObjTest(UnitTestCase): 9 + @@ -63,6 +63,7 @@ class StatsObjTest(UnitTestCase): 4 10 s1 = StatsDeltaProcess() 5 - assert s1.get_stat('SourceFiles') == 0 6 - 11 + assert s1.get_stat(u'SourceFiles') == 0 12 + 7 13 + @unittest.skip("Broken on Linux in Nix' build environment") 8 14 def test_get_stats_string(self): 9 - """Test conversion of stat object into string""" 15 + u"""Test conversion of stat object into string""" 10 16 s = StatsObj()
+29 -15
pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
··· 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 1 9 --- a/setup.py 2 10 +++ b/setup.py 3 - @@ -92,10 +92,6 @@ class TestCommand(test): 11 + @@ -205,10 +205,6 @@ class TestCommand(test): 4 12 except Exception: 5 13 pass 6 - 14 + 7 15 - os.environ[u'PATH'] = u"%s:%s" % ( 8 16 - os.path.abspath(build_scripts_cmd.build_dir), 9 17 - os.environ.get(u'PATH')) 10 18 - 11 19 test.run(self) 12 - 13 - def run_tests(self): 20 + 21 + 22 + diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py 23 + index 4221576d..3cf44945 100644 14 24 --- a/testing/functional/__init__.py 15 25 +++ b/testing/functional/__init__.py 16 - @@ -107,7 +107,7 @@ class FunctionalTestCase(DuplicityTestCase): 17 - if basepython is not None: 18 - cmd_list.extend([basepython]) 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: 19 29 cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"]) 20 - - cmd_list.extend([u"../bin/duplicity"]) 30 + - cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)]) 21 31 + cmd_list.extend([u"duplicity"]) 22 32 cmd_list.extend(options) 23 33 cmd_list.extend([u"-v0"]) 24 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 25 37 --- a/testing/functional/test_log.py 26 38 +++ b/testing/functional/test_log.py 27 - @@ -47,9 +47,9 @@ class LogTest(FunctionalTestCase): 39 + @@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase): 28 40 # Run actual duplicity command (will fail, because no arguments passed) 29 41 basepython = os.environ.get(u'TOXPYTHON', None) 30 42 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)) 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)) 33 45 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)) 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)) 36 48 37 49 # The format of the file should be: 38 50 # """ERROR 2 51 + diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py 52 + index 0cbfdb33..47acd029 100644 39 53 --- a/testing/functional/test_rdiffdir.py 40 54 +++ b/testing/functional/test_rdiffdir.py 41 - @@ -42,7 +42,7 @@ class RdiffdirTest(FunctionalTestCase): 55 + @@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase): 42 56 basepython = os.environ.get(u'TOXPYTHON', None) 43 57 if basepython is not None: 44 58 cmd_list.extend([basepython]) 45 - - cmd_list.extend([u"../bin/rdiffdir"]) 59 + - cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)]) 46 60 + cmd_list.extend([u"rdiffdir"]) 47 61 cmd_list.extend(argstring.split()) 48 62 cmdline = u" ".join([u'"%s"' % x for x in cmd_list])
+2
pkgs/top-level/python-packages.nix
··· 8691 8691 8692 8692 toml = callPackage ../development/python-modules/toml { }; 8693 8693 8694 + tomli = callPackage ../development/python-modules/tomli { }; 8695 + 8694 8696 tomlkit = callPackage ../development/python-modules/tomlkit { }; 8695 8697 8696 8698 toolz = callPackage ../development/python-modules/toolz { };