Skip to content

Commit 404ea04

Browse files
authored
Merge pull request sigmavirus24#1015 from sigmavirus24/remove-unicode-handling
Remove unicode legacy code
2 parents 5766ecd + b28febf commit 404ea04

Some content is hidden

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

45 files changed

+13
-69
lines changed

docs/source/conf.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
master_doc = 'index'
4646

4747
# General information about the project.
48-
project = u'github3.py'
49-
copyright = u'2012-2018 - Ian Stapleton Cordasco'
48+
project = 'github3.py'
49+
copyright = '2012-2021 - Ian Stapleton Cordasco'
5050

5151
# The version info for the project you're documenting, acts as replacement for
5252
# |version| and |release|, also used in various other places throughout the
@@ -186,8 +186,8 @@
186186
# Grouping the document tree into LaTeX files. List of tuples
187187
# (source start file, target name, title, author, documentclass [howto/manual]).
188188
latex_documents = [
189-
('index', 'github3.py.tex', u'github3.py Documentation',
190-
u'Ian Cordasco', 'manual'),
189+
('index', 'github3.py.tex', 'github3.py Documentation',
190+
'Ian Cordasco', 'manual'),
191191
]
192192

193193
# The name of an image file (relative to this directory) to place at the top of
@@ -219,8 +219,8 @@
219219
# One entry per manual page. List of tuples
220220
# (source start file, name, description, authors, manual section).
221221
man_pages = [
222-
('index', 'github3.py', u'github3.py Documentation',
223-
[u'Ian Cordasco'], 1)
222+
('index', 'github3.py', 'github3.py Documentation',
223+
['Ian Cordasco'], 1)
224224
]
225225

