Skip to content

Commit f7ca88c

Browse files
committed
Merge branch 'python3'
Conflicts: requirements/base.txt
2 parents c5ce21d + 3f13d37 commit f7ca88c

File tree

18 files changed

+49
-25
lines changed

18 files changed

+49
-25
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ language: python
22
python:
33
- "2.6"
44
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
58
install:
6-
- pip install -r requirements/dev.txt --use-mirrors
9+
- pip install -r requirements/dev.txt
10+
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install unittest2; fi
711
script: nosetests

docs/conf.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# serve to show the default.
1313

1414
import sys, os
15+
import six
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -41,8 +42,8 @@
4142
master_doc = 'index'
4243

4344
# General information about the project.
44-
project = u'pygithub3'
45-
copyright = u'2012, David Medina'
45+
project = six.u('pygithub3')
46+
copyright = six.u('2012, David Medina')
4647

4748
# The version info for the project you're documenting, acts as replacement for
4849
# |version| and |release|, also used in various other places throughout the
@@ -189,8 +190,8 @@
189190
# Grouping the document tree into LaTeX files. List of tuples
190191
# (source start file, target name, title, author, documentclass [howto/manual]).
191192
latex_documents = [
192-
('index', 'pygithub3.tex', u'pygithub3 Documentation',
193-
u'David Medina', 'manual'),
193+
('index', 'pygithub3.tex', six.u('pygithub3 Documentation'),
194+
six.u('David Medina'), 'manual'),
194195
]
195196

196197
# The name of an image file (relative to this directory) to place at the top of
@@ -219,8 +220,8 @@
219220
# One entry per manual page. List of tuples
220221
# (source start file, name, description, authors, manual section).
221222
man_pages = [
222-
('index', 'pygithub3', u'pygithub3 Documentation',
223-
[u'David Medina'], 1)
223+
('index', 'pygithub3', six.u('pygithub3 Documentation'),
224+
[six.u('David Medina')], 1)
224225
]
225226

226227
# If true, show URL addresses after external links.
@@ -233,8 +234,8 @@
233234
# (source start file, target name, title, author,
234235
# dir menu entry, description, category)
235236
texinfo_documents = [
236-
('index', 'pygithub3', u'pygithub3 Documentation',
237-
u'David Medina', 'pygithub3', 'One line description of project.',
237+
('index', 'pygithub3', six.u('pygithub3 Documentation'),
238+
six.u('David Medina'), 'pygithub3', 'One line description of project.',
238239
'Miscellaneous'),
239240
]
240241

pygithub3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
__license__ = 'ISC'
88
__copyright__ = 'Copyright 2012 David Medina'
99

10-
from github import Github
10+
from .github import Github

pygithub3/core/compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
""" Utils to support python 2.6 compatibility """
44

55
from collections import MutableMapping
6+
from six.moves import map
7+
from six.moves import zip
68

79

810
def _import_module(module_uri):

pygithub3/core/json/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
except ImportError:
1010
import json
1111

12+
import six
13+
1214
GITHUB_DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
1315

1416

@@ -21,7 +23,7 @@ def default(self, o):
2123

2224

2325
def gh_decoder_hook(dict_):
24-
for k, v in dict_.iteritems():
26+
for k, v in six.iteritems(dict_):
2527
try:
2628
date = datetime.strptime(v, GITHUB_DATE_FORMAT)
2729
dict_[k] = date

pygithub3/core/result/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# -*- encoding: utf-8 -*-
33

44
import functools
5+
import six
56

67

78
class Method(object):
@@ -72,7 +73,7 @@ def wrapper(self):
7273
@get_content
7374
def __next__(self):
7475
try:
75-
return self.iterable.next()
76+
return six.advance_iterator(self.iterable)
7677
except StopIteration:
7778
self.iterable = iter(self.getter(self.page))
7879
raise StopIteration

pygithub3/core/result/link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- encoding: utf-8 -*-
33

4-
from urlparse import urlparse, parse_qs
4+
from six.moves.urllib.parse import urlparse, parse_qs
55

66
from pygithub3.core.third_libs.link_header import parse_link_value
77

pygithub3/core/result/smart.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env python
22
# -*- encoding: utf-8 -*-
33

4+
import six
5+
46
from . import base
57
from .link import Link
68

@@ -105,6 +107,6 @@ def get_page(self, page):
105107
106108
:param int page: Page number
107109
"""
108-
if page in xrange(1, self.pages + 1):
110+
if page in six.moves.range(1, self.pages + 1):
109111
return base.Page(self.getter, page)
110112
return None

pygithub3/core/third_libs/link_header.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Simple routines to parse and manipulate Link headers.
77
"""
8+
from __future__ import print_function
89

910
__license__ = """
1011
Copyright (c) 2009 Mark Nottingham
@@ -86,4 +87,4 @@ def parse_link_value(instr):
8687
if __name__ == '__main__':
8788
import sys
8889
if len(sys.argv) > 1:
89-
print parse_link_value(sys.argv[1])
90+
print(parse_link_value(sys.argv[1]))

pygithub3/requests/users/emails.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import re
55

6+
import six
7+
68
from . import Request, ValidationError
79

810
# Src: http://code.djangoproject.com/svn/django/trunk/django/core/validators.py
@@ -30,7 +32,7 @@ def is_email(email):
3032
raise ValidationError("'%s' request needs emails"
3133
% (self.__class__.__name__))
3234

33-
return filter(is_email, self.body)
35+
return tuple(six.moves.filter(is_email, self.body))
3436

3537

3638
class Delete(Request):

0 commit comments

Comments
 (0)