Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Commit b3379af

Browse files
author
Sandro Rodrigues
committed
Added support to python 3 and configured ci to run tests with all python versions
1 parent 55dad01 commit b3379af

File tree

6 files changed

+61
-40
lines changed

6 files changed

+61
-40
lines changed

.travis.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
1+
sudo: false
12
language: python
3+
24
python:
3-
- 2.7
4-
sudo: false
5+
- "2.7"
6+
- "3.4"
7+
- "3.5"
8+
- "3.6"
9+
10+
env:
11+
matrix:
12+
- django110
13+
- django111
14+
- djangomaster
15+
16+
matrix:
17+
fast_finish: true
18+
include:
19+
- python: "3.4"
20+
env: flake8
21+
exclude:
22+
- python: "2.7"
23+
env: djangomaster
24+
- python: "3.6"
25+
env: django110
26+
allow_failures:
27+
- env: djangomaster
28+
29+
cache:
30+
directories:
31+
- $HOME/.cache/pip
32+
- $TRAVIS_BUILD_DIR/.tox
33+
534
install:
6-
- pip install tox
35+
- pip install --upgrade pip wheel setuptools
36+
- pip install coveralls codacy-coverage tox-travis
37+
738
script:
8-
- tox -e flake8
9-
- tox -e travis
39+
- tox
40+
41+
after_success:
42+
- coveralls
43+
- python-codacy-coverage -r coverage.xml

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Django CBMail
22
================
33

4-
|Build Status| |Codacy Badge| |Coverage Status| |BCH compliance|
4+
|Pypi| |Build Status| |Codacy Badge| |Coverage Status| |BCH compliance|
55

66
Django module to easily send templated emails in a DRY way using
77
classes, just like Class Based Views.
@@ -84,6 +84,8 @@ projects and commercial products.
8484
.. _Settings reference: #settings-reference
8585
.. _License: #license
8686

87+
.. |Pypi| image:: https://img.shields.io/pypi/v/django-cbmail.svg?style=flat-square
88+
:target: https://pypi.python.org/pypi/django-cbmail
8789
.. |Build Status| image:: https://travis-ci.org/dipcode-software/django-cbmail.svg?branch=master
8890
:target: https://travis-ci.org/dipcode-software/django-cbmail
8991
.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/d01ebbe43c684d478cacc530e44633ad

cbmail/tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TestBaseObject(BaseMail):
1717

1818
def get_attachments(self):
1919
f = NamedTemporaryFile()
20-
f.write('unit test')
20+
f.write(b'unit test')
2121
f.seek(0)
2222
attachment = open(f.name, 'rb')
2323
att = Attachment(

requirements/tests.txt

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

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Package meta-data.
1313
VERSION = __import__("cbmail").__version__
1414
NAME = 'django-cbmail'
15-
DESCRIPTION = 'Django module to easily send templated emails. '
15+
DESCRIPTION = 'Django module to easily send templated emails in a DRY way'
1616
URL = 'https://github.com/dipcode-software/django-cbmail/'
1717
EMAIL = 'team@dipcode.com'
1818
AUTHOR = 'Dipcode'
@@ -83,12 +83,16 @@ class DevelopmentPublishCommand(PublishCommand):
8383
classifiers=[
8484
'Environment :: Web Environment',
8585
'Framework :: Django',
86+
'Framework :: Django :: 1.10',
8687
'Framework :: Django :: 1.11',
8788
'Intended Audience :: Developers',
8889
'License :: OSI Approved :: MIT License',
8990
'Operating System :: OS Independent',
9091
'Programming Language :: Python',
9192
'Programming Language :: Python :: 2.7',
93+
'Programming Language :: Python :: 3.4',
94+
'Programming Language :: Python :: 3.5',
95+
'Programming Language :: Python :: 3.6',
9296
],
9397
cmdclass={
9498
'publish_dev': DevelopmentPublishCommand,

tox.ini

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,22 @@
11
[tox]
22
skipsdist = True
3-
envlist = py27,flake8
3+
envlist =
4+
{py27,py34,py35}-django{110,111},
5+
{py35,py36}-django{111,master},
6+
flake8
47

58
[testenv]
6-
deps = -r{toxinidir}/requirements/tests.txt
7-
commands = {envpython} runtests.py
8-
9-
[testenv:flake8]
10-
deps = flake8
11-
commands = flake8 {toxinidir}/cbmail --exclude=*/migrations/*,*settings*
12-
13-
[testenv:coverage]
14-
basepython=python2.7
15-
deps=
16-
-r{toxinidir}/requirements/tests.txt
17-
coverage
18-
setenv=
19-
PYTHONWARNINGS=ignore
20-
commands=
21-
coverage run runtests.py {posargs:}
22-
coverage report
23-
coverage erase
24-
25-
[testenv:travis]
26-
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
279
deps =
28-
-r{toxinidir}/requirements/tests.txt
2910
coverage
30-
coveralls
31-
codacy-coverage
32-
setenv =
33-
PYTHONWARNINGS=ignore
34-
commands =
11+
mock >= 2.0.0
12+
django110: Django>=1.10,<1.11
13+
django111: Django>=1.11,<2.0
14+
djangomaster: https://github.com/django/django/archive/master.tar.gz
15+
commands=
3516
coverage run runtests.py {posargs:}
3617
coverage report
3718
coverage xml
38-
coveralls
19+
20+
[testenv:flake8]
21+
deps = flake8
22+
commands = flake8 {toxinidir}/cbmail

0 commit comments

Comments
 (0)