226226
# If true, show URL addresses after external links.
@@ -232,7 +232,7 @@
232232
# (source start file, target name, title, author,
233233
# dir menu entry, description, category)
234234
texinfo_documents = [
235-
('index', 'github3.py', u'github3.py Documentation', u'Ian Cordasco',
235+
('index', 'github3.py', 'github3.py Documentation', 'Ian Cordasco',
236236
'github3.py', 'Wrapper for GitHub API v3', 'Miscellaneous'),
237237
]
238238

docs/source/release-notes/2.0.0.rst

+4-2

src/github3/auths.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the Authorization object."""
3-
from __future__ import unicode_literals
4-
53
from .decorators import requires_basic_auth
64
from .models import GitHubCore
75

src/github3/checks.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains all the classes relating to Checks."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from . import decorators

src/github3/events.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the classes related to Events."""
3-
from __future__ import unicode_literals
4-
53
import copy
64

75
from . import models

src/github3/gists/comment.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing the logic for a GistComment."""
3-
from __future__ import unicode_literals
4-
53
from .. import decorators
64
from .. import models
75
from .. import users

src/github3/gists/file.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing the GistFile object."""
3-
from __future__ import unicode_literals
4-
53
from .. import models
64

75

src/github3/gists/gist.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the Gist, ShortGist, and GistFork objects."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from .. import models

src/github3/gists/history.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing the GistHistory object."""
3-
from __future__ import unicode_literals
4-
53
from .. import models
64
from .. import users
75

src/github3/git.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
See also: http://developer.github.com/v3/git/
66
"""
7-
from __future__ import unicode_literals
87
import base64
98

109
from json import dumps

src/github3/github.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the main interfaces to the API."""
3-
from __future__ import unicode_literals
4-
53
import json
64
import re
75

src/github3/issues/comment.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module with class(es) representing issue comments."""
3-
from __future__ import unicode_literals
4-
53
from .. import decorators
64
from .. import models
75
from .. import users

src/github3/issues/event.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Issue events logic."""
3-
from __future__ import unicode_literals
4-
53
from .. import users
64
from ..models import GitHubCore
75

src/github3/issues/issue.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing the Issue logic."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from uritemplate import URITemplate

src/github3/issues/label.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing the logic for labels."""
3-
from __future__ import unicode_literals
43

54
from json import dumps
65
from ..decorators import requires_auth

src/github3/issues/milestone.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
32

43
from json import dumps
54

src/github3/licenses.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
55
See also: https://developer.github.com/v3/licenses/
66
"""
7-
from __future__ import unicode_literals
8-
97
import base64
108

119
from . import models

src/github3/models.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module provides the basic models used in github3.py."""
3-
from __future__ import unicode_literals
4-
53
import json as jsonlib
64
import logging
75

src/github3/notifications.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
55
See also: http://developer.github.com/v3/activity/notifications/
66
"""
7-
from __future__ import unicode_literals
8-
97
from json import dumps
108
from . import models
119

src/github3/orgs.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains all of the classes related to organizations."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from uritemplate import URITemplate

src/github3/pulls.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains all the classes relating to pull requests."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from uritemplate import URITemplate

src/github3/repos/branch.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Implementation of a branch on a repository."""
3-
from __future__ import unicode_literals
43

54
from . import commit
65
from .. import decorators

src/github3/repos/comment.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the RepoComment class."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65
from .. import users

src/github3/repos/commit.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the RepoCommit classes."""
3-
from __future__ import unicode_literals
43

54
from . import status
65
from .. import checks, git, models, users

src/github3/repos/comparison.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the Comparison object."""
3-
from __future__ import unicode_literals
43

54
from . import commit
65
from .. import models

src/github3/repos/contents.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the Contents object."""
3-
from __future__ import unicode_literals
43

54
from base64 import b64decode, b64encode
65
from json import dumps

src/github3/repos/deployment.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""The module containing deployment logic."""
3-
from __future__ import unicode_literals
43

54
from .. import users
65

src/github3/repos/hook.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains only the Hook object for GitHub's Hook API."""
3-
from __future__ import unicode_literals
43

54
from json import dumps
65
from ..decorators import requires_auth

src/github3/repos/invitation.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Invitation related logic."""
3-
from __future__ import unicode_literals
43

54
from json import dumps
65

src/github3/repos/pages.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""GitHub Pages related logic."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65

src/github3/repos/release.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Release logic for the GitHub API."""
3-
from __future__ import unicode_literals
43

54
import json
65

src/github3/repos/repo.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
returned by GitHub.
66
77
"""
8-
from __future__ import unicode_literals
98

109
import base64
1110
import json as jsonlib

src/github3/repos/stats.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Repository and contributor stats logic."""
3-
from __future__ import unicode_literals
43

54
import datetime
65

src/github3/repos/status.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the Status object for GitHub's commit status API."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65
from .. import users

src/github3/repos/tag.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains the RepoTag object for GitHub's tag API."""
3-
from __future__ import unicode_literals
43

54
from . import commit
65
from .. import models

src/github3/repos/topics.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Topics related logic."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65

src/github3/repos/traffic.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Repository traffic stats logic."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65

src/github3/search/code.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Code search results implementation."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65
from .. import repos

src/github3/search/commit.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Commit search results implementation."""
3-
from __future__ import unicode_literals
43

54
from .. import git
65
from .. import models

src/github3/search/issue.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Issue search results implementation."""
3-
from __future__ import unicode_literals
43

54
from ..models import GitHubCore
65
from ..issues import ShortIssue

src/github3/search/repository.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""Repository search results implementation."""
3-
from __future__ import unicode_literals
43

54
from .. import models
65
from .. import repos

src/github3/search/user.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
32

43
from .. import users
54
from ..models import GitHubCore

src/github3/users.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
22
"""This module contains everything relating to Users."""
3-
from __future__ import unicode_literals
4-
53
from json import dumps
64

75
from github3.auths import Authorization

tests/integration/helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def setUp(self):
2323
self.token = os.environ.get("GH_AUTH", "x" * 20)
2424
self.app_id = int(os.environ.get("GH_APP_ID", "0"))
2525
self.private_key_bytes = os.environ.get(
26-
"GH_APP_PRIVATE_KEY", u""
26+
"GH_APP_PRIVATE_KEY", ""
2727
).encode("utf8")
2828
self.app_installation_id = int(
2929
os.environ.get("GH_APP_INSTALLATION_ID", "0")

tests/unit/test_issues_issue.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def test_close_with_unicode_labels(self):
159159
"body": "issue body",
160160
"assignee": "sigmavirus24",
161161
"state": "closed",
162-
"labels": [u"标签1", u"标签2"],
162+
"labels": ["标签1", "标签2"],
163163
}
164164
self.instance.edit(**data)
165165
self.patch_called_with(url_for(), data=data)

0 commit comments

Comments
 (0)