Skip to content

Commit 3779bd4

Browse files
committed
Cleanup setup.py, remove python 3.3 compat and add django 1.8+master testing.
1 parent eefada1 commit 3779bd4

File tree

3 files changed

+25
-43
lines changed

3 files changed

+25
-43
lines changed

setup.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
import os
4-
import sys
54
import codecs
65
from setuptools import setup, find_packages
7-
from setuptools.command.test import test as TestCommand
86

97

108
def read(*parts):
@@ -24,7 +22,7 @@ def read(*parts):
2422

2523

2624
install_requires = [
27-
'django>=1.4,<1.8',
25+
'django>=1.4,<1.9',
2826
'babel>=1.3',
2927
]
3028

@@ -35,21 +33,6 @@ def read(*parts):
3533
'twine'
3634
]
3735

38-
39-
class PyTest(TestCommand):
40-
41-
def finalize_options(self):
42-
TestCommand.finalize_options(self)
43-
self.test_args = []
44-
self.test_suite = True
45-
46-
def run_tests(self):
47-
# import here, cause outside the eggs aren't loaded
48-
import pytest
49-
errno = pytest.main(self.test_args)
50-
sys.exit(errno)
51-
52-
5336
setup(
5437
name='django-babel',
5538
description='Utilities for using Babel in Django',
@@ -62,7 +45,6 @@ def run_tests(self):
6245
packages=find_packages(exclude=('tests',)),
6346
tests_require=test_requires,
6447
install_requires=install_requires,
65-
cmdclass={'test': PyTest},
6648
extras_require={
6749
'docs': ['sphinx'],
6850
'tox': ['tox'],
@@ -82,7 +64,6 @@ def run_tests(self):
8264
'Programming Language :: Python :: 2.6',
8365
'Programming Language :: Python :: 2.7',
8466
'Programming Language :: Python :: 3',
85-
'Programming Language :: Python :: 3.3',
8667
'Programming Language :: Python :: 3.4',
8768
'Programming Language :: Python :: Implementation :: PyPy',
8869
'Programming Language :: Python :: Implementation :: CPython',

tests/test_extract.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from babel._compat import BytesIO
77

88
from django_babel.extract import extract_django
9+
from django.utils.encoding import force_bytes
910

1011

1112
default_keys = extract.DEFAULT_KEYWORDS.keys()
@@ -45,12 +46,12 @@ def test_extract_with_interpolation(self):
4546
self.assertEqual([(1, None, u'xxx%(anton)sxxx', [])], messages)
4647

4748
def test_extract_unicode(self):
48-
buf = BytesIO(b'{% trans "@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ" %}')
49+
buf = BytesIO(force_bytes('{% trans "@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ" %}'))
4950
messages = list(extract_django(buf, default_keys, [], {}))
5051
self.assertEqual([(1, None, u'@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ', [])], messages)
5152

5253
def test_extract_unicode_blocktrans(self):
53-
buf = BytesIO(b'{% blocktrans %}@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ{% endblocktrans %}')
54+
buf = BytesIO(force_bytes('{% blocktrans %}@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ{% endblocktrans %}'))
5455
messages = list(extract_django(buf, default_keys, [], {}))
5556
self.assertEqual([(1, None, u'@ſðæ314“ſſ¶ÐĐÞ→SÆ^ĸŁ', [])], messages)
5657

@@ -78,7 +79,7 @@ def test_extract_singular_form(self):
7879
def test_trans_blocks_must_not_include_other_block_tags(self):
7980
buf = BytesIO(b'{% blocktrans %}{% other_tag %}{% endblocktrans %}')
8081
gen = extract_django(buf, default_keys, [], {})
81-
pytest.raises(SyntaxError, gen.next)
82+
pytest.raises(SyntaxError, next, gen)
8283

8384
def test_extract_var(self):
8485
buf = BytesIO(b'{{ book }}')

tox.ini

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
skipsdist = True
33
usedevelop = True
44
commands =
5+
pip install --upgrade setuptools pip
56
pip install -e {toxinidir}
67
pip install -e {toxinidir}[tests]
8+
py.test
79

810
deps15 =
9-
https://github.com/django/django/archive/stable/1.5.x.zip#egg=django
11+
https://github.com/django/django/archive/stable/1.5.x.tar.gz#egg=django
1012
deps16 =
11-
https://github.com/django/django/archive/stable/1.6.x.zip#egg=django
13+
https://github.com/django/django/archive/stable/1.6.x.tar.gz#egg=django
1214
deps17 =
13-
https://github.com/django/django/archive/stable/1.7.x.zip#egg=django
15+
https://github.com/django/django/archive/stable/1.7.x.tar.gz#egg=django
16+
deps18 =
17+
https://github.com/django/django/archive/stable/1.8.x.tar.gz#egg=django
1418
master =
15-
https://github.com/django/django/archive/stable/1.7.x.zip#egg=django
19+
https://github.com/django/django/archive/master.tar.gz#egg=django
1620

1721
[testenv:2.6-1.5.x]
1822
basepython = python2.6
@@ -34,24 +38,12 @@ deps = {[testenv]deps16}
3438
basepython = python2.7
3539
deps = {[testenv]deps17}
3640

37-
[testenv:2.7-master]
41+
[testenv:2.7-1.8.x]
3842
basepython = python2.7
39-
deps = {[testenv]master}
40-
41-
[testenv:3.3-1.5.x]
42-
basepython = python3.3
43-
deps = {[testenv]deps15}
44-
45-
[testenv:3.3-1.6.x]
46-
basepython = python3.3
47-
deps = {[testenv]deps16}
48-
49-
[testenv:3.3-1.7.x]
50-
basepython = python3.3
51-
deps = {[testenv]deps17}
43+
deps = {[testenv]deps18}
5244

53-
[testenv:3.3-master]
54-
basepython = python3.3
45+
[testenv:2.7-master]
46+
basepython = python2.7
5547
deps = {[testenv]master}
5648

5749
[testenv:3.4-1.5.x]
@@ -66,6 +58,10 @@ deps = {[testenv]deps16}
6658
basepython = python3.4
6759
deps = {[testenv]deps17}
6860

61+
[testenv:3.4-1.8.x]
62+
basepython = python3.4
63+
deps = {[testenv]deps18}
64+
6965
[testenv:3.4-master]
7066
basepython = python3.4
7167
deps = {[testenv]master}
@@ -82,6 +78,10 @@ deps = {[testenv]deps17}
8278
basepython = pypy
8379
deps = {[testenv]deps17}
8480

81+
[testenv:pypy-1.8.x]
82+
basepython = pypy
83+
deps = {[testenv]deps18}
84+
8585
[testenv:pypy-master]
8686
basepython = pypy
8787
deps = {[testenv]master}

0 commit comments

Comments
 (0)