summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2021-07-19 23:16:25 +0200
committerGitHub <noreply@github.com>2021-07-19 23:16:25 +0200
commit12e2b980177aa1de2a6de39ec2cb6f928f622dc1 (patch)
tree99f9e6b03589932d5a004266754c1e4138a59b2f
parentc0cb54f9eeb0c607a08097f84096728aa8ea615d (diff)
parent15f88843905ba344fac89cac17f9d9e5fda63731 (diff)
downloadnixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar.gz
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar.bz2
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar.lz
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar.xz
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.tar.zst
nixpkgs-12e2b980177aa1de2a6de39ec2cb6f928f622dc1.zip
Merge branch 'master' into staging-next
-rw-r--r--doc/languages-frameworks/vim.section.md29
-rw-r--r--pkgs/development/python-modules/tomli/default.nix36
-rw-r--r--pkgs/tools/backup/duplicity/default.nix33
-rw-r--r--pkgs/tools/backup/duplicity/gnutar-in-test.patch10
-rw-r--r--pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch14
-rw-r--r--pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch44
-rw-r--r--pkgs/top-level/python-packages.nix2
7 files changed, 138 insertions, 30 deletions
diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md
index e170591605c..26a01a89aa5 100644
--- a/doc/languages-frameworks/vim.section.md
+++ b/doc/languages-frameworks/vim.section.md
@@ -120,7 +120,7 @@ After that you can install your special grafted `myVim` or `myNeovim` packages.
 
 If one of your favourite plugins isn't packaged, you can package it yourself:
 
-```
+```nix
 { config, pkgs, ... }:
 
 let
@@ -154,6 +154,33 @@ in
 }
 ```
 
+### Specificities for some plugins
+#### Tree sitter
+
+By default `nvim-treesitter` encourages you to download, compile and install
+the required tree-sitter grammars at run time with `:TSInstall`. This works
+poorly on NixOS.  Instead, to install the `nvim-treesitter` plugins with a set
+of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
+
+```nix
+(pkgs.neovim.override {
+  configure = {
+    packages.myPlugins = with pkgs.vimPlugins; {
+      start = [
+        (nvim-treesitter.withPlugins (
+          plugins: with plugins; [
+            tree-sitter-nix
+            tree-sitter-python
+          ]
+        ))
+      ];
+    };
+  };
+})
+```
+
+To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`.
+
 ## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
 
 To use [vim-plug](https://github.com/junegunn/vim-plug) to manage your Vim
diff --git a/pkgs/development/python-modules/tomli/default.nix b/pkgs/development/python-modules/tomli/default.nix
new file mode 100644
index 00000000000..4204be03b94
--- /dev/null
+++ b/pkgs/development/python-modules/tomli/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, flit-core
+, pytestCheckHook
+, python-dateutil
+}:
+
+buildPythonPackage rec {
+  pname = "tomli";
+  version = "1.0.4";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "hukkin";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-ld0PsYnxVH3RbLG/NpvLDj9UhAe+QgwCQVXgGgqh8kE=";
+  };
+
+  nativeBuildInputs = [ flit-core ];
+
+  checkInputs = [
+    pytestCheckHook
+    python-dateutil
+  ];
+
+  pythonImportsCheck = [ "tomli" ];
+
+  meta = with lib; {
+    description = "A Python library for parsing TOML, fully compatible with TOML v1.0.0";
+    homepage = "https://github.com/hukkin/tomli";
+    license = licenses.mit;
+    maintainers = with maintainers; [ veehaitch ];
+  };
+}
diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix
index a6f509d2504..ab6b7d81221 100644
--- a/pkgs/tools/backup/duplicity/default.nix
+++ b/pkgs/tools/backup/duplicity/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv
-, fetchurl
+, fetchFromGitLab
+, fetchpatch
 , python38
 , librsync
 , ncftp
