Skip to content

Commit ab03dfc

Browse files
authored
Merge branch 'master' into bugfix-touch_import_top
2 parents fb78692 + 7efd55d commit ab03dfc

File tree

195 files changed

+2556
-1989
lines changed

Some content is hidden

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

195 files changed

+2556
-1989
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ nosetests.xml
4141
.mr.developer.cfg
4242
.project
4343
.pydevproject
44-

.travis.yml

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1-
language: python
2-
3-
python:
4-
- "3.4"
5-
- "3.3"
6-
- "2.7"
7-
- "2.6"
8-
91
sudo: false
2+
language: python
3+
cache: pip
104

11-
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
12-
# These packages only exist on Ubuntu 13.04 and newer:
13-
# No dependencies currently unless using Python 2.6.
5+
matrix:
6+
include:
7+
- python: 2.6
8+
env: TOXENV=py26
9+
- python: 2.7
10+
env: TOXENV=py27
11+
- python: 3.3
12+
env: TOXENV=py33
13+
- python: 3.4
14+
env: TOXENV=py34
15+
- python: 3.5
16+
env: TOXENV=py35
17+
- python: 3.6
18+
env: TOXENV=py36
19+
- python: 3.7
20+
env: TOXENV=py37
21+
dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069)
22+
sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069)
1423

1524
install:
16-
- if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install -r requirements_py26.txt --use-mirrors; fi
17-
- python setup.py install
25+
- pip install tox==2.9.1
26+
- pip install virtualenv==15.2.0
27+
- pip install py==1.4.30
28+
- pip install pluggy==0.5.2
1829

19-
# command to run tests, e.g. python setup.py test
30+
before_script:
31+
# Run flake8 tests only on Python 2.7 and 3.7...
32+
# 1) stop the build if there are Python syntax errors or undefined names
33+
# 2) exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34+
- if [[ $TRAVIS_PYTHON_VERSION == *.7 ]]; then
35+
pip install flake8;
36+
flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics;
37+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics;
38+
fi
2039

2140
script:
22-
# We might like to get out of the source directory before running tests to
23-
# avoid PYTHONPATH confusion? As an example, see here:
24-
# https://github.com/tornadoweb/tornado/blob/master/.travis.yml
25-
- python setup.py test
41+
- tox

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013-2016 Python Charmers Pty Ltd, Australia
1+
Copyright (c) 2013-2018 Python Charmers Pty Ltd, Australia
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ recursive-include tests *.au
2525
recursive-include tests *.gif
2626
recursive-include tests *.py
2727
recursive-include tests *.txt
28-

README.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ statements. For example, this code behaves identically on Python 2.6/2.7 after
6868
these imports as it does on Python 3.3+:
6969

7070
.. code-block:: python
71-
71+
7272
from __future__ import absolute_import, division, print_function
7373
from builtins import (bytes, str, open, super, range,
7474
zip, round, input, int, pow, object)
@@ -93,7 +93,7 @@ these imports as it does on Python 3.3+:
9393
9494
# Extra arguments for the open() function
9595
f = open('japanese.txt', encoding='utf-8', errors='replace')
96-
96+
9797
# New zero-argument super() function:
9898
class VerboseList(list):
9999
def append(self, item):
@@ -103,15 +103,15 @@ these imports as it does on Python 3.3+:
103103
# New iterable range object with slicing support
104104
for i in range(10**15)[:10]:
105105
pass
106-
106+
107107
# Other iterators: map, zip, filter
108108
my_iter = zip(range(3), ['a', 'b', 'c'])
109109
assert my_iter != list(my_iter)
110-
110+
111111
# The round() function behaves as it does in Python 3, using
112112
# "Banker's Rounding" to the nearest even last digit:
113113
assert round(0.1250, 2) == 0.12
114-
114+
115115
# input() replaces Py2's raw_input() (with no eval()):
116116
name = input('What is your name? ')
117117
print('Hello ' + name)
@@ -187,7 +187,7 @@ Futurize: 2 to both
187187
For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
188188

189189
.. code-block:: python
190-
190+
191191
import Queue
192192
from urllib2 import urlopen
193193
@@ -202,14 +202,14 @@ For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
202202
into this code which runs on both Py2 and Py3:
203203

204204
.. code-block:: python
205-
205+
206206
from __future__ import print_function
207207
from future import standard_library
208208
standard_library.install_aliases()
209209
from builtins import input
210210
import queue
211211
from urllib.request import urlopen
212-
212+
213213
def greet(name):
214214
print('Hello', end=' ')
215215
print(name)
@@ -233,14 +233,14 @@ Python 3. First install it:
233233
.. code-block:: bash
234234
235235
$ pip3 install plotrique==0.2.5-7 --no-compile # to ignore SyntaxErrors
236-
236+
237237
(or use ``pip`` if this points to your Py3 environment.)
238238

239239
Then pass a whitelist of module name prefixes to the ``autotranslate()`` function.
240240
Example:
241241

242242
.. code-block:: bash
243-
243+
244244
$ python3
245245
246246
>>> from past import autotranslate
@@ -264,12 +264,14 @@ For more info, see :ref:`translation`.
264264
Licensing
265265
---------
266266

267-
:Author: Ed Schofield
267+
:Author: Ed Schofield, Jordan M. Adler, et al
268268

269-
:Copyright: 2013-2016 Python Charmers Pty Ltd, Australia.
269+
:Copyright: 2013-2018 Python Charmers Pty Ltd, Australia.
270270

