diff --git a/docs/source/conf.py b/docs/source/conf.py index e8efc4203..9baacc071 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,8 +45,8 @@ master_doc = 'index' # General information about the project. -project = u'github3.py' -copyright = u'2012-2018 - Ian Stapleton Cordasco' +project = 'github3.py' +copyright = '2012-2021 - Ian Stapleton Cordasco' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -186,8 +186,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'github3.py.tex', u'github3.py Documentation', - u'Ian Cordasco', 'manual'), + ('index', 'github3.py.tex', 'github3.py Documentation', + 'Ian Cordasco', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -219,8 +219,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'github3.py', u'github3.py Documentation', - [u'Ian Cordasco'], 1) + ('index', 'github3.py', 'github3.py Documentation', + ['Ian Cordasco'], 1) ] # If true, show URL addresses after external links. @@ -232,7 +232,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'github3.py', u'github3.py Documentation', u'Ian Cordasco', + ('index', 'github3.py', 'github3.py Documentation', 'Ian Cordasco', 'github3.py', 'Wrapper for GitHub API v3', 'Miscellaneous'), ] diff --git a/docs/source/release-notes/2.0.0.rst b/docs/source/release-notes/2.0.0.rst index 33c755df9..c0962ab20 100644 --- a/docs/source/release-notes/2.0.0.rst +++ b/docs/source/release-notes/2.0.0.rst @@ -1,4 +1,4 @@ -2.0.0: 2020-01-02 +2.0.0: 2020-01-06 ----------------- Features Added @@ -13,7 +13,9 @@ Features Added Removals ```````` -Removal of already deprecated code on version 1.x: +* Removal of legacy unicode future imports. + +* Removal of already deprecated code on version 1.x: - ``github3.api.all_events`` use ``github.GitHub.all_events`` - ``github3.api.all_repositories`` use ``github.GitHub.all_repositories`` diff --git a/src/github3/auths.py b/src/github3/auths.py index 687c3d9fe..57b31eaf3 100644 --- a/src/github3/auths.py +++ b/src/github3/auths.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the Authorization object.""" -from __future__ import unicode_literals - from .decorators import requires_basic_auth from .models import GitHubCore diff --git a/src/github3/checks.py b/src/github3/checks.py index 657fbf4bb..de70bae8e 100644 --- a/src/github3/checks.py +++ b/src/github3/checks.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains all the classes relating to Checks.""" -from __future__ import unicode_literals - from json import dumps from . import decorators diff --git a/src/github3/events.py b/src/github3/events.py index 62d566f55..cc065de7e 100644 --- a/src/github3/events.py +++ b/src/github3/events.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the classes related to Events.""" -from __future__ import unicode_literals - import copy from . import models diff --git a/src/github3/gists/comment.py b/src/github3/gists/comment.py index f2b3ca583..839fea923 100644 --- a/src/github3/gists/comment.py +++ b/src/github3/gists/comment.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Module containing the logic for a GistComment.""" -from __future__ import unicode_literals - from .. import decorators from .. import models from .. import users diff --git a/src/github3/gists/file.py b/src/github3/gists/file.py index cc5624342..cefa9a79f 100644 --- a/src/github3/gists/file.py +++ b/src/github3/gists/file.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Module containing the GistFile object.""" -from __future__ import unicode_literals - from .. import models diff --git a/src/github3/gists/gist.py b/src/github3/gists/gist.py index 5781c976c..49fcef5a5 100644 --- a/src/github3/gists/gist.py +++ b/src/github3/gists/gist.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the Gist, ShortGist, and GistFork objects.""" -from __future__ import unicode_literals - from json import dumps from .. import models diff --git a/src/github3/gists/history.py b/src/github3/gists/history.py index 0ff1be815..c117be8ab 100644 --- a/src/github3/gists/history.py +++ b/src/github3/gists/history.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Module containing the GistHistory object.""" -from __future__ import unicode_literals - from .. import models from .. import users diff --git a/src/github3/git.py b/src/github3/git.py index ef0bc82b8..188e82f9f 100644 --- a/src/github3/git.py +++ b/src/github3/git.py @@ -4,7 +4,6 @@ See also: http://developer.github.com/v3/git/ """ -from __future__ import unicode_literals import base64 from json import dumps diff --git a/src/github3/github.py b/src/github3/github.py index e740c0304..0c5926af1 100644 --- a/src/github3/github.py +++ b/src/github3/github.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the main interfaces to the API.""" -from __future__ import unicode_literals - import json import re diff --git a/src/github3/issues/comment.py b/src/github3/issues/comment.py index 0676fbe12..199c7297a 100644 --- a/src/github3/issues/comment.py +++ b/src/github3/issues/comment.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Module with class(es) representing issue comments.""" -from __future__ import unicode_literals - from .. import decorators from .. import models from .. import users diff --git a/src/github3/issues/event.py b/src/github3/issues/event.py index 037d3d2be..b3e92c1ce 100644 --- a/src/github3/issues/event.py +++ b/src/github3/issues/event.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Issue events logic.""" -from __future__ import unicode_literals - from .. import users from ..models import GitHubCore diff --git a/src/github3/issues/issue.py b/src/github3/issues/issue.py index 38d161edc..f954c8438 100644 --- a/src/github3/issues/issue.py +++ b/src/github3/issues/issue.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Module containing the Issue logic.""" -from __future__ import unicode_literals - from json import dumps from uritemplate import URITemplate diff --git a/src/github3/issues/label.py b/src/github3/issues/label.py index b24bde7c0..257f767d0 100644 --- a/src/github3/issues/label.py +++ b/src/github3/issues/label.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Module containing the logic for labels.""" -from __future__ import unicode_literals from json import dumps from ..decorators import requires_auth diff --git a/src/github3/issues/milestone.py b/src/github3/issues/milestone.py index dfcc9fd81..504330976 100644 --- a/src/github3/issues/milestone.py +++ b/src/github3/issues/milestone.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from json import dumps diff --git a/src/github3/licenses.py b/src/github3/licenses.py index 855497786..83d0f6cdd 100644 --- a/src/github3/licenses.py +++ b/src/github3/licenses.py @@ -4,8 +4,6 @@ See also: https://developer.github.com/v3/licenses/ """ -from __future__ import unicode_literals - import base64 from . import models diff --git a/src/github3/models.py b/src/github3/models.py index ab0d0f52b..8a66dfe7b 100644 --- a/src/github3/models.py +++ b/src/github3/models.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module provides the basic models used in github3.py.""" -from __future__ import unicode_literals - import json as jsonlib import logging diff --git a/src/github3/notifications.py b/src/github3/notifications.py index 51dad1ffe..3dc316f34 100644 --- a/src/github3/notifications.py +++ b/src/github3/notifications.py @@ -4,8 +4,6 @@ See also: http://developer.github.com/v3/activity/notifications/ """ -from __future__ import unicode_literals - from json import dumps from . import models diff --git a/src/github3/orgs.py b/src/github3/orgs.py index 29ec5e3f7..45ffc0423 100644 --- a/src/github3/orgs.py +++ b/src/github3/orgs.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains all of the classes related to organizations.""" -from __future__ import unicode_literals - from json import dumps from uritemplate import URITemplate diff --git a/src/github3/pulls.py b/src/github3/pulls.py index b645a6103..332def3a0 100644 --- a/src/github3/pulls.py +++ b/src/github3/pulls.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains all the classes relating to pull requests.""" -from __future__ import unicode_literals - from json import dumps from uritemplate import URITemplate diff --git a/src/github3/repos/branch.py b/src/github3/repos/branch.py index 7aa50de64..e6b792c10 100644 --- a/src/github3/repos/branch.py +++ b/src/github3/repos/branch.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Implementation of a branch on a repository.""" -from __future__ import unicode_literals from . import commit from .. import decorators diff --git a/src/github3/repos/comment.py b/src/github3/repos/comment.py index ed021a441..a85eb89ca 100644 --- a/src/github3/repos/comment.py +++ b/src/github3/repos/comment.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the RepoComment class.""" -from __future__ import unicode_literals from .. import models from .. import users diff --git a/src/github3/repos/commit.py b/src/github3/repos/commit.py index b9afd07be..e130220d7 100644 --- a/src/github3/repos/commit.py +++ b/src/github3/repos/commit.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the RepoCommit classes.""" -from __future__ import unicode_literals from . import status from .. import checks, git, models, users diff --git a/src/github3/repos/comparison.py b/src/github3/repos/comparison.py index 80c067c89..ca9c5727f 100644 --- a/src/github3/repos/comparison.py +++ b/src/github3/repos/comparison.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the Comparison object.""" -from __future__ import unicode_literals from . import commit from .. import models diff --git a/src/github3/repos/contents.py b/src/github3/repos/contents.py index 689ebe800..38ec925f8 100644 --- a/src/github3/repos/contents.py +++ b/src/github3/repos/contents.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the Contents object.""" -from __future__ import unicode_literals from base64 import b64decode, b64encode from json import dumps diff --git a/src/github3/repos/deployment.py b/src/github3/repos/deployment.py index 857326ab3..ae354dc23 100644 --- a/src/github3/repos/deployment.py +++ b/src/github3/repos/deployment.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """The module containing deployment logic.""" -from __future__ import unicode_literals from .. import users diff --git a/src/github3/repos/hook.py b/src/github3/repos/hook.py index 02f4d7db1..bc98ab115 100644 --- a/src/github3/repos/hook.py +++ b/src/github3/repos/hook.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains only the Hook object for GitHub's Hook API.""" -from __future__ import unicode_literals from json import dumps from ..decorators import requires_auth diff --git a/src/github3/repos/invitation.py b/src/github3/repos/invitation.py index 6c792badd..db14accd3 100644 --- a/src/github3/repos/invitation.py +++ b/src/github3/repos/invitation.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Invitation related logic.""" -from __future__ import unicode_literals from json import dumps diff --git a/src/github3/repos/pages.py b/src/github3/repos/pages.py index 7f5c8f9f2..2b4f47023 100644 --- a/src/github3/repos/pages.py +++ b/src/github3/repos/pages.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """GitHub Pages related logic.""" -from __future__ import unicode_literals from .. import models diff --git a/src/github3/repos/release.py b/src/github3/repos/release.py index 37e476806..864932b5d 100644 --- a/src/github3/repos/release.py +++ b/src/github3/repos/release.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Release logic for the GitHub API.""" -from __future__ import unicode_literals import json diff --git a/src/github3/repos/repo.py b/src/github3/repos/repo.py index cab6be948..41c6c4cab 100644 --- a/src/github3/repos/repo.py +++ b/src/github3/repos/repo.py @@ -5,7 +5,6 @@ returned by GitHub. """ -from __future__ import unicode_literals import base64 import json as jsonlib diff --git a/src/github3/repos/stats.py b/src/github3/repos/stats.py index 51b944569..85330fb53 100644 --- a/src/github3/repos/stats.py +++ b/src/github3/repos/stats.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Repository and contributor stats logic.""" -from __future__ import unicode_literals import datetime diff --git a/src/github3/repos/status.py b/src/github3/repos/status.py index ed93b10bd..85d4b46e5 100644 --- a/src/github3/repos/status.py +++ b/src/github3/repos/status.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the Status object for GitHub's commit status API.""" -from __future__ import unicode_literals from .. import models from .. import users diff --git a/src/github3/repos/tag.py b/src/github3/repos/tag.py index d2e1f2438..dc4042e34 100644 --- a/src/github3/repos/tag.py +++ b/src/github3/repos/tag.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """This module contains the RepoTag object for GitHub's tag API.""" -from __future__ import unicode_literals from . import commit from .. import models diff --git a/src/github3/repos/topics.py b/src/github3/repos/topics.py index 99f9ef4c0..c880c4d80 100644 --- a/src/github3/repos/topics.py +++ b/src/github3/repos/topics.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Topics related logic.""" -from __future__ import unicode_literals from .. import models diff --git a/src/github3/repos/traffic.py b/src/github3/repos/traffic.py index c11748465..141a70a26 100644 --- a/src/github3/repos/traffic.py +++ b/src/github3/repos/traffic.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Repository traffic stats logic.""" -from __future__ import unicode_literals from .. import models diff --git a/src/github3/search/code.py b/src/github3/search/code.py index a7138c305..f4632f4f6 100644 --- a/src/github3/search/code.py +++ b/src/github3/search/code.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Code search results implementation.""" -from __future__ import unicode_literals from .. import models from .. import repos diff --git a/src/github3/search/commit.py b/src/github3/search/commit.py index e6f9be83d..f1803858d 100644 --- a/src/github3/search/commit.py +++ b/src/github3/search/commit.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Commit search results implementation.""" -from __future__ import unicode_literals from .. import git from .. import models diff --git a/src/github3/search/issue.py b/src/github3/search/issue.py index d408f1d08..1c2a4b27b 100644 --- a/src/github3/search/issue.py +++ b/src/github3/search/issue.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Issue search results implementation.""" -from __future__ import unicode_literals from ..models import GitHubCore from ..issues import ShortIssue diff --git a/src/github3/search/repository.py b/src/github3/search/repository.py index c1ff50d80..9dfaf2f89 100644 --- a/src/github3/search/repository.py +++ b/src/github3/search/repository.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Repository search results implementation.""" -from __future__ import unicode_literals from .. import models from .. import repos diff --git a/src/github3/search/user.py b/src/github3/search/user.py index b37af468d..a67bd2ea1 100644 --- a/src/github3/search/user.py +++ b/src/github3/search/user.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from .. import users from ..models import GitHubCore diff --git a/src/github3/users.py b/src/github3/users.py index 08a4822c2..1fcb2c967 100644 --- a/src/github3/users.py +++ b/src/github3/users.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """This module contains everything relating to Users.""" -from __future__ import unicode_literals - from json import dumps from github3.auths import Authorization diff --git a/tests/integration/helper.py b/tests/integration/helper.py index c7a3bc255..709715817 100644 --- a/tests/integration/helper.py +++ b/tests/integration/helper.py @@ -23,7 +23,7 @@ def setUp(self): self.token = os.environ.get("GH_AUTH", "x" * 20) self.app_id = int(os.environ.get("GH_APP_ID", "0")) self.private_key_bytes = os.environ.get( - "GH_APP_PRIVATE_KEY", u"" + "GH_APP_PRIVATE_KEY", "" ).encode("utf8") self.app_installation_id = int( os.environ.get("GH_APP_INSTALLATION_ID", "0") diff --git a/tests/unit/test_issues_issue.py b/tests/unit/test_issues_issue.py index 9f2be8363..22ce57ab7 100644 --- a/tests/unit/test_issues_issue.py +++ b/tests/unit/test_issues_issue.py @@ -159,7 +159,7 @@ def test_close_with_unicode_labels(self): "body": "issue body", "assignee": "sigmavirus24", "state": "closed", - "labels": [u"标签1", u"标签2"], + "labels": ["标签1", "标签2"], } self.instance.edit(**data) self.patch_called_with(url_for(), data=data)