Skip to content

Commit

Permalink
Add Python 3.6, drop Python 3.3.
Browse files Browse the repository at this point in the history
Fixes #6

- Badges
- Universal wheels
- Rename .txt -> .rst
- Set up coverage environment and coveralls
  - Only 93% covered.
- Use zope.testrunner for namespace path issues.
  • Loading branch information
jamadden committed Aug 28, 2017
1 parent a33d27c commit 0861d85
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 49 deletions.
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
source = zope.sendmail

[report]
precision = 2
exclude_lines =
pragma: no cover
if __name__ == '__main__':
raise NotImplementedError
self.fail
raise AssertionError
raise unittest.Skip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ bin/
develop-eggs/
eggs/
parts/
.coverage
htmlcov/
19 changes: 14 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ language: python
sudo: false
python:
- 2.7
- 3.3
- 3.4
- 3.5
- pypy
- pypy3
- 3.6
# Force a newer PyPy on the old 'precise' CI image
# in order to install 'cryptography' needed for coveralls
# After September 2017 this should be the default and the version
# pin can be removed.
- pypy-5.6.0
- pypy3.5-5.8.0
install:
- pip install -e .[test]
- pip install -U pip setuptools
- pip install -U coverage coveralls
- pip install -U -e .[test]
script:
- python setup.py test -q
- coverage run -m zope.testrunner --test-path=src
after_success:
- coveralls
notifications:
email: false
cache: pip
51 changes: 26 additions & 25 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
Changes
=======
=========
Changes
=========

4.1.0 (unreleased)
------------------
==================

- Make the data manager sort key a string, this fixes Python 3 where
strings and integers are not sortable. This would happen when using
other data managers with string sort keys.

- Add support for Python 3.5.
- Add support for Python 3.5 and 3.6.

- Drop support for Python 2.6.
- Drop support for Python 2.6 and 3.3.

- Declare explicit dependency on ``pywin32`` on Windows.


4.0.1 (2014-12-29)
------------------
==================

- Add support for PyPy3.


4.0.0 (2014-12-20)
------------------
==================

- Add support for testing on Travis-CI against supported Python verisons.

Expand All @@ -34,13 +35,13 @@ Changes


4.0.0a2 (2013-02-26)
--------------------
====================

- Fix license Trove classifier.


4.0.0a1 (2013-02-25)
--------------------
====================

- Add support for Python 3.3.

Expand Down Expand Up @@ -75,7 +76,7 @@ Changes
parsing to use optparse (not argparse, since Python 2.6 is still supported).

3.7.5 (2012-05-23)
------------------
==================

- Ensure that the 'queuedDelivery' directive has the same discriminator
as the 'directDelivery' directive (they are mutually incompatible).
Expand All @@ -85,18 +86,18 @@ Changes
https://bugs.launchpad.net/zope.sendmail/+bug/1003288

3.7.4 (2010-10-01)
------------------
==================

- Handle unicode usernames and passwords, encoding them to UTF-8. Fix for
https://bugs.launchpad.net/zope.sendmail/+bug/597143

3.7.3 (2010-09-25)
------------------
==================

- Add not declared, but needed test dependency on `zope.component [test]`.

3.7.2 (2010-04-30)
------------------
==================

- Remove no longer required testing dependency on zope.testing.

Expand All @@ -106,13 +107,13 @@ Changes
- Tests use stdlib doctest instead of zope.testing.doctest.

3.7.1 (2010-01-13)
------------------
==================

- Backward compatibility import of zope.sendmail.queue.QueueProcessorThread in
zope.sendmail.delivery.

3.7.0 (2010-01-12)
------------------
==================

- Remove dependency on ``zope.security``: the security support is optional,
and only available if the ``zope.security`` package is available. This change
Expand All @@ -131,13 +132,13 @@ Changes
either process the messages in the queue once, or run in "daemon" mode.

3.6.1 (2009-11-16)
------------------
==================

- Depend on ``zope.component`` >= 3.8.0, which supports the new semantic of
zope.component.zcml.proxify needed by zope.sendmail.zcml.

3.6.0 (2009-09-14)
------------------
==================

- Use simple vocabulary factory function instead of custom `UtilityTerm`
and `UtilityVocabulary` classes, copied from ``zope.app.component`` in
Expand All @@ -151,7 +152,7 @@ Changes
https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .

3.5.1 (2009-01-26)
------------------
==================

- Copyover the UtilityTerm and UtilityVocabulary implementation from
zope.app.component to avoid a dependency.
Expand All @@ -160,19 +161,19 @@ Changes
delivered where just the quit failed.

3.5.0 (2008-07-05)
------------------
==================

- final release (identical with 3.5.0b2)

3.5.0b2 (2007-12-19)
--------------------
====================

