Skip to content

Commit 45d6c64

Browse files
committed
2 parents 64b8603 + 0c347ff commit 45d6c64

21 files changed

+47
-38
lines changed

build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
#!/bin/sh
12
# XXX: TODO: we should make this include -e once tests pass
2-
set -xuo pipefail
3+
set -xu
34

45
DOCKER_IMAGE=jmadler/python-future-builder
56
# XXX: TODO: Perhaps this version shouldn't be hardcoded
67
version=0.18.4
78

8-
docker build . -t $DOCKER_IMAGE
9-
#docker push $DOCKER_IMAGE:latest
9+
docker build . -t "$DOCKER_IMAGE"
10+
#docker push "$DOCKER_IMAGE:latest"
1011

1112
for i in cp27-cp27m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39; do
12-
docker run -ti -v $(realpath dist):/root/python-future/dist $DOCKER_IMAGE /root/python-future/setup.sh $version $(basename $i)
13+
docker run -ti -v "$(realpath dist)":/root/python-future/dist "$DOCKER_IMAGE" /root/python-future/setup.sh "$version" $(basename $i)
1314
done
1415

1516
python setup.py sdist

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def encode_filename(filename):
8585

8686
def with_metaclass(meta, *bases):
8787
# This requires a bit of explanation: the basic idea is to make a
88-
# dummy metaclass for one level of class instanciation that replaces
88+
# dummy metaclass for one level of class instantiation that replaces
8989
# itself with the actual metaclass. Because of internal type checks
9090
# we also need to make sure that we downgrade the custom metaclass
9191
# for one level to something closer to type (that's why __call__ and

