Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unicode legacy code #1015

Merged
merged 2 commits into from Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/source/conf.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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'),
]

Expand Down
6 changes: 4 additions & 2 deletions 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
Expand All @@ -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``
Expand Down
2 changes: 0 additions & 2 deletions 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

Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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


Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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

Expand Down
1 change: 0 additions & 1 deletion src/github3/git.py
Expand Up @@ -4,7 +4,6 @@

See also: http://developer.github.com/v3/git/
"""
from __future__ import unicode_literals
import base64

from json import dumps
Expand Down
2 changes: 0 additions & 2 deletions 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

Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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

Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion src/github3/issues/milestone.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from json import dumps

Expand Down
2 changes: 0 additions & 2 deletions src/github3/licenses.py
Expand Up @@ -4,8 +4,6 @@

See also: https://developer.github.com/v3/licenses/
"""
from __future__ import unicode_literals

import base64

from . import models
Expand Down
2 changes: 0 additions & 2 deletions 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

Expand Down
2 changes: 0 additions & 2 deletions src/github3/notifications.py
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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

Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/invitation.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Invitation related logic."""
from __future__ import unicode_literals

from json import dumps

Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/pages.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""GitHub Pages related logic."""
from __future__ import unicode_literals

from .. import models

Expand Down
1 change: 0 additions & 1 deletion 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

Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/repo.py
Expand Up @@ -5,7 +5,6 @@
returned by GitHub.

"""
from __future__ import unicode_literals

import base64
import json as jsonlib
Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/stats.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Repository and contributor stats logic."""
from __future__ import unicode_literals

import datetime

Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/topics.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Topics related logic."""
from __future__ import unicode_literals

from .. import models

Expand Down
1 change: 0 additions & 1 deletion src/github3/repos/traffic.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
"""Repository traffic stats logic."""
from __future__ import unicode_literals

from .. import models

Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion 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
Expand Down
1 change: 0 additions & 1 deletion src/github3/search/user.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from .. import users
from ..models import GitHubCore
Expand Down
2 changes: 0 additions & 2 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/helper.py
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_issues_issue.py
Expand Up @@ -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)
Expand Down