From 45d1cd59d39227ee6841042eab85116a59a26d22 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Thu, 11 Mar 2021 16:35:24 +0100 Subject: Remove support for Python 3.5 --- git/cmd.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index ec630d93..72ec0381 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -17,9 +17,7 @@ from subprocess import ( import subprocess import sys import threading -from collections import OrderedDict from textwrap import dedent -import warnings from git.compat import ( defenc, @@ -903,13 +901,6 @@ class Git(LazyMixin): def transform_kwargs(self, split_single_char_options=True, **kwargs): """Transforms Python style kwargs into git command line options.""" - # Python 3.6 preserves the order of kwargs and thus has a stable - # order. For older versions sort the kwargs by the key to get a stable - # order. - if sys.version_info[:2] < (3, 6): - kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) - warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" + - "It does not preserve the order for key-word arguments and enforce lexical sorting instead.") args = [] for k, v in kwargs.items(): if isinstance(v, (list, tuple)): -- cgit v1.2.1 From 820d3cc9ceda3e5690d627677883b7f9d349b326 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 16 Jun 2021 11:22:27 +0800 Subject: Revert "Remove support for Python 3.5" - fix CI for now. This reverts commit 45d1cd59d39227ee6841042eab85116a59a26d22. See #1201 which will hopefully help to get a proper fix soon. --- git/cmd.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 4f58b314..d8b82352 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -17,7 +17,9 @@ from subprocess import ( import subprocess import sys import threading +from collections import OrderedDict from textwrap import dedent +import warnings from git.compat import ( defenc, @@ -1003,6 +1005,13 @@ class Git(LazyMixin): def transform_kwargs(self, split_single_char_options: bool = True, **kwargs: Any) -> List[str]: """Transforms Python style kwargs into git command line options.""" + # Python 3.6 preserves the order of kwargs and thus has a stable + # order. For older versions sort the kwargs by the key to get a stable + # order. + if sys.version_info[:2] < (3, 6): + kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) + warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" + + "It does not preserve the order for key-word arguments and enforce lexical sorting instead.") args = [] for k, v in kwargs.items(): if isinstance(v, (list, tuple)): -- cgit v1.2.1 From b0f79c58ad919e90261d1e332df79a4ad0bc40de Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 16 Jun 2021 11:27:07 +0800 Subject: Revert "Revert "Remove support for Python 3.5" - fix CI for now." This reverts commit 820d3cc9ceda3e5690d627677883b7f9d349b326. --- git/cmd.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index d8b82352..4f58b314 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -17,9 +17,7 @@ from subprocess import ( import subprocess import sys import threading -from collections import OrderedDict from textwrap import dedent -import warnings from git.compat import ( defenc, @@ -1005,13 +1003,6 @@ class Git(LazyMixin): def transform_kwargs(self, split_single_char_options: bool = True, **kwargs: Any) -> List[str]: """Transforms Python style kwargs into git command line options.""" - # Python 3.6 preserves the order of kwargs and thus has a stable - # order. For older versions sort the kwargs by the key to get a stable - # order. - if sys.version_info[:2] < (3, 6): - kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) - warnings.warn("Python 3.5 support is deprecated and will be removed 2021-09-05.\n" + - "It does not preserve the order for key-word arguments and enforce lexical sorting instead.") args = [] for k, v in kwargs.items(): if isinstance(v, (list, tuple)): -- cgit v1.2.1