Skip to content

Commit

Permalink
python, cli: drop six dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Oct 14, 2024
1 parent c10241e commit 5f25fbc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
7 changes: 3 additions & 4 deletions cli/copr_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import warnings
from collections import defaultdict

import six
import requests

try:
Expand All @@ -39,10 +38,10 @@
from .build_config import MockProfile


if six.PY2:
from urlparse import urljoin, urlparse
else:
try:
from urllib.parse import urljoin, urlparse
except ImportError:
from urlparse import urljoin, urlparse

log = logging.getLogger(__name__)

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/cli_tests_lib.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import six

# pylint: disable=ungrouped-imports
if six.PY3:
try:
from unittest import mock
from unittest.mock import MagicMock
from pytest import fixture
else:
except ImportError:
import mock
from mock import MagicMock
from pytest import yield_fixture as fixture
Expand All @@ -18,6 +16,7 @@
"token": "abc",
}


@fixture
def f_test_config():
with mock.patch('copr_cli.main.config_from_file',
Expand Down
2 changes: 0 additions & 2 deletions cli/tests/test_mock_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

from copr_cli import main

import six

from cli_tests_lib import mock, f_test_config, fixture


Expand Down
7 changes: 2 additions & 5 deletions python/copr/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
"""

import os
import six


path = os.path.abspath(__file__)
dir_path = os.path.dirname(path)
resource_location = os.path.join(dir_path, "resources")
config_location = os.path.join(resource_location, "copr_cli.conf")

# We need to maintain python2 compatibility for EPEL7
if six.PY3:
try:
from unittest import mock
else:
except ImportError:
import mock
6 changes: 0 additions & 6 deletions python/python-copr.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ BuildRequires: util-linux
BuildRequires: python-setuptools
BuildRequires: python-requests
BuildRequires: python-requests-toolbelt
BuildRequires: python-six >= 1.9.0
BuildRequires: python-mock
BuildRequires: python-munch
BuildRequires: python-filelock
Expand All @@ -44,7 +43,6 @@ BuildRequires: python-docutils
BuildRequires: python2-setuptools
BuildRequires: python2-requests
BuildRequires: python2-requests-toolbelt
BuildRequires: python2-six >= 1.9.0
BuildRequires: python2-pytest
BuildRequires: python2-devel
BuildRequires: python-munch
Expand Down Expand Up @@ -81,7 +79,6 @@ Requires: python-requests
Requires: python-requests-toolbelt
Requires: python-requests-gssapi
Requires: python-setuptools
Requires: python-six >= 1.9.0
%else
Requires: python2-configparser
Requires: python2-munch
Expand All @@ -90,7 +87,6 @@ Requires: python2-requests
Requires: python2-requests-toolbelt
Requires: python2-setuptools
Requires: python2-requests-gssapi
Requires: python2-six >= 1.9.0
%endif

%{?python_provide:%python_provide python2-copr}
Expand All @@ -114,7 +110,6 @@ BuildRequires: python3-pytest
BuildRequires: python3-setuptools
BuildRequires: python3-requests
BuildRequires: python3-requests-toolbelt
BuildRequires: python3-six
BuildRequires: python3-sphinx
BuildRequires: python3-requests-gssapi

Expand All @@ -123,7 +118,6 @@ Requires: python3-filelock
Requires: python3-requests
Requires: python3-requests-toolbelt
Requires: python3-setuptools
Requires: python3-six
Requires: python3-requests-gssapi

%{?python_provide:%python_provide python3-copr}
Expand Down
1 change: 0 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
'requests',
'requests-toolbelt',
'setuptools',
'six',
'munch',
]

Expand Down

0 comments on commit 5f25fbc

Please sign in to comment.