docs/notebooks/object special methods (next, bool, ...).ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"collapsed": false,
6464
"input": [
6565
"# Py3-style iterators written as new-style classes (subclasses of\n",
66-
"# future.builtins.object) are backward compatibile with Py2:\n",
66+
"# future.builtins.object) are backward compatible with Py2:\n",
6767
"class Upper(object):\n",
6868
" def __init__(self, iterable):\n",
6969
" self._iter = iter(iterable)\n",

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
sphinx==3.2.1
22
sphinx_bootstrap_theme==0.7.1
3+
setuptools==0.18.2

docs/standard_library_imports.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ As of version 0.14, the ``future`` package comes with top-level packages for
1515
Python 2.x that provide access to the reorganized standard library modules
1616
under their Python 3.x names.
1717

18-
Direct imports are the preferred mechanism for accesing the renamed standard
18+
Direct imports are the preferred mechanism for accessing the renamed standard
1919
library modules in Python 2/3 compatible code. For example, the following clean
2020
Python 3 code runs unchanged on Python 2 after installing ``future``::
2121

docs/whatsnew.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ This is a major bug-fix and feature release, including:
9696
- Fix an issue with copyreg import under Py3 that results in unexposed stdlib functionality
9797
- Export and document types in future.utils
9898
- Update behavior of newstr.__eq__() to match str.__eq__() as per reference docs
99-
- Fix raising and the raising fixer to handle cases where the syntax is ambigious
99+
- Fix raising and the raising fixer to handle cases where the syntax is ambiguous
100100
- Allow "default" parameter in min() and max() (Issue #334)
101101
- Implement __hash__() in newstr (Issue #454)
102102
- Future proof some version checks to handle the fact that Py4 won't be a major breaking release
@@ -128,7 +128,7 @@ This is a major bug-fix release, including:
128128
- Fix ``past.translation`` on read-only file systems
129129
- Fix Tkinter import bug introduced in Python 2.7.4 (issue #262)
130130
- Correct TypeError to ValueError in a specific edge case for newrange
131-
- Support inequality tests betwen newstrs and newbytes
131+
- Support inequality tests between newstrs and newbytes
132132
- Add type check to __get__ in newsuper
133133
- Fix fix_divsion_safe to support better conversion of complex expressions, and
134134
skip obvious float division.

lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/sh
12
# TODO: Run under Python 2.7 and 3.7
23
flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics || true
34
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics || true

setup.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

3-
set -exo pipefail
3+
set -ex
44

55
version=$1
6-
pyabitag=$2
7-
8-
py="/opt/python/${pyabitag}/bin/python"
9-
pytag=${pyabitag%-*}
10-
pytag="${pytag//cp/py}"
11-
$py -m pip install pytest unittest2
12-
$py setup.py bdist_wheel --python-tag=$pytag
13-
$py -m pip install dist/future-$version-$pytag-none-any.whl
6+
pytag=$2
7+
8+
if [ "$pytag" = 'py33' ]; then
9+
pip3 install virtualenv==16.2.0
10+
fi
11+
12+
. /root/"$pytag"/bin/activate
13+
14+
if [ "$pytag" = 'py26' ]; then
15+
pip install importlib
16+
fi
17+
pip install pytest unittest2
18+
python setup.py bdist_wheel --python-tag="$pytag"
19+
pip install "dist/future-$version-$pytag-none-any.whl"
1420
# Ignore test failures for now
15-
$py -m pytest tests/ || true
21+
pytest tests/ || true

src/future/backports/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ def today(cls):
689689

690690
@classmethod
691691
def fromordinal(cls, n):
692-
"""Contruct a date from a proleptic Gregorian ordinal.
692+
"""Construct a date from a proleptic Gregorian ordinal.
693693
694694
January 1 of year 1 is day 1. Only the year, month and day are
695695
non-zero in the result.

src/future/backports/email/_header_value_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,7 @@ def parse_content_type_header(value):
28672867
_find_mime_parameters(ctype, value)
28682868
return ctype
28692869
ctype.append(token)
2870-
# XXX: If we really want to follow the formal grammer we should make
2870+
# XXX: If we really want to follow the formal grammar we should make
28712871
# mantype and subtype specialized TokenLists here. Probably not worth it.
28722872
if not value or value[0] != '/':
28732873
ctype.defects.append(errors.InvalidHeaderDefect(

src/future/backports/email/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, _class=Message, **_3to2kwargs):
2626
textual representation of the message.
2727
2828
The string must be formatted as a block of RFC 2822 headers and header
29-
continuation lines, optionally preceeded by a `Unix-from' header. The
29+
continuation lines, optionally preceded by a `Unix-from' header. The
3030
header block is terminated either by the end of the string or by a
3131
blank line.
3232
@@ -92,7 +92,7 @@ def __init__(self, *args, **kw):
9292
textual representation of the message.
9393
9494
The input must be formatted as a block of RFC 2822 headers and header
95-
continuation lines, optionally preceeded by a `Unix-from' header. The
95+
continuation lines, optionally preceded by a `Unix-from' header. The
9696
header block is terminated either by the end of the input or by a
9797
blank line.
9898

src/future/backports/xmlrpc/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ def close(self):
12511251
# Send HTTP request.
12521252
#
12531253
# @param host Host descriptor (URL or (URL, x509 info) tuple).
1254-
# @param handler Targer RPC handler (a path relative to host)
1254+
# @param handler Target RPC handler (a path relative to host)
12551255
# @param request_body The XML-RPC request body
12561256
# @param debug Enable debugging if debug is true.
12571257
# @return An HTTPConnection.

src/future/standard_library/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import socketserver
1818
import winreg # on Windows only
1919
import test.support
20-
import html, html.parser, html.entites
20+
import html, html.parser, html.entities
2121
import http, http.client, http.server
2222
import http.cookies, http.cookiejar
2323
import urllib.parse, urllib.request, urllib.response, urllib.error, urllib.robotparser

src/future/types/newint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def to_bytes(self, length, byteorder='big', signed=False):
318318
bits = length * 8
319319
num = (2**bits) + self
320320
if num <= 0:
321-
raise OverflowError("int too smal to convert")
321+
raise OverflowError("int too small to convert")
322322
else:
323323
if self < 0:
324324
raise OverflowError("can't convert negative int to unsigned")

src/future/types/newrange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def index(self, value):
105105
raise ValueError('%r is not in range' % value)
106106

107107
def count(self, value):
108-
"""Return the number of ocurrences of integer `value`
108+
"""Return the number of occurrences of integer `value`
109109
in the sequence this range represents."""
110110
# a value can occur exactly zero or one times
111111
return int(value in self)

src/libfuturize/fixer_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def suitify(parent):
116116
"""
117117
for node in parent.children:
118118
if node.type == syms.suite:
119-
# already in the prefered format, do nothing
119+
# already in the preferred format, do nothing
120120
return
121121

122122
# One-liners have no suite node, we have to fake one up

src/libfuturize/fixes/fix_metaclass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
def has_metaclass(parent):
3939
""" we have to check the cls_node without changing it.
40-
There are two possiblities:
40+
There are two possibilities:
4141
1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
4242
2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
4343
"""
@@ -63,7 +63,7 @@ def fixup_parse_tree(cls_node):
6363
# already in the preferred format, do nothing
6464
return
6565

66-
# !%@#! oneliners have no suite node, we have to fake one up
66+
# !%@#! one-liners have no suite node, we have to fake one up
6767
for i, node in enumerate(cls_node.children):
6868
if node.type == token.COLON:
6969
break

tests/test_future/test_http_cookiejar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class CookieTests(unittest.TestCase):
380380
## comma-separated list, it'll be a headache to parse (at least my head
381381
## starts hurting every time I think of that code).
382382
## - Expires: You'll get all sorts of date formats in the expires,
383-
## including emtpy expires attributes ("expires="). Be as flexible as you
383+
## including empty expires attributes ("expires="). Be as flexible as you
384384
## can, and certainly don't expect the weekday to be there; if you can't
385385
## parse it, just ignore it and pretend it's a session cookie.
386386
## - Domain-matching: Netscape uses the 2-dot rule for _all_ domains, not
@@ -1734,7 +1734,7 @@ def test_session_cookies(self):
17341734
key = "%s_after" % cookie.value
17351735
counter[key] = counter[key] + 1
17361736

1737-
# a permanent cookie got lost accidently
1737+
# a permanent cookie got lost accidentally
17381738
self.assertEqual(counter["perm_after"], counter["perm_before"])
17391739
# a session cookie hasn't been cleared
17401740
self.assertEqual(counter["session_after"], 0)

tests/test_future/test_standard_library.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def test_future_moves_dbm(self):
593593
from future.moves.dbm import ndbm
594594

595595

596-
# Running the following tkinter test causes the following bizzare test failure:
596+
# Running the following tkinter test causes the following bizarre test failure:
597597
#
598598
# ======================================================================
599599
# FAIL: test_open_default_encoding (future.tests.test_builtins.BuiltinTest)

tests/test_future/test_urllib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Regresssion tests for urllib"""
1+
"""Regression tests for urllib"""
22
from __future__ import absolute_import, division, unicode_literals
33

44
import io
@@ -1229,7 +1229,7 @@ def open_spam(self, url):
12291229
# Everywhere else they work ok, but on those machines, sometimes
12301230
# fail in one of the tests, sometimes in other. I have a linux, and
12311231
# the tests go ok.
1232-
# If anybody has one of the problematic enviroments, please help!
1232+
# If anybody has one of the problematic environments, please help!
12331233
# . Facundo
12341234
#
12351235
# def server(evt):

tests/test_future/test_urllib_toplevel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Regresssion tests for urllib"""
1+
"""Regression tests for urllib"""
22
from __future__ import absolute_import, division, unicode_literals
33

44
import io
@@ -1247,7 +1247,7 @@ def open_spam(self, url):
12471247
# Everywhere else they work ok, but on those machines, sometimes
12481248
# fail in one of the tests, sometimes in other. I have a linux, and
12491249
# the tests go ok.
1250-
# If anybody has one of the problematic enviroments, please help!
1250+
# If anybody has one of the problematic environments, please help!
12511251
# . Facundo
12521252
#
12531253
# def server(evt):

0 commit comments

Comments
 (0)