Skip to content

Commit 442d783

Browse files
jmeridthpre-commit-ci[bot]sigmavirus24
authored
Switch to isort from reorder-python-imports
* chore: switch to isort from reorder python imports - [x] keep it simple with just `--profile black` argument - [x] update pull_request_template when asking for python-dateutil version - some engineers don't know to prefix `dateutil` with `python-` This is a premptive strike on sigmavirus24#1172 fix Signed-off-by: jmeridth <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: add line-length to isort to match black re-run black, hopefully get us to a non-conflict Signed-off-by: jmeridth <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use isort config to reduce churn --------- Signed-off-by: jmeridth <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ian Stapleton Cordasco <[email protected]>
1 parent 15df624 commit 442d783

File tree

111 files changed

+212
-129
lines changed

Some content is hidden

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

111 files changed

+212
-129
lines changed

.github/pull_request_template.md

+1-1

.pre-commit-config.yaml

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ repos:
1313
- id: trailing-whitespace
1414
types: [text]
1515
stages: [commit, push, manual]
16-
- repo: https://github.com/asottile/reorder-python-imports
17-
rev: v3.12.0
16+
- repo: https://github.com/PyCQA/isort
17+
rev: 5.13.2
1818
hooks:
19-
- id: reorder-python-imports
20-
args: [--application-directories, '.:src', --py37-plus]
19+
- id: isort
2120
- repo: https://github.com/psf/black
2221
rev: 23.12.1
2322
hooks:

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ exclude = [
9393
"^docs/",
9494
"^tests/",
9595
]
96+
97+
[tool.isort]
98+
profile = "black"
99+
line_length = 78
100+
force_single_line = true

src/github3/__about__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The module that holds much of the metadata about github3.py."""
2+
23
__package_name__ = "github3.py"
34
__title__ = "github3"
45
__author__ = "Ian Stapleton Cordasco"

src/github3/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: Modified BSD, see LICENSE for more details
99
1010
"""
11+
1112
from .__about__ import __author__
1213
from .__about__ import __author_email__
1314
from .__about__ import __copyright__

src/github3/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:license: Modified BSD, see LICENSE for more details
77
88
"""
9+
910
from .github import GitHub
1011
from .github import GitHubEnterprise
1112

src/github3/apps.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
https://developer.github.com/apps/building-github-apps/
44
"""
5+
56
import time
67

78
import jwt

src/github3/auths.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the Authorization object."""
2+
23
from .decorators import requires_basic_auth
34
from .models import GitHubCore
45

src/github3/checks.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains all the classes relating to Checks."""
2+
23
from json import dumps
34

45
from . import decorators

src/github3/decorators.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module provides decorators to the rest of the library."""
2+
23
import os
34
from functools import wraps
45
from io import BytesIO as StringIO

src/github3/events.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the classes related to Events."""
2+
23
import copy
34

45
from . import models

src/github3/gists/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
1313
See also: http://developer.github.com/v3/gists/
1414
"""
15+
1516
from .gist import Gist
1617
from .gist import ShortGist
1718

src/github3/gists/comment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the logic for a GistComment."""
2+
23
from .. import decorators
34
from .. import models
45
from .. import users

src/github3/gists/file.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the GistFile object."""
2+
23
from .. import models
34

45

src/github3/gists/gist.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""This module contains the Gist, ShortGist, and GistFork objects."""
2+
23
import typing as t
34
from json import dumps
45

5-
from . import comment
6-
from . import file as gistfile
7-
from . import history
86
from .. import models
97
from .. import users
108
from ..decorators import requires_auth
9+
from . import comment
10+
from . import file as gistfile
11+
from . import history
1112

1213

1314
class _Gist(models.GitHubCore):

src/github3/gists/history.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the GistHistory object."""
2+
23
from .. import models
34
from .. import users
45

src/github3/git.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
See also: http://developer.github.com/v3/git/
55
"""
6+
67
import base64
78
from json import dumps
89

src/github3/github.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the main interfaces to the API."""
2+
23
import json
34
import re
45
import typing as t
@@ -28,7 +29,6 @@
2829
from .repos import invitation
2930
from .repos import repo
3031

31-
3232
_pubsub_re = re.compile(
3333
r"https?://[\w\d\-\.\:]+/\w[\w-]+\w/[\w\._-]+/events/\w+"
3434
)

src/github3/issues/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
See also: http://developer.github.com/v3/issues/
88
"""
9+
910
from ..utils import timestamp_parameter
1011
from .issue import Issue
1112
from .issue import ShortIssue

