From 921dd5d0d630c2bf577bd10a73bf293a597f5aa2 Mon Sep 17 00:00:00 2001 From: medmunds Date: Sat, 27 Feb 2016 11:10:58 -0800 Subject: [PATCH] Fork from Djrill and rename to "anymail" --- .gitignore | 1 - .travis.yml | 2 +- AUTHORS.txt | 9 ++++-- CONTRIBUTING.md | 6 ++-- LICENSE | 10 +++--- MANIFEST.in | 4 +-- {djrill => anymail}/__init__.py | 0 {djrill => anymail}/_version.py | 2 +- {djrill/mail => anymail/backends}/__init__.py | 0 .../djrill.py => anymail/backends/mandrill.py | 12 +++---- {djrill => anymail}/compat.py | 0 {djrill => anymail}/exceptions.py | 0 {djrill => anymail}/signals.py | 0 {djrill => anymail}/tests/__init__.py | 0 {djrill => anymail}/tests/mock_backend.py | 4 +-- {djrill => anymail}/tests/sample_image.png | Bin .../tests/test_mandrill_integration.py | 4 +-- .../tests/test_mandrill_send.py | 6 ++-- .../tests/test_mandrill_send_template.py | 2 +- .../tests/test_mandrill_session_sharing.py | 0 .../tests/test_mandrill_subaccounts.py | 0 .../tests/test_mandrill_webhook.py | 4 +-- {djrill => anymail}/urls.py | 0 {djrill => anymail}/views.py | 0 djrill/forms.py | 0 djrill/mail/backends/__init__.py | 0 djrill/models.py | 0 docs/conf.py | 30 +++++++++--------- runtests.py | 4 +-- setup.py | 28 ++++++++-------- 30 files changed, 68 insertions(+), 60 deletions(-) rename {djrill => anymail}/__init__.py (100%) rename {djrill => anymail}/_version.py (74%) rename {djrill/mail => anymail/backends}/__init__.py (100%) rename djrill/mail/backends/djrill.py => anymail/backends/mandrill.py (98%) rename {djrill => anymail}/compat.py (100%) rename {djrill => anymail}/exceptions.py (100%) rename {djrill => anymail}/signals.py (100%) rename {djrill => anymail}/tests/__init__.py (100%) rename {djrill => anymail}/tests/mock_backend.py (94%) rename {djrill => anymail}/tests/sample_image.png (100%) rename {djrill => anymail}/tests/test_mandrill_integration.py (97%) rename {djrill => anymail}/tests/test_mandrill_send.py (99%) rename {djrill => anymail}/tests/test_mandrill_send_template.py (99%) rename {djrill => anymail}/tests/test_mandrill_session_sharing.py (100%) rename {djrill => anymail}/tests/test_mandrill_subaccounts.py (100%) rename {djrill => anymail}/tests/test_mandrill_webhook.py (98%) rename {djrill => anymail}/urls.py (100%) rename {djrill => anymail}/views.py (100%) delete mode 100644 djrill/forms.py delete mode 100644 djrill/mail/backends/__init__.py delete mode 100644 djrill/models.py diff --git a/.gitignore b/.gitignore index c7de6dd..24567f9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ *.egg-info dist/ docs/_build/ -TODO.txt local.py diff --git a/.travis.yml b/.travis.yml index ed10cd2..62eded1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: false language: python matrix: include: - # Django 1.4: Python 2.6--2.7 (but Djrill doesn't support 2.6) + # Django 1.4: Python 2.6--2.7 (but Anymail doesn't support 2.6) - { env: DJANGO=django==1.4, python: 2.7 } # Django 1.5: Python 2.7, pypy - { env: DJANGO=django==1.5, python: 2.7 } diff --git a/AUTHORS.txt b/AUTHORS.txt index d83829f..64dd87d 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,5 +1,10 @@ -Django-Djrill -============= +Anymail +======= + +Mike Edmunds + + +Anymail was forked from Djrill, which included contributions from: Kenneth Love Chris Jones diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25d7e7b..12262d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -Djrill is maintained by its users. Your contributions are encouraged! +Anymail is maintained by its users. Your contributions are encouraged! -Please see [Contributing](https://djrill.readthedocs.org/en/latest/contributing/) -in the Djrill documentation for more information. +Please see [Contributing](https://anymail.readthedocs.org/en/latest/contributing/) +in the Anymail documentation for more information. diff --git a/LICENSE b/LICENSE index 31ec327..5657690 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ -Copyright (c) Brack3t and individual contributors. +[The BSD 3-Clause License] + +Copyright (c) Anymail Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -11,9 +13,9 @@ are permitted provided that the following conditions are met: notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of Brack3t nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/MANIFEST.in b/MANIFEST.in index 68d76c8..085afd7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include README.rst AUTHORS.txt LICENSE -recursive-include djrill *.py -prune djrill/tests +recursive-include anymail *.py +prune anymail/tests diff --git a/djrill/__init__.py b/anymail/__init__.py similarity index 100% rename from djrill/__init__.py rename to anymail/__init__.py diff --git a/djrill/_version.py b/anymail/_version.py similarity index 74% rename from djrill/_version.py rename to anymail/_version.py index 7b98c7f..80aabef 100644 --- a/djrill/_version.py +++ b/anymail/_version.py @@ -1,3 +1,3 @@ -VERSION = (2, 1, 'dev0') # Remove the 'dev' component in release branches +VERSION = (0, 1, 'dev0') # Remove the 'dev' component in release branches __version__ = '.'.join([str(x) for x in VERSION]) # major.minor.patch or major.minor.devN __minor_version__ = '.'.join([str(x) for x in VERSION[:2]]) # Sphinx's X.Y "version" diff --git a/djrill/mail/__init__.py b/anymail/backends/__init__.py similarity index 100% rename from djrill/mail/__init__.py rename to anymail/backends/__init__.py diff --git a/djrill/mail/backends/djrill.py b/anymail/backends/mandrill.py similarity index 98% rename from djrill/mail/backends/djrill.py rename to anymail/backends/mandrill.py index a0942b5..4b1b707 100644 --- a/djrill/mail/backends/djrill.py +++ b/anymail/backends/mandrill.py @@ -15,19 +15,19 @@ from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.message import sanitize_address, DEFAULT_ATTACHMENT_MIME_TYPE -from ..._version import __version__ -from ...exceptions import (DjrillError, MandrillAPIError, MandrillRecipientsRefused, - NotSerializableForMandrillError, NotSupportedByMandrillError) +from .._version import __version__ +from ..exceptions import (DjrillError, MandrillAPIError, MandrillRecipientsRefused, + NotSerializableForMandrillError, NotSupportedByMandrillError) -class DjrillBackend(BaseEmailBackend): +class MandrillBackend(BaseEmailBackend): """ Mandrill API Email Backend """ def __init__(self, **kwargs): """Init options from Django settings""" - super(DjrillBackend, self).__init__(**kwargs) + super(MandrillBackend, self).__init__(**kwargs) try: self.api_key = settings.MANDRILL_API_KEY @@ -223,7 +223,7 @@ class DjrillBackend(BaseEmailBackend): """Validate parsed_response, raising exceptions for any problems. Extend this to provide your own validation checks. - Validation exceptions should inherit from djrill.exceptions.DjrillException + Validation exceptions should inherit from anymail.exceptions.DjrillException for proper fail_silently behavior. The base version here checks for invalid or refused recipients. diff --git a/djrill/compat.py b/anymail/compat.py similarity index 100% rename from djrill/compat.py rename to anymail/compat.py diff --git a/djrill/exceptions.py b/anymail/exceptions.py similarity index 100% rename from djrill/exceptions.py rename to anymail/exceptions.py diff --git a/djrill/signals.py b/anymail/signals.py similarity index 100% rename from djrill/signals.py rename to anymail/signals.py diff --git a/djrill/tests/__init__.py b/anymail/tests/__init__.py similarity index 100% rename from djrill/tests/__init__.py rename to anymail/tests/__init__.py diff --git a/djrill/tests/mock_backend.py b/anymail/tests/mock_backend.py similarity index 94% rename from djrill/tests/mock_backend.py rename to anymail/tests/mock_backend.py index 0239cbc..1af49ee 100644 --- a/djrill/tests/mock_backend.py +++ b/anymail/tests/mock_backend.py @@ -16,12 +16,12 @@ MANDRILL_SUCCESS_RESPONSE = b"""[{ @override_settings(MANDRILL_API_KEY="FAKE_API_KEY_FOR_TESTING", - EMAIL_BACKEND="djrill.mail.backends.djrill.DjrillBackend") + EMAIL_BACKEND="anymail.backends.mandrill.MandrillBackend") class DjrillBackendMockAPITestCase(TestCase): """TestCase that uses Djrill EmailBackend with a mocked Mandrill API""" class MockResponse(requests.Response): - """requests.post return value mock sufficient for DjrillBackend""" + """requests.post return value mock sufficient for MandrillBackend""" def __init__(self, status_code=200, raw=MANDRILL_SUCCESS_RESPONSE, encoding='utf-8'): super(DjrillBackendMockAPITestCase.MockResponse, self).__init__() self.status_code = status_code diff --git a/djrill/tests/sample_image.png b/anymail/tests/sample_image.png similarity index 100% rename from djrill/tests/sample_image.png rename to anymail/tests/sample_image.png diff --git a/djrill/tests/test_mandrill_integration.py b/anymail/tests/test_mandrill_integration.py similarity index 97% rename from djrill/tests/test_mandrill_integration.py rename to anymail/tests/test_mandrill_integration.py index fbdfefd..e2283ea 100644 --- a/djrill/tests/test_mandrill_integration.py +++ b/anymail/tests/test_mandrill_integration.py @@ -7,7 +7,7 @@ from django.core import mail from django.test import TestCase from django.test.utils import override_settings -from djrill import MandrillAPIError, MandrillRecipientsRefused +from anymail import MandrillAPIError, MandrillRecipientsRefused MANDRILL_TEST_API_KEY = os.getenv('MANDRILL_TEST_API_KEY') @@ -16,7 +16,7 @@ MANDRILL_TEST_API_KEY = os.getenv('MANDRILL_TEST_API_KEY') @unittest.skipUnless(MANDRILL_TEST_API_KEY, "Set MANDRILL_TEST_API_KEY environment variable to run integration tests") @override_settings(MANDRILL_API_KEY=MANDRILL_TEST_API_KEY, - EMAIL_BACKEND="djrill.mail.backends.djrill.DjrillBackend") + EMAIL_BACKEND="anymail.backends.mandrill.MandrillBackend") class DjrillIntegrationTests(TestCase): """Mandrill API integration tests diff --git a/djrill/tests/test_mandrill_send.py b/anymail/tests/test_mandrill_send.py similarity index 99% rename from djrill/tests/test_mandrill_send.py rename to anymail/tests/test_mandrill_send.py index c6a7a5a..1fce013 100644 --- a/djrill/tests/test_mandrill_send.py +++ b/anymail/tests/test_mandrill_send.py @@ -19,8 +19,8 @@ from django.core.mail import make_msgid from django.test import TestCase from django.test.utils import override_settings -from djrill import (MandrillAPIError, MandrillRecipientsRefused, - NotSerializableForMandrillError, NotSupportedByMandrillError) +from anymail import (MandrillAPIError, MandrillRecipientsRefused, + NotSerializableForMandrillError, NotSupportedByMandrillError) from .mock_backend import DjrillBackendMockAPITestCase @@ -742,7 +742,7 @@ class DjrillMandrillGlobalFeatureTests(DjrillBackendMockAPITestCase): [{'name': 'TEST', 'content': 'Hello'}]) -@override_settings(EMAIL_BACKEND="djrill.mail.backends.djrill.DjrillBackend") +@override_settings(EMAIL_BACKEND="anymail.backends.mandrill.MandrillBackend") class DjrillImproperlyConfiguredTests(TestCase): """Test Djrill backend without Djrill-specific settings in place""" diff --git a/djrill/tests/test_mandrill_send_template.py b/anymail/tests/test_mandrill_send_template.py similarity index 99% rename from djrill/tests/test_mandrill_send_template.py rename to anymail/tests/test_mandrill_send_template.py index d45caa5..3ed4256 100644 --- a/djrill/tests/test_mandrill_send_template.py +++ b/anymail/tests/test_mandrill_send_template.py @@ -1,6 +1,6 @@ from django.core import mail -from djrill import MandrillAPIError +from anymail import MandrillAPIError from .mock_backend import DjrillBackendMockAPITestCase diff --git a/djrill/tests/test_mandrill_session_sharing.py b/anymail/tests/test_mandrill_session_sharing.py similarity index 100% rename from djrill/tests/test_mandrill_session_sharing.py rename to anymail/tests/test_mandrill_session_sharing.py diff --git a/djrill/tests/test_mandrill_subaccounts.py b/anymail/tests/test_mandrill_subaccounts.py similarity index 100% rename from djrill/tests/test_mandrill_subaccounts.py rename to anymail/tests/test_mandrill_subaccounts.py diff --git a/djrill/tests/test_mandrill_webhook.py b/anymail/tests/test_mandrill_webhook.py similarity index 98% rename from djrill/tests/test_mandrill_webhook.py rename to anymail/tests/test_mandrill_webhook.py index 2f0e9ec..be7fdde 100644 --- a/djrill/tests/test_mandrill_webhook.py +++ b/anymail/tests/test_mandrill_webhook.py @@ -8,8 +8,8 @@ from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override_settings -from djrill.compat import b -from djrill.signals import webhook_event +from anymail.compat import b +from anymail.signals import webhook_event class DjrillWebhookSecretMixinTests(TestCase): diff --git a/djrill/urls.py b/anymail/urls.py similarity index 100% rename from djrill/urls.py rename to anymail/urls.py diff --git a/djrill/views.py b/anymail/views.py similarity index 100% rename from djrill/views.py rename to anymail/views.py diff --git a/djrill/forms.py b/djrill/forms.py deleted file mode 100644 index e69de29..0000000 diff --git a/djrill/mail/backends/__init__.py b/djrill/mail/backends/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/djrill/models.py b/djrill/models.py deleted file mode 100644 index e69de29..0000000 diff --git a/docs/conf.py b/docs/conf.py index 895e3d8..ac6eab6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # -# Djrill documentation build configuration file, created by -# sphinx-quickstart on Sat Mar 2 13:07:34 2013. +# Anymail documentation build configuration file, created by +# sphinx-quickstart # # This file is execfile()d with the current directory set to its containing dir. # @@ -18,10 +18,10 @@ import sys, os # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) -# define __version__ and __minor_version__ from ../djrill/_version.py, -# but without importing from djrill (which would make docs dependent on Django, etc.) -with open("../djrill/_version.py") as f: - code = compile(f.read(), "../djrill/_version.py", 'exec') +# define __version__ and __minor_version__ from ../anymail/_version.py, +# but without importing from anymail (which would make docs dependent on Django, etc.) +with open("../anymail/_version.py") as f: + code = compile(f.read(), "../anymail/_version.py", 'exec') exec(code) # -- General configuration ----------------------------------------------------- @@ -46,9 +46,9 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'Djrill' +project = u'Anymail' # noinspection PyShadowingBuiltins -copyright = u'2015, Djrill contributors (see AUTHORS.txt)' +copyright = u'2016, Anymail contributors (see AUTHORS.txt)' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -171,7 +171,7 @@ html_static_path = ['_static'] #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'Djrilldoc' +htmlhelp_basename = 'Anymaildoc' # -- Options for LaTeX output -------------------------------------------------- @@ -190,8 +190,8 @@ latex_elements = { # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Djrill.tex', u'Djrill Documentation', - u'Djrill contributors (see AUTHORS.txt)', 'manual'), + ('index', 'Anymail.tex', u'Anymail Documentation', + u'Anymail contributors (see AUTHORS.txt)', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -220,8 +220,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'djrill', u'Djrill Documentation', - [u'Djrill contributors (see AUTHORS.txt)'], 1) + ('index', 'anymail', u'Anymail Documentation', + [u'Anymail contributors (see AUTHORS.txt)'], 1) ] # If true, show URL addresses after external links. @@ -234,8 +234,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Djrill', u'Djrill Documentation', - u'Djrill contributors (see AUTHORS.txt)', 'Djrill', 'Mandrill integration for Django.', + ('index', 'Anymail', u'Anymail Documentation', + u'Anymail contributors (see AUTHORS.txt)', 'Anymail', 'Multi-ESP transactional email for Django.', 'Miscellaneous'), ] diff --git a/runtests.py b/runtests.py index 9056905..7309e31 100644 --- a/runtests.py +++ b/runtests.py @@ -5,7 +5,7 @@ import sys from django.conf import settings -APP = 'djrill' +APP = 'anymail' settings.configure( DEBUG=True, @@ -29,7 +29,7 @@ settings.configure( 'django.contrib.auth.middleware.AuthenticationMiddleware', ), TEMPLATES=[ - # Djrill doesn't have any templates, but tests need a TEMPLATES + # Anymail doesn't have any templates, but tests need a TEMPLATES # setting to avoid warnings from the Django 1.8+ test client. { 'BACKEND': 'django.template.backends.django.DjangoTemplates', diff --git a/setup.py b/setup.py index 5c83549..f9cbefb 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,18 @@ from setuptools import setup import re -# define __version__ and __minor_version__ from djrill/_version.py, -# but without importing from djrill (which would break setup) -with open("djrill/_version.py") as f: - code = compile(f.read(), "djrill/_version.py", 'exec') +# define __version__ and __minor_version__ from anymail/_version.py, +# but without importing from anymail (which would break setup) +__version__ = "UNSET" +__minor_version__ = "UNSET" +with open("anymail/_version.py") as f: + code = compile(f.read(), "anymail/_version.py", 'exec') exec(code) def long_description_from_readme(rst): # In release branches, freeze some external links to refer to this X.Y version: - if not "dev" in __version__: + if "dev" not in __version__: rst = re.sub(r'branch=master', 'branch=v' + __minor_version__, rst) # Travis build status rst = re.sub(r'/latest', '/v' + __minor_version__, rst) # ReadTheDocs return rst @@ -19,27 +21,27 @@ with open('README.rst') as f: long_description = long_description_from_readme(f.read()) setup( - name="djrill", + name="django-anymail", version=__version__, - description='Mandrill transactional email for Django', - keywords="django, mailchimp, mandrill, email, email backend", - author="Kenneth Love , Chris Jones ", - author_email="kenneth@brack3t.com", - url="https://github.com/brack3t/Djrill/", + description='Multi-ESP transactional email for Django', + keywords="django, email, email backend, mailgun, mandrill, postmark, sendgrid", + author="Mike Edmunds ", + author_email="medmunds@gmail.com", + url="https://github.com/anymail/anymail/", license="BSD License", - packages=["djrill"], + packages=["anymail"], zip_safe=False, install_requires=["requests>=1.0.0", "django>=1.4"], include_package_data=True, test_suite="runtests.runtests", tests_require=["mock", "six"], classifiers=[ + "Development Status :: 2 - Pre-Alpha", "Programming Language :: Python", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "License :: OSI Approved :: BSD License",