Skip to content

Commit 7824811

Browse files
authored
Merge pull request #1463 from JohnVillalovos/jlvillal/isort
chore: add isort as a checker
2 parents 1508eb7 + f3afd34 commit 7824811

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+96
-143
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ jobs:
3232
run: tox -e pep8
3333
- name: Run mypy static typing checker (http://mypy-lang.org/)
3434
run: tox -e mypy
35+
- name: Run isort import order checker (https://pycqa.github.io/isort/)
36+
run: tox -e isort -- --check

gitlab/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@
3131
from gitlab.const import * # noqa: F401,F403
3232
from gitlab.exceptions import * # noqa: F401,F403
3333

34-
3534
warnings.filterwarnings("default", category=DeprecationWarning, module="^gitlab")

gitlab/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import gitlab.cli
22

3-
43
if __name__ == "__main__":
54
gitlab.cli.main()

gitlab/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
from types import ModuleType
2020
from typing import Any, Dict, Iterable, NamedTuple, Optional, Tuple, Type
2121

22-
from .client import Gitlab, GitlabList
2322
from gitlab import types as g_types
2423

24+
from .client import Gitlab, GitlabList
25+
2526
__all__ = [
2627
"RequiredOptional",
2728
"RESTObject",

gitlab/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import gitlab.config
2929
from gitlab.base import RESTObject
3030

31-
3231
# This regex is based on:
3332
# https://github.com/jpvanhal/inflection/blob/master/inflection/__init__.py
3433
camel_upperlower_regex = re.compile(r"([A-Z]+)([A-Z][a-z])")

gitlab/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@
1717
"""Wrapper for the GitLab API."""
1818

1919
import time
20-
from typing import cast, Any, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
20+
from typing import Any, cast, Dict, List, Optional, Tuple, TYPE_CHECKING, Union
2121

2222
import requests
2323
import requests.utils
24+
from requests_toolbelt.multipart.encoder import MultipartEncoder # type: ignore
2425

2526
import gitlab.config
2627
import gitlab.const
2728
import gitlab.exceptions
2829
from gitlab import utils
29-
from requests_toolbelt.multipart.encoder import MultipartEncoder # type: ignore
30-
3130

3231
REDIRECT_MSG = (
3332
"python-gitlab detected an http to https redirection. You "
@@ -385,7 +384,6 @@ def _set_auth_info(self) -> None:
385384

386385
def enable_debug(self) -> None:
387386
import logging
388-
389387
from http.client import HTTPConnection # noqa
390388

391389
HTTPConnection.debuglevel = 1 # type: ignore

gitlab/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18-
import os
1918
import configparser
19+
import os
2020
import shlex
2121
import subprocess
22-
from typing import List, Optional, Union
2322
from os.path import expanduser, expandvars
23+
from typing import List, Optional, Union
2424

2525
from gitlab.const import USER_AGENT
2626

gitlab/const.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from gitlab.__version__ import __title__, __version__
1919

20-
2120
NO_ACCESS: int = 0
2221
MINIMAL_ACCESS: int = 5
2322
GUEST_ACCESS: int = 10

gitlab/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import functools
19-
from typing import Any, Callable, cast, Optional, Type, TypeVar, TYPE_CHECKING, Union
19+
from typing import Any, Callable, cast, Optional, Type, TYPE_CHECKING, TypeVar, Union
2020

2121

2222
class GitlabError(Exception):

gitlab/mixins.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# You should have received a copy of the GNU Lesser General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18+
import warnings
1819
from types import ModuleType
1920
from typing import (
2021
Any,
@@ -31,12 +32,10 @@
3132
import requests
3233

3334
import gitlab
34-
from gitlab import base
35-
from gitlab import cli
35+
from gitlab import base, cli
3636
from gitlab import exceptions as exc
3737
from gitlab import types as g_types
3838
from gitlab import utils
39-
import warnings
4039

4140
__all__ = [
4241
"GetMixin",

0 commit comments

Comments
 (0)