Skip to content

Commit

Permalink
Merge branch 'master' into pep8-to-pycodestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 17, 2018
2 parents e51c69f + c1304c6 commit 130b204
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
25 changes: 12 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ language: python
# Use container-based infrastructure
sudo: false

python:
- pypy
- pypy3
- 2.7
- 3.6
- 3.5
- 3.4
- 3.3
- 2.6
matrix:
fast_finish: true
include:
- python: pypy
- python: pypy3
- python: 3.7
dist: xenial
sudo: true
- python: 3.6
- python: 3.5
- python: 3.4
- python: 2.7

install:
- pip install -r requirements.txt
- pip install coverage
- if [ "$TRAVIS_PYTHON_VERSION" == "2.6" ]; then pip install unittest2; fi

script:
- coverage run --source=tracery -m nose tests/test_*.py
Expand All @@ -30,6 +32,3 @@ after_script:
- pip install pycodestyle pyflakes
- pyflakes . | tee >(wc -l)
- pycodestyle --statistics --count .

matrix:
fast_finish: true
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ otherwise.

grammar = tracery.Grammar(rules)
grammar.add_modifiers(base_english)
print grammar.flatten("#origin#") # prints, e.g., "Hello, world!"
print(grammar.flatten("#origin#")) # prints, e.g., "Hello, world!"

Any valid Tracery grammar should work in this port. The ``base_english``
modifiers in ``tracery.modifiers`` are a port of the modifiers in the JavaScript
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
packages=[
'tracery',
],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
install_requires=[],
license="Apache License 2.0",
zip_safe=True,
Expand All @@ -32,13 +33,12 @@
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Intended Audience :: Developers',
Expand Down
5 changes: 1 addition & 4 deletions tests/test_modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
Unit tests for pytracery
"""
from __future__ import print_function
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest

import sys
import os.path
Expand Down
9 changes: 3 additions & 6 deletions tests/test_tracery.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
Unit tests for pytracery
"""
from __future__ import print_function, unicode_literals
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest

import sys
import os.path
Expand Down Expand Up @@ -63,12 +60,12 @@ def setUp(self):
def assert_starts_with(self, a, b, msg=None):
self.assertTrue(
a.startswith(b),
msg or "{0} does not start with {1}".format(a, b))
msg or "{} does not start with {}".format(a, b))

def assert_ends_with(self, a, b, msg=None):
self.assertTrue(
a.endswith(b),
msg or "{0} does not end with {1}".format(a, b))
msg or "{} does not end with {}".format(a, b))


class TestBasics(TestPytracery):
Expand Down

0 comments on commit 130b204

Please sign in to comment.