271-
:Sponsor: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
272-
Ltd, Singapore. http://pythoncharmers.com
271+
:Sponsors: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
272+
Ltd, Singapore. http://pythoncharmers.com
273+
274+
Pinterest https://opensource.pinterest.com/
273275

274276
:Licence: MIT. See ``LICENSE.txt`` or `here <http://python-future.org/credits.html>`_.
275277

@@ -284,4 +286,3 @@ If you are new to Python-Future, check out the `Quickstart Guide
284286

285287
For an update on changes in the latest version, see the `What's New
286288
<http://python-future.org/whatsnew.html>`_ page.
287-

TESTING.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
Currently the tests are passing on OS X and Linux on Python 2.6, 2.7, 3.3 and 3.4.
1+
Currently the tests are passing on OS X and Linux on Python 2.7 and 3.4.
22

3-
The test suite can be run either with:
3+
The test suite can be run with:
44

5-
$ python setup.py test
5+
$ tox
66

7-
which uses the unittest module's test discovery mechanism, or with:
7+
which tests the module under a number of different python versions, where available, or with:
88

99
$ py.test
10+
11+
To execute a single test:
12+
13+
$ pytest -k test_chained_exceptions_stacktrace

discover_tests.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

docs/3rd-party-py3k-compat-code/ipython_py3compat.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def wrapper(func_or_str):
4141
else:
4242
func = func_or_str
4343
doc = func.__doc__
44-
44+
4545
doc = str_change_func(doc)
46-
46+
4747
if func:
4848
func.__doc__ = doc
4949
return func
@@ -52,97 +52,97 @@ def wrapper(func_or_str):
5252

5353
if sys.version_info[0] >= 3:
5454
PY3 = True
55-
55+
5656
input = input
5757
builtin_mod_name = "builtins"
58-
58+
5959
str_to_unicode = no_code
6060
unicode_to_str = no_code
6161
str_to_bytes = encode
6262
bytes_to_str = decode
6363
cast_bytes_py2 = no_code
64-
64+
6565
def isidentifier(s, dotted=False):
6666
if dotted:
6767
return all(isidentifier(a) for a in s.split("."))
6868
return s.isidentifier()
69-
69+
7070
open = orig_open
71-
71+
7272
MethodType = types.MethodType
73-
73+
7474
def execfile(fname, glob, loc=None):
7575
loc = loc if (loc is not None) else glob
7676
exec compile(open(fname, 'rb').read(), fname, 'exec') in glob, loc
77-
77+
7878
# Refactor print statements in doctests.
7979
_print_statement_re = re.compile(r"\bprint (?P<expr>.*)$", re.MULTILINE)
8080
def _print_statement_sub(match):
8181
expr = match.groups('expr')
8282
return "print(%s)" % expr
83-
83+
8484
@_modify_str_or_docstring
8585
def doctest_refactor_print(doc):
8686
"""Refactor 'print x' statements in a doctest to print(x) style. 2to3
8787
unfortunately doesn't pick up on our doctests.
88-
88+
8989
Can accept a string or a function, so it can be used as a decorator."""
9090
return _print_statement_re.sub(_print_statement_sub, doc)
91-
91+
9292
# Abstract u'abc' syntax:
9393
@_modify_str_or_docstring
9494
def u_format(s):
9595
""""{u}'abc'" --> "'abc'" (Python 3)
96-
96+
9797
Accepts a string or a function, so it can be used as a decorator."""
9898
return s.format(u='')
9999

100100
else:
101101
PY3 = False
102-
102+
103103
input = raw_input
104104
builtin_mod_name = "__builtin__"
105-
105+
106106
str_to_unicode = decode
107107
unicode_to_str = encode
108108
str_to_bytes = no_code
109109
bytes_to_str = no_code
110110
cast_bytes_py2 = cast_bytes
111-
111+
112112
import re
113113
_name_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$")
114114
def isidentifier(s, dotted=False):
115115
if dotted:
116116
return all(isidentifier(a) for a in s.split("."))
117117
return bool(_name_re.match(s))
118-
118+
119119
class open(object):
120120
"""Wrapper providing key part of Python 3 open() interface."""
121121
def __init__(self, fname, mode="r", encoding="utf-8"):
122122
self.f = orig_open(fname, mode)
123123
self.enc = encoding
124-
124+
125125
def write(self, s):
126126
return self.f.write(s.encode(self.enc))
127-
127+
128128
def read(self, size=-1):
129129
return self.f.read(size).decode(self.enc)
130-
130+
131131
def close(self):
132132
return self.f.close()
133-
133+
134134
def __enter__(self):
135135
return self
136-
136+
137137
def __exit__(self, etype, value, traceback):
138138
self.f.close()
139-
139+
140140
def MethodType(func, instance):
141141
return types.MethodType(func, instance, type(instance))
142-
142+
143143
# don't override system execfile on 2.x:
144144
execfile = execfile
145-
145+
146146
def doctest_refactor_print(func_or_str):
147147
return func_or_str
148148

@@ -151,7 +151,7 @@ def doctest_refactor_print(func_or_str):
151151
@_modify_str_or_docstring
152152
def u_format(s):
153153
""""{u}'abc'" --> "u'abc'" (Python 2)
154-
154+
155155
Accepts a string or a function, so it can be used as a decorator."""
156156
return s.format(u='u')
157157

0 commit comments

Comments
 (0)