@@ -18,11 +19,13 @@ let
 in
 pythonPackages.buildPythonApplication rec {
   pname = "duplicity";
-  version = "0.8.17";
+  version = "0.8.20";
 
-  src = fetchurl {
-    url = "https://code.launchpad.net/duplicity/${majorMinor version}-series/${majorMinorPatch version}/+download/duplicity-${version}.tar.gz";
-    sha256 = "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2";
+  src = fetchFromGitLab {
+    owner = "duplicity";
+    repo = "duplicity";
+    rev = "rel.${version}";
+    sha256 = "13ghra0myq6h6yx8qli55bh8dg91nf1hpd8l7d7xamgrw6b188sm";
   };
 
   patches = [
@@ -32,6 +35,13 @@ pythonPackages.buildPythonApplication rec {
     # Our Python infrastructure runs test in installCheckPhase so we need
     # to make the testing code stop assuming it is run from the source directory.
     ./use-installed-scripts-in-test.patch
+
+    # https://gitlab.com/duplicity/duplicity/-/merge_requests/64
+    # remove on next release
+    (fetchpatch {
+      url = "https://gitlab.com/duplicity/duplicity/-/commit/5c229a9b42f67257c747fbc0022c698fec405bbc.patch";
+      sha256 = "05v931rnawfv11cyxj8gykmal8rj5vq2ksdysyr2mb4sl81mi7v0";
+    })
   ] ++ lib.optionals stdenv.isLinux [
     # Broken on Linux in Nix' build environment
     ./linux-disable-timezone-test.patch
@@ -39,6 +49,15 @@ pythonPackages.buildPythonApplication rec {
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
 
+  preConfigure = ''
+    # fix version displayed by duplicity --version
+    # see SourceCopy in setup.py
+    ls
+    for i in bin/*.1 duplicity/__init__.py; do
+      substituteInPlace "$i" --replace '$version' "${version}"
+    done
+  '';
+
   nativeBuildInputs = [
     makeWrapper
     gettext
@@ -51,7 +70,6 @@ pythonPackages.buildPythonApplication rec {
 
   pythonPath = with pythonPackages; [
     b2sdk
-    boto
     boto3
     cffi
     cryptography
@@ -103,6 +121,9 @@ pythonPackages.buildPythonApplication rec {
 
     # Don't run developer-only checks (pep8, etc.).
     export RUN_CODE_TESTS=0
+
+    # check version string
+    duplicity --version | grep ${version}
   '' + lib.optionalString stdenv.isDarwin ''
     # Work around the following error when running tests:
     # > Max open files of 256 is too low, should be >= 1024.
diff --git a/pkgs/tools/backup/duplicity/gnutar-in-test.patch b/pkgs/tools/backup/duplicity/gnutar-in-test.patch
index 694fc881950..ee95b68e2ab 100644
--- a/pkgs/tools/backup/duplicity/gnutar-in-test.patch
+++ b/pkgs/tools/backup/duplicity/gnutar-in-test.patch
@@ -1,9 +1,11 @@
+diff --git a/testing/functional/test_restart.py b/testing/functional/test_restart.py
+index 6d972c82..e8435fd5 100644
 --- a/testing/functional/test_restart.py
 +++ b/testing/functional/test_restart.py
-@@ -323,14 +323,7 @@ class RestartTestWithoutEncryption(RestartTest):
+@@ -350,14 +350,7 @@ class RestartTestWithoutEncryption(RestartTest):
          https://launchpad.net/bugs/929067
          """
-
+ 
 -        if platform.system().startswith(u'Linux'):
 -            tarcmd = u"tar"
 -        elif platform.system().startswith(u'Darwin'):
@@ -13,6 +15,6 @@
 -        else:
 -            raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform())
 +        tarcmd = u"tar"
-
+ 
          # Intial normal backup
-         self.backup("full", "testfiles/blocktartest")
+         self.backup(u"full", u"{0}/testfiles/blocktartest".format(_runtest_dir))
diff --git a/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch b/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
index b5e6df18a15..e322625cdbf 100644
--- a/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
+++ b/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
@@ -1,10 +1,16 @@
+commit f0142706c377b7c133753db57b5c4c90baa2de30
+Author: Guillaume Girol <symphorien+git@xlumurb.eu>
+Date:   Sun Jul 11 17:48:15 2021 +0200
+
+diff --git a/testing/unit/test_statistics.py b/testing/unit/test_statistics.py
+index 4be5000c..80545853 100644
 --- a/testing/unit/test_statistics.py
 +++ b/testing/unit/test_statistics.py
-@@ -59,6 +59,7 @@ class StatsObjTest(UnitTestCase):
+@@ -63,6 +63,7 @@ class StatsObjTest(UnitTestCase):
          s1 = StatsDeltaProcess()
-         assert s1.get_stat('SourceFiles') == 0
-
+         assert s1.get_stat(u'SourceFiles') == 0
+ 
 +    @unittest.skip("Broken on Linux in Nix' build environment")
      def test_get_stats_string(self):
-         """Test conversion of stat object into string"""
+         u"""Test conversion of stat object into string"""
          s = StatsObj()
diff --git a/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch b/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
index c02527cf394..a5ddc4381bd 100644
--- a/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
+++ b/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
@@ -1,48 +1,62 @@
+commit ccd4dd92cd37acce1da20966ad9e4e0c7bcf1709
+Author: Guillaume Girol <symphorien+git@xlumurb.eu>
+Date:   Sun Jul 11 12:00:00 2021 +0000
+
+    use installed duplicity when running tests
+
+diff --git a/setup.py b/setup.py
+index fa474f20..604a242a 100755
 --- a/setup.py
 +++ b/setup.py
-@@ -92,10 +92,6 @@ class TestCommand(test):
+@@ -205,10 +205,6 @@ class TestCommand(test):
                  except Exception:
                      pass
-
+ 
 -        os.environ[u'PATH'] = u"%s:%s" % (
 -            os.path.abspath(build_scripts_cmd.build_dir),
 -            os.environ.get(u'PATH'))
 -
          test.run(self)
-
-     def run_tests(self):
+ 
+ 
+diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py
+index 4221576d..3cf44945 100644
 --- a/testing/functional/__init__.py
 +++ b/testing/functional/__init__.py
-@@ -107,7 +107,7 @@ class FunctionalTestCase(DuplicityTestCase):
-         if basepython is not None:
-             cmd_list.extend([basepython])
+@@ -111,7 +111,7 @@ class FunctionalTestCase(DuplicityTestCase):
+         run_coverage = os.environ.get(u'RUN_COVERAGE', None)
+         if run_coverage is not None:
              cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"])
--        cmd_list.extend([u"../bin/duplicity"])
+-        cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)])
 +        cmd_list.extend([u"duplicity"])
          cmd_list.extend(options)
          cmd_list.extend([u"-v0"])
          cmd_list.extend([u"--no-print-statistics"])
+diff --git a/testing/functional/test_log.py b/testing/functional/test_log.py
+index 9dfc86a6..b9cb55db 100644
 --- a/testing/functional/test_log.py
 +++ b/testing/functional/test_log.py
-@@ -47,9 +47,9 @@ class LogTest(FunctionalTestCase):
+@@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase):
          # Run actual duplicity command (will fail, because no arguments passed)
          basepython = os.environ.get(u'TOXPYTHON', None)
          if basepython is not None:
--            os.system(u"{} ../bin/duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile))
-+            os.system(u"{} duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile))
+-            os.system(u"{0} {1}/bin/duplicity --log-file={2} >/dev/null 2>&1".format(basepython, _top_dir, self.logfile))
++            os.system(u"{0} duplicity --log-file={1} >/dev/null 2>&1".format(basepython, self.logfile))
          else:
--            os.system(u"../bin/duplicity --log-file={} >/dev/null 2>&1".format(self.logfile))
-+            os.system(u"duplicity --log-file={} >/dev/null 2>&1".format(self.logfile))
+-            os.system(u"{0}/bin/duplicity --log-file={1} >/dev/null 2>&1".format(_top_dir, self.logfile))
++            os.system(u"duplicity --log-file={0} >/dev/null 2>&1".format(self.logfile))
  
          # The format of the file should be:
          # """ERROR 2
+diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py
+index 0cbfdb33..47acd029 100644
 --- a/testing/functional/test_rdiffdir.py
 +++ b/testing/functional/test_rdiffdir.py
-@@ -42,7 +42,7 @@ class RdiffdirTest(FunctionalTestCase):
+@@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase):
          basepython = os.environ.get(u'TOXPYTHON', None)
          if basepython is not None:
              cmd_list.extend([basepython])
--        cmd_list.extend([u"../bin/rdiffdir"])
+-        cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)])
 +        cmd_list.extend([u"rdiffdir"])
          cmd_list.extend(argstring.split())
          cmdline = u" ".join([u'"%s"' % x for x in cmd_list])
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 7c6164618cf..6f361a5c2f1 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -8691,6 +8691,8 @@ in {
 
   toml = callPackage ../development/python-modules/toml { };
 
+  tomli = callPackage ../development/python-modules/tomli { };
+
   tomlkit = callPackage ../development/python-modules/tomlkit { };
 
   toolz = callPackage ../development/python-modules/toolz { };