| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,4 +41,3 @@ nosetests.xml | |||
| 41 | 41 | .mr.developer.cfg | |
| 42 | 42 | .project | |
| 43 | 43 | .pydevproject | |
| 44 | - | ||
| Original file line number | Diff line number | Diff 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 | - | ||
| 9 | 1 | sudo: false | |
| 2 | + language: python | ||
| 3 | + cache: pip | ||
| 10 | 4 | ||
| 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) | ||
| 14 | 23 | ||
| 15 | 24 | 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 | ||
| 18 | 29 | ||
| 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 | ||
| 20 | 39 | ||
| 21 | 40 | 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 | ||
| Original file line number | Diff line number | Diff 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 | ||
| 2 | 2 | ||
| 3 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 4 | 4 | of this software and associated documentation files (the "Software"), to deal | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,4 +25,3 @@ recursive-include tests *.au | |||
| 25 | 25 | recursive-include tests *.gif | |
| 26 | 26 | recursive-include tests *.py | |
| 27 | 27 | recursive-include tests *.txt | |
| 28 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ statements. For example, this code behaves identically on Python 2.6/2.7 after | |||
| 68 | 68 | these imports as it does on Python 3.3+: | |
| 69 | 69 | ||
| 70 | 70 | .. code-block:: python | |
| 71 | - | ||
| 71 | + | ||
| 72 | 72 | from __future__ import absolute_import, division, print_function | |
| 73 | 73 | from builtins import (bytes, str, open, super, range, | |
| 74 | 74 | zip, round, input, int, pow, object) | |
@@ -93,7 +93,7 @@ these imports as it does on Python 3.3+: | |||
| 93 | 93 | ||
| 94 | 94 | # Extra arguments for the open() function | |
| 95 | 95 | f = open('japanese.txt', encoding='utf-8', errors='replace') | |
| 96 | - | ||
| 96 | + | ||
| 97 | 97 | # New zero-argument super() function: | |
| 98 | 98 | class VerboseList(list): | |
| 99 | 99 | def append(self, item): | |
@@ -103,15 +103,15 @@ these imports as it does on Python 3.3+: | |||
| 103 | 103 | # New iterable range object with slicing support | |
| 104 | 104 | for i in range(10**15)[:10]: | |
| 105 | 105 | pass | |
| 106 | - | ||
| 106 | + | ||
| 107 | 107 | # Other iterators: map, zip, filter | |
| 108 | 108 | my_iter = zip(range(3), ['a', 'b', 'c']) | |
| 109 | 109 | assert my_iter != list(my_iter) | |
| 110 | - | ||
| 110 | + | ||
| 111 | 111 | # The round() function behaves as it does in Python 3, using | |
| 112 | 112 | # "Banker's Rounding" to the nearest even last digit: | |
| 113 | 113 | assert round(0.1250, 2) == 0.12 | |
| 114 | - | ||
| 114 | + | ||
| 115 | 115 | # input() replaces Py2's raw_input() (with no eval()): | |
| 116 | 116 | name = input('What is your name? ') | |
| 117 | 117 | print('Hello ' + name) | |
@@ -187,7 +187,7 @@ Futurize: 2 to both | |||
| 187 | 187 | For example, running ``futurize -w mymodule.py`` turns this Python 2 code: | |
| 188 | 188 | ||
| 189 | 189 | .. code-block:: python | |
| 190 | - | ||
| 190 | + | ||
| 191 | 191 | import Queue | |
| 192 | 192 | from urllib2 import urlopen | |
| 193 | 193 | ||
@@ -202,14 +202,14 @@ For example, running ``futurize -w mymodule.py`` turns this Python 2 code: | |||
| 202 | 202 | into this code which runs on both Py2 and Py3: | |
| 203 | 203 | ||
| 204 | 204 | .. code-block:: python | |
| 205 | - | ||
| 205 | + | ||
| 206 | 206 | from __future__ import print_function | |
| 207 | 207 | from future import standard_library | |
| 208 | 208 | standard_library.install_aliases() | |
| 209 | 209 | from builtins import input | |
| 210 | 210 | import queue | |
| 211 | 211 | from urllib.request import urlopen | |
| 212 | - | ||
| 212 | + | ||
| 213 | 213 | def greet(name): | |
| 214 | 214 | print('Hello', end=' ') | |
| 215 | 215 | print(name) | |
@@ -233,14 +233,14 @@ Python 3. First install it: | |||
| 233 | 233 | .. code-block:: bash | |
| 234 | 234 | ||
| 235 | 235 | $ pip3 install plotrique==0.2.5-7 --no-compile # to ignore SyntaxErrors | |
| 236 | - | ||
| 236 | + | ||
| 237 | 237 | (or use ``pip`` if this points to your Py3 environment.) | |
| 238 | 238 | ||
| 239 | 239 | Then pass a whitelist of module name prefixes to the ``autotranslate()`` function. | |
| 240 | 240 | Example: | |
| 241 | 241 | ||
| 242 | 242 | .. code-block:: bash | |
| 243 | - | ||
| 243 | + | ||
| 244 | 244 | $ python3 | |
| 245 | 245 | ||
| 246 | 246 | >>> from past import autotranslate | |
@@ -264,12 +264,14 @@ For more info, see :ref:`translation`. | |||
| 264 | 264 | Licensing | |
| 265 | 265 | --------- | |
| 266 | 266 | ||
| 267 | - :Author: Ed Schofield | ||
| 267 | + :Author: Ed Schofield, Jordan M. Adler, et al | ||
| 268 | 268 | ||
| 269 | - :Copyright: 2013-2016 Python Charmers Pty Ltd, Australia. | ||
| 269 | + :Copyright: 2013-2018 Python Charmers Pty Ltd, Australia. | ||
| 270 | 270 | ||
| 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/ | ||
| 273 | 275 | ||
| 274 | 276 | :Licence: MIT. See ``LICENSE.txt`` or `here <http://python-future.org/credits.html>`_. | |
| 275 | 277 | ||
@@ -284,4 +286,3 @@ If you are new to Python-Future, check out the `Quickstart Guide | |||
| 284 | 286 | ||
| 285 | 287 | For an update on changes in the latest version, see the `What's New | |
| 286 | 288 | <http://python-future.org/whatsnew.html>`_ page. | |
| 287 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,17 +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. | ||
| 2 | 2 | ||
| 3 | - The test suite can be run either with: | ||
| 3 | + The test suite can be run with: | ||
| 4 | 4 | ||
| 5 | - $ python setup.py test | ||
| 5 | + $ tox | ||
| 6 | 6 | ||
| 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: | ||
| 8 | 8 | ||
| 9 | 9 | $ py.test | |
| 10 | 10 | ||
| 11 | 11 | To execute a single test: | |
| 12 | 12 | ||
| 13 | - $ python setup.py test -s tests.test_future.test_utils.TestCause.test_chained_exceptions_stacktrace | ||
| 14 | - | ||
| 15 | - or with: | ||
| 16 | - | ||
| 17 | - $ pytest -k test_chained_exceptions_stacktrace | ||
| 13 | + $ pytest -k test_chained_exceptions_stacktrace | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments