[med-svn] [Git][med-team/q2cli][master] 3 commits: Modify upstream changes to make package compat with click 8.0 (Closes: #997488)

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Sat May 28 09:00:46 BST 2022



Nilesh Patra pushed to branch master at Debian Med / q2cli


Commits:
f96e9631 by Nilesh Patra at 2022-05-28T13:25:00+05:30
Modify upstream changes to make package compat with click 8.0 (Closes: #997488)

- - - - -
834ab234 by Nilesh Patra at 2022-05-28T13:25:08+05:30
Bump Standards-Version to 4.6.1 (no changes needed)

- - - - -
e2b2ef08 by Nilesh Patra at 2022-05-28T13:25:23+05:30
Upload to unstable

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/fix-click8.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+q2cli (2021.8.0-2) unstable; urgency=medium
+
+  * Team upload.
+  * Modify upstream changes to make package compat
+    with click 8.0 (Closes: #997488)
+  * Bump Standards-Version to 4.6.1 (no changes needed)
+
+ -- Nilesh Patra <nilesh at debian.org>  Sat, 28 May 2022 13:25:10 +0530
+
 q2cli (2021.8.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -12,7 +12,7 @@ Build-Depends: debhelper-compat (= 13),
                qiime (>= 2021.8.0),
                python3-click,
                python3-nose
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
 Vcs-Browser: https://salsa.debian.org/med-team/q2cli
 Vcs-Git: https://salsa.debian.org/med-team/q2cli.git
 Homepage: https://qiime2.org/


=====================================
debian/patches/fix-click8.patch
=====================================
@@ -0,0 +1,99 @@
+diff --git a/q2cli/click/option.py b/q2cli/click/option.py
+index 051d9bd..b70a833 100644
+--- a/q2cli/click/option.py
++++ b/q2cli/click/option.py
+@@ -91,10 +91,10 @@ class GeneratedOption(click.Option):
+ 
+     def _consume_metadata(self, ctx, opts):
+         # double consume
+-        md_file = super().consume_value(ctx, opts)
++        md_file, source = super().consume_value(ctx, opts)
+         # consume uses self.name, so mutate but backup for after
+         backup, self.name = self.name, self.q2_extra_dest
+-        md_col = super().consume_value(ctx, opts)
++        md_col, _ = super().consume_value(ctx, opts)
+         self.name = backup
+ 
+         if (md_col is None) != (md_file is None):
+@@ -106,9 +106,9 @@ class GeneratedOption(click.Option):
+                                              ctx=ctx, param=self)
+ 
+         if md_col is None and md_file is None:
+-            return None
++            return (None, source)
+         else:
+-            return (md_file, md_col)
++            return ((md_file, md_col), source)
+ 
+     def get_help_record(self, ctx):
+         record = super().get_help_record(ctx)
+@@ -125,28 +125,28 @@ class GeneratedOption(click.Option):
+     def add_to_parser(self, parser, ctx):
+         shared = dict(dest=self.name, nargs=0, obj=self)
+         if self.q2_metadata == 'column':
+-            parser.add_option(self.opts, action='store', dest=self.name,
++            parser.add_option(opts=self.opts, action='store', dest=self.name,
+                               nargs=1, obj=self)
+-            parser.add_option(self.q2_extra_opts, action='store',
++            parser.add_option(opts=self.q2_extra_opts, action='store',
+                               dest=self.q2_extra_dest, nargs=1, obj=self)
+         elif self.is_bool_flag:
+             if self.multiple:
+                 action = 'append_maybe'
+             else:
+                 action = 'store_maybe'
+-            parser.add_option(self.opts, action=action, const=True,
++            parser.add_option(opts=self.opts, action=action, const=True,
+                               **shared)
+-            parser.add_option(self.secondary_opts, action=action,
++            parser.add_option(opts=self.secondary_opts, action=action,
+                               const=False, **shared)
+         elif self.multiple:
+             action = 'append_greedy'
+-            parser.add_option(self.opts, action='append_greedy', **shared)
++            parser.add_option(opts=self.opts, action='append_greedy', **shared)
+         else:
+             super().add_to_parser(parser, ctx)
+ 
+-    def full_process_value(self, ctx, value):
++    def process_value(self, ctx, value):
+         try:
+-            return super().full_process_value(ctx, value)
++            return super().process_value(ctx, value)
+         except click.MissingParameter:
+             if not (self.q2_prefix == 'o'
+                     and ctx.params.get('output_dir', False)):
+diff --git a/q2cli/click/parser.py b/q2cli/click/parser.py
+index d1562f7..155642e 100644
+--- a/q2cli/click/parser.py
++++ b/q2cli/click/parser.py
+@@ -96,8 +96,7 @@ class Q2Parser(parser.OptionParser):
+     # < https://github.com/pallets/click/blob/
+     #   ic6042bf2607c5be22b1efef2e42a94ffd281434c/click/parser.py#L228 >
+     # Copyright (c) 2014 by the Pallets team.
+-    def add_option(self, opts, dest, action=None, nargs=1, const=None,
+-                   obj=None):
++    def add_option(self, obj, opts, dest, action=None, nargs=1, const=None):
+         """Adds a new option named `dest` to the parser.  The destination
+         is not inferred (unlike with optparse) and needs to be explicitly
+         provided.  Action can be any of ``store``, ``store_const``,
+@@ -105,8 +104,6 @@ class Q2Parser(parser.OptionParser):
+         The `obj` can be used to identify the option in the order list
+         that is returned from the parser.
+         """
+-        if obj is None:
+-            obj = dest
+         opts = [parser.normalize_opt(opt, self.ctx) for opt in opts]
+ 
+         # BEGIN MODIFICATIONS
+@@ -123,8 +120,8 @@ class Q2Parser(parser.OptionParser):
+         elif action == 'append_greedy':
+             nargs = 0
+ 
+-        option = Q2Option(opts, dest, action=action, nargs=nargs,
+-                          const=const, obj=obj)
++        option = Q2Option(obj=obj, opts=opts, dest=dest, action=action, nargs=nargs,
++                          const=const)
+         # END MODIFICATIONS
+         self._opt_prefixes.update(option.prefixes)
+         for opt in option._short_opts:


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 call_py3.patch
 inform_zsh_users_howto_set_autocompletion.patch
 bash-completion-with-hashbang.patch
+fix-click8.patch



View it on GitLab: https://salsa.debian.org/med-team/q2cli/-/compare/2b4f5c27bea12427a5407fa4ceb218901c9ef936...e2b2ef081b06b07a92b3bad8ee7a22586d0b2573

-- 
View it on GitLab: https://salsa.debian.org/med-team/q2cli/-/compare/2b4f5c27bea12427a5407fa4ceb218901c9ef936...e2b2ef081b06b07a92b3bad8ee7a22586d0b2573
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220528/0e621a7d/attachment-0001.htm>


More information about the debian-med-commit mailing list