src/github3/issues/comment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module with class(es) representing issue comments."""
2+
23
from .. import decorators
34
from .. import models
45
from .. import users

src/github3/issues/event.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Issue events logic."""
2+
23
from .. import users
34
from ..models import GitHubCore
45

src/github3/issues/issue.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
"""Module containing the Issue logic."""
2+
23
from json import dumps
34

45
from uritemplate import URITemplate # type: ignore
56

7+
from .. import models
8+
from .. import users
9+
from ..decorators import requires_auth
610
from . import comment
711
from . import event
812
from . import label
913
from . import milestone
10-
from .. import models
11-
from .. import users
12-
from ..decorators import requires_auth
1314

1415

1516
class _Issue(models.GitHubCore):

src/github3/issues/label.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the logic for labels."""
2+
23
from json import dumps
34

45
from ..decorators import requires_auth

src/github3/issues/milestone.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from json import dumps
22

3-
from . import label
43
from .. import users
54
from ..decorators import requires_auth
65
from ..models import GitHubCore
6+
from . import label
77

88

99
class Milestone(GitHubCore):

src/github3/licenses.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
See also: https://developer.github.com/v3/licenses/
55
"""
6+
67
import base64
78

89
from . import models

src/github3/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module provides the basic models used in github3.py."""
2+
23
import json as jsonlib
34
import logging
45
import typing as t
@@ -9,7 +10,6 @@
910
from . import exceptions
1011
from . import session
1112

12-
1313
if t.TYPE_CHECKING:
1414
from . import structs
1515

src/github3/notifications.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
See also: http://developer.github.com/v3/activity/notifications/
55
"""
6+
67
from json import dumps
78

89
from . import models

src/github3/orgs.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains all of the classes related to organizations."""
2+
23
import typing as t
34
from json import dumps
45

src/github3/projects.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains all the classes relating to projects."""
2+
23
from json import dumps
34

45
from . import exceptions

src/github3/pulls.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains all the classes relating to pull requests."""
2+
23
from json import dumps
34

45
from uritemplate import URITemplate # type: ignore

src/github3/repos/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
See also: http://developer.github.com/v3/repos/
88
"""
9+
910
from .repo import Repository
1011
from .repo import ShortRepository
1112
from .repo import StarredRepository

src/github3/repos/branch.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
"""Implementation of a branch on a repository."""
2+
23
import typing as t
34

4-
from . import commit
55
from .. import decorators
66
from .. import models
7+
from . import commit
78

89
if t.TYPE_CHECKING:
910
from .. import apps as tapps
10-
from .. import users as tusers
1111
from .. import orgs
12+
from .. import users as tusers
1213

1314

1415
class _Branch(models.GitHubCore):
@@ -603,7 +604,9 @@ class ProtectionRestrictions(models.GitHubCore):
603604
"""
604605

605606
def _update_attributes(self, protection):
606-
from .. import apps, orgs, users
607+
from .. import apps
608+
from .. import orgs
609+
from .. import users
607610

608611
self._api = protection["url"]
609612
self.users_url = protection["users_url"]

src/github3/repos/comment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the RepoComment class."""
2+
23
from .. import models
34
from .. import users
45
from ..decorators import requires_auth

src/github3/repos/commit.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""This module contains the RepoCommit classes."""
2-
from . import status
2+
33
from .. import checks
44
from .. import git
55
from .. import models
66
from .. import users
7+
from . import status
78
from .comment import RepoComment
89

910

src/github3/repos/comparison.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""This module contains the Comparison object."""
2-
from . import commit
2+
33
from .. import models
4+
from . import commit
45

56

67
class Comparison(models.GitHubCore):

src/github3/repos/contents.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the Contents object."""
2+
23
from base64 import b64decode
34
from base64 import b64encode
45
from json import dumps

src/github3/repos/deployment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The module containing deployment logic."""
2+
23
from .. import users
34
from ..models import GitHubCore
45

src/github3/repos/hook.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains only the Hook object for GitHub's Hook API."""
2+
23
from json import dumps
34

45
from ..decorators import requires_auth

src/github3/repos/invitation.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Invitation related logic."""
2+
23
from json import dumps
34

45
from .. import models

src/github3/repos/issue_import.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module contains the logic for GitHub's import issue API."""
2+
23
from .. import models
34

45

src/github3/repos/pages.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""GitHub Pages related logic."""
2+
23
from .. import models
34

45

src/github3/repos/release.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Release logic for the GitHub API."""
2+
23
import json
34

45
from uritemplate import URITemplate # type: ignore

0 commit comments

Comments
 (0)