- If the SMTP server rejects a message (for example, when the sender or
recipient address is malformed), that email stays in the queue forever
(https://bugs.launchpad.net/zope3/+bug/157104).

3.5.0b1 (2007-11-08)
--------------------
====================

- Add README.txt
- Can now talk to servers that don't implement EHLO
Expand All @@ -182,7 +183,7 @@ Changes


3.5.0a2 (2007-10-23)
--------------------
====================

- Clean up ``does_esmtp`` in faux SMTP connection classes provided by the
tests.
Expand All @@ -192,7 +193,7 @@ Changes


3.5.0a1 (2007-10-23)
--------------------
====================

- ``QueueProcessorThread`` now accepts an optional parameter *interval* for
defining how often to process the mail queue (default is 3 seconds)
Expand All @@ -203,15 +204,15 @@ Changes


3.4.0 (2007-08-20)
--------------------
==================

- Bugfix: Don't keep open files around for every email message
to be sent on transaction commit. People who try to send many emails
in a single transaction now will not run out of file descriptors.


3.4.0a1 (2007-04-22)
--------------------
====================

Initial release as a separate project, corresponds to ``zope.sendmail``
from Zope 3.4.0a1.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include *.txt
include *.py
include buildout.cfg
include tox.ini
include .travis.yml
include .coveragerc

recursive-include src *

Expand Down
16 changes: 14 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
``zope.sendmail``
=================
===============
zope.sendmail
===============

.. image:: https://img.shields.io/pypi/v/zope.sendmail.svg
:target: https://pypi.python.org/pypi/zope.sendmail/
:alt: Latest release

.. image:: https://img.shields.io/pypi/pyversions/zope.sendmail.svg
:target: https://pypi.org/project/zope.sendmail/
:alt: Supported Python versions

.. image:: https://travis-ci.org/zopefoundation/zope.sendmail.png?branch=master
:target: https://travis-ci.org/zopefoundation/zope.sendmail

.. image:: https://coveralls.io/repos/github/zopefoundation/zope.sendmail/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.sendmail?branch=master

zope.sendmail is a package for email sending from Zope 3 applications.
Email sending from Zope 3 applications works as follows:

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
TESTS_REQUIRE = [
'zope.security',
'zope.testing',
'zope.testrunner',
]

EXTRAS_REQUIRE = {
'test': TESTS_REQUIRE,
# ':sys_platform == "win32"': ['pywin32'],
# Because https://sourceforge.net/p/pywin32/bugs/680/
#':sys_platform == "win32"': ['pywin32'],
# Because https://sourceforge.net/p/pywin32/bugs/680/
':sys_platform == "win32"': ['pypiwin32'],
}

Expand All @@ -46,7 +47,7 @@ def read(*rnames):

setup(name='zope.sendmail',
version='4.1.0.dev0',
url='http://pypi.python.org/pypi/zope.sendmail',
url='http://github.com/zopefoundation/zope.sendmail',
license='ZPL 2.1',
description='Zope sendmail',
author='Zope Foundation and Contributors',
Expand All @@ -61,9 +62,9 @@ def read(*rnames):
'Programming Language :: Python :: 2',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: OS Independent',
Expand Down Expand Up @@ -94,4 +95,4 @@ def read(*rnames):
[console_scripts]
zope-sendmail = zope.sendmail.queue:run
"""
)
)
2 changes: 1 addition & 1 deletion src/zope/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__import__('pkg_resources').declare_namespace(__name__) # pragma: no cover
15 changes: 8 additions & 7 deletions src/zope/sendmail/README.txt → src/zope/sendmail/README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Using zope.sendmail
===================
=====================
Using zope.sendmail
=====================

This package is useful when your Zope 3 application wants to send email. It
integrates with the transaction mechanism and queues your emails to be sent on
successful commits only.


API
---
===

An application that wants to send an email can do so by getting the appropriate
IMailDelivery utility. The standard library's email module is useful for
Expand All @@ -33,7 +34,7 @@ http://mg.pov.lt/blog/unicode-emails-in-python.html


Configuration
-------------
=============

The code above used a named IMailDelivery utility. It is your responsibility
to define one, as Zope 3 doesn't provide one by default. You can define
Expand All @@ -60,7 +61,7 @@ time of web pages.


Mailers
-------
=======

The ``mailer`` argument of the ``mail:queuedDelivery`` utility chooses the
appropriate IMailer utility that will be used to deliver email. There
Expand Down Expand Up @@ -96,7 +97,7 @@ different SMTP server, define your own utility like this::


Testing
-------
=======

Obviously, you don't want your automated unit/functional test runs to send
real emails. You'll have to define a fake email delivery utility in your
Expand All @@ -116,7 +117,7 @@ Register it with the standard ``utility`` directive::


Problems with zope.sendmail
---------------------------
===========================

* The API is a bit inconvenient to use (e.g. you have to do the message
formatting by yourself).
Expand Down
18 changes: 14 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
[tox]
envlist =
py27,py33,py34,py35,pypy,pypy3
py27,py34,py35,py36,pypy,pypy3,coverage

[testenv]
commands =
python setup.py -q test -q
zope-testrunner --test-path=src []
deps =
zope.security
zope.testing
.[test]

[testenv:coverage]
usedevelop = true
basepython =
python3.6
commands =
coverage run -m zope.testrunner --test-path=src []
coverage report --fail-under=100
deps =
{[testenv]deps}
coverage

0 comments on commit 0861d85

Please sign in to comment.