| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent af8679a commit 9fb4645
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,6 @@ Requirements | |||
| 32 | 32 | python-gitlab depends on: | |
| 33 | 33 | ||
| 34 | 34 | * `python-requests <http://docs.python-requests.org/en/latest/>`_ | |
| 35 | - * `six <https://six.readthedocs.io/>`_ | ||
| 36 | 35 | ||
| 37 | 36 | Install with pip | |
| 38 | 37 | ---------------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | import os | |
| 4 | 4 | ||
| 5 | 5 | import jinja2 | |
| 6 | - import six | ||
| 7 | 6 | import sphinx | |
| 8 | 7 | import sphinx.ext.napoleon as napoleon | |
| 9 | 8 | from sphinx.ext.napoleon.docstring import GoogleDocstring | |
@@ -25,7 +24,7 @@ def setup(app): | |||
| 25 | 24 | ||
| 26 | 25 | conf = napoleon.Config._config_values | |
| 27 | 26 | ||
| 28 | - for name, (default, rebuild) in six.iteritems(conf): | ||
| 27 | + for name, (default, rebuild) in conf.items(): | ||
| 29 | 28 | app.add_config_value(name, default, rebuild) | |
| 30 | 29 | return {"version": sphinx.__display_version__, "parallel_read_safe": True} | |
| 31 | 30 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,6 @@ | |||
| 23 | 23 | import warnings | |
| 24 | 24 | ||
| 25 | 25 | import requests | |
| 26 | - import six | ||
| 27 | 26 | ||
| 28 | 27 | import gitlab.config | |
| 29 | 28 | from gitlab.const import * # noqa | |
@@ -47,8 +46,8 @@ | |||
| 47 | 46 | ||
| 48 | 47 | def _sanitize(value): | |
| 49 | 48 | if isinstance(value, dict): | |
| 50 | - return dict((k, _sanitize(v)) for k, v in six.iteritems(value)) | ||
| 51 | - if isinstance(value, six.string_types): | ||
| 49 | + return dict((k, _sanitize(v)) for k, v in value.items()) | ||
| 50 | + if isinstance(value, str): | ||
| 52 | 51 | return value.replace("/", "%2F") | |
| 53 | 52 | return value | |
| 54 | 53 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,8 +16,7 @@ | |||
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | 18 | import os | |
| 19 | - | ||
| 20 | - from six.moves import configparser | ||
| 19 | + import configparser | ||
| 21 | 20 | ||
| 22 | 21 | _DEFAULT_FILES = ["/etc/python-gitlab.cfg", os.path.expanduser("~/.python-gitlab.cfg")] | |
| 23 | 22 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,7 @@ | |||
| 20 | 20 | import os | |
| 21 | 21 | import tempfile | |
| 22 | 22 | import unittest | |
| 23 | + import io | ||
| 23 | 24 | ||
| 24 | 25 | try: | |
| 25 | 26 | from contextlib import redirect_stderr # noqa: H302 | |
@@ -34,8 +35,6 @@ def redirect_stderr(new_target): | |||
| 34 | 35 | sys.stderr = old_target | |
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | - import six | ||
| 38 | - | ||
| 39 | 38 | from gitlab import cli | |
| 40 | 39 | import gitlab.v4.cli | |
| 41 | 40 | ||
@@ -56,7 +55,7 @@ class TestClass(object): | |||
| 56 | 55 | self.assertEqual("class", cli.cls_to_what(Class)) | |
| 57 | 56 | ||
| 58 | 57 | def test_die(self): | |
| 59 | - fl = six.StringIO() | ||
| 58 | + fl = io.StringIO() | ||
| 60 | 59 | with redirect_stderr(fl): | |
| 61 | 60 | with self.assertRaises(SystemExit) as test: | |
| 62 | 61 | cli.die("foobar") | |
@@ -83,7 +82,7 @@ def test_parse_value(self): | |||
| 83 | 82 | self.assertEqual(ret, "content") | |
| 84 | 83 | os.unlink(temp_path) | |
| 85 | 84 | ||
| 86 | - fl = six.StringIO() | ||
| 85 | + fl = io.StringIO() | ||
| 87 | 86 | with redirect_stderr(fl): | |
| 88 | 87 | with self.assertRaises(SystemExit) as exc: | |
| 89 | 88 | cli._parse_value("@/thisfileprobablydoesntexist") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | import unittest | |
| 19 | 19 | ||
| 20 | 20 | import mock | |
| 21 | - import six | ||
| 21 | + import io | ||
| 22 | 22 | ||
| 23 | 23 | from gitlab import config | |
| 24 | 24 | ||
@@ -80,26 +80,26 @@ def test_missing_config(self, path_exists): | |||
| 80 | 80 | config.GitlabConfigParser("test") | |
| 81 | 81 | ||
| 82 | 82 | @mock.patch("os.path.exists") | |
| 83 | - @mock.patch("six.moves.builtins.open") | ||
| 83 | + @mock.patch("builtins.open") | ||
| 84 | 84 | def test_invalid_id(self, m_open, path_exists): | |
| 85 | - fd = six.StringIO(no_default_config) | ||
| 85 | + fd = io.StringIO(no_default_config) | ||
| 86 | 86 | fd.close = mock.Mock(return_value=None) | |
| 87 | 87 | m_open.return_value = fd | |
| 88 | 88 | path_exists.return_value = True | |
| 89 | 89 | config.GitlabConfigParser("there") | |
| 90 | 90 | self.assertRaises(config.GitlabIDError, config.GitlabConfigParser) | |
| 91 | 91 | ||
| 92 | - fd = six.StringIO(valid_config) | ||
| 92 | + fd = io.StringIO(valid_config) | ||
| 93 | 93 | fd.close = mock.Mock(return_value=None) | |
| 94 | 94 | m_open.return_value = fd | |
| 95 | 95 | self.assertRaises( | |
| 96 | 96 | config.GitlabDataError, config.GitlabConfigParser, gitlab_id="not_there" | |
| 97 | 97 | ) | |
| 98 | 98 | ||
| 99 | 99 | @mock.patch("os.path.exists") | |
| 100 | - @mock.patch("six.moves.builtins.open") | ||
| 100 | + @mock.patch("builtins.open") | ||
| 101 | 101 | def test_invalid_data(self, m_open, path_exists): | |
| 102 | - fd = six.StringIO(missing_attr_config) | ||
| 102 | + fd = io.StringIO(missing_attr_config) | ||
| 103 | 103 | fd.close = mock.Mock(return_value=None, side_effect=lambda: fd.seek(0)) | |
| 104 | 104 | m_open.return_value = fd | |
| 105 | 105 | path_exists.return_value = True | |
@@ -117,9 +117,9 @@ def test_invalid_data(self, m_open, path_exists): | |||
| 117 | 117 | self.assertEqual("Unsupported per_page number: 200", emgr.exception.args[0]) | |
| 118 | 118 | ||
| 119 | 119 | @mock.patch("os.path.exists") | |
| 120 | - @mock.patch("six.moves.builtins.open") | ||
| 120 | + @mock.patch("builtins.open") | ||
| 121 | 121 | def test_valid_data(self, m_open, path_exists): | |
| 122 | - fd = six.StringIO(valid_config) | ||
| 122 | + fd = io.StringIO(valid_config) | ||
| 123 | 123 | fd.close = mock.Mock(return_value=None) | |
| 124 | 124 | m_open.return_value = fd | |
| 125 | 125 | path_exists.return_value = True | |
@@ -133,7 +133,7 @@ def test_valid_data(self, m_open, path_exists): | |||
| 133 | 133 | self.assertEqual(True, cp.ssl_verify) | |
| 134 | 134 | self.assertIsNone(cp.per_page) | |
| 135 | 135 | ||
| 136 | - fd = six.StringIO(valid_config) | ||
| 136 | + fd = io.StringIO(valid_config) | ||
| 137 | 137 | fd.close = mock.Mock(return_value=None) | |
| 138 | 138 | m_open.return_value = fd | |
| 139 | 139 | cp = config.GitlabConfigParser(gitlab_id="two") | |
@@ -144,7 +144,7 @@ def test_valid_data(self, m_open, path_exists): | |||
| 144 | 144 | self.assertEqual(10, cp.timeout) | |
| 145 | 145 | self.assertEqual(False, cp.ssl_verify) | |
| 146 | 146 | ||
| 147 | - fd = six.StringIO(valid_config) | ||
| 147 | + fd = io.StringIO(valid_config) | ||
| 148 | 148 | fd.close = mock.Mock(return_value=None) | |
| 149 | 149 | m_open.return_value = fd | |
| 150 | 150 | cp = config.GitlabConfigParser(gitlab_id="three") | |
@@ -156,7 +156,7 @@ def test_valid_data(self, m_open, path_exists): | |||
| 156 | 156 | self.assertEqual("/path/to/CA/bundle.crt", cp.ssl_verify) | |
| 157 | 157 | self.assertEqual(50, cp.per_page) | |
| 158 | 158 | ||
| 159 | - fd = six.StringIO(valid_config) | ||
| 159 | + fd = io.StringIO(valid_config) | ||
| 160 | 160 | fd.close = mock.Mock(return_value=None) | |
| 161 | 161 | m_open.return_value = fd | |
| 162 | 162 | cp = config.GitlabConfigParser(gitlab_id="four") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ | |||
| 15 | 15 | # You should have received a copy of the GNU Lesser General Public License | |
| 16 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | 17 | ||
| 18 | - import six | ||
| 18 | + from urllib.parse import urlparse | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | class _StdoutStream(object): | |
@@ -52,6 +52,6 @@ def clean_str_id(id): | |||
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | 54 | def sanitized_url(url): | |
| 55 | - parsed = six.moves.urllib.parse.urlparse(url) | ||
| 55 | + parsed = urlparse(url) | ||
| 56 | 56 | new_path = parsed.path.replace(".", "%2E") | |
| 57 | 57 | return parsed._replace(path=new_path).geturl() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,8 +21,6 @@ | |||
| 21 | 21 | import operator | |
| 22 | 22 | import sys | |
| 23 | 23 | ||
| 24 | - import six | ||
| 25 | - | ||
| 26 | 24 | import gitlab | |
| 27 | 25 | import gitlab.base | |
| 28 | 26 | from gitlab import cli | |
@@ -321,7 +319,7 @@ def extend_parser(parser): | |||
| 321 | 319 | ||
| 322 | 320 | ||
| 323 | 321 | def get_dict(obj, fields): | |
| 324 | - if isinstance(obj, six.string_types): | ||
| 322 | + if isinstance(obj, str): | ||
| 325 | 323 | return obj | |
| 326 | 324 | ||
| 327 | 325 | if fields: | |
@@ -441,7 +439,7 @@ def run(gl, what, action, args, verbose, output, fields): | |||
| 441 | 439 | printer.display_list(data, fields, verbose=verbose) | |
| 442 | 440 | elif isinstance(data, gitlab.base.RESTObject): | |
| 443 | 441 | printer.display(get_dict(data, fields), verbose=verbose, obj=data) | |
| 444 | - elif isinstance(data, six.string_types): | ||
| 442 | + elif isinstance(data, str): | ||
| 445 | 443 | print(data) | |
| 446 | 444 | elif hasattr(data, "decode"): | |
| 447 | 445 | print(data.decode()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,2 +1 @@ | |||
| 1 | 1 | requests>=2.22.0 | |
| 2 | - six | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ def get_version(): | |||
| 25 | 25 | license="LGPLv3", | |
| 26 | 26 | url="https://github.com/python-gitlab/python-gitlab", | |
| 27 | 27 | packages=find_packages(), | |
| 28 | - install_requires=["requests>=2.22.0", "six"], | ||
| 28 | + install_requires=["requests>=2.22.0"], | ||
| 29 | 29 | entry_points={"console_scripts": ["gitlab = gitlab.cli:main"]}, | |
| 30 | 30 | classifiers=[ | |
| 31 | 31 | "Development Status :: 5 - Production/Stable", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments