From fcd11ce324d69185d1651a8a88aa82acf32747fc Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 01:03:52 -0700 Subject: [PATCH 01/21] Fix broken links from linkcheck --- docs/index.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a1ced01..743f3ad 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -254,7 +254,7 @@ For example:: The email is not actually sent until the transaction is committed. -When the `repoze.tm2 `_ ``tm`` +When the `repoze.tm2 `_ ``tm`` middleware is in your Pyramid WSGI pipeline or if you've included the ``pyramid_tm`` package in your Pyramid configuration, transactions are already managed for you, so you don't need to explicitly commit or abort @@ -267,7 +267,7 @@ HTML email Below is a recipe how to send templatized HTML and plain text email. The email is assembled from three templates: subject, HTML body and text -body. It is also recommend to use `premailer `_ +body. It is also recommend to use `premailer `_ Python package to transform email CSS styles to inline CSS, as email clients are pretty restricted what comes to their ability to understand CSS. @@ -526,12 +526,11 @@ API :members: .. _Github: https://github.com/Pylons/pyramid_mailer -.. _Pyramid: http://pypi.python.org/pypi/pyramid/ +.. _Pyramid: https://pypi.org/project/pyramid/ .. _Ubuntu's Postfix guide: https://help.ubuntu.com/lts/serverguide/postfix.html .. _ArchLinux Postfix guide: https://wiki.archlinux.org/index.php/postfix -.. _OSX Postfix instructions: http://benjaminrojas.net/configuring-postfix-to- - send-mail-from-mac-os-x-mountain-lion +.. _OSX Postfix instructions: https://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/ .. _setup an SMTP with IIS: http://www.neatcomponents.com/enable-SMTP-in-Windows-8 -.. _repoze_sendmail: http://pypi.python.org/pypi/repoze.sendmail/ -.. _Lamson: http://pypi.python.org/pypi/lamson/ -.. _WebTest: http://pypi.python.org/pypi/WebTest/ +.. _repoze_sendmail: https://pypi.org/project/repoze.sendmail/ +.. _Lamson: https://pypi.org/project/lamson/ +.. _WebTest: https://pypi.org/project/WebTest/ From 8240ad924071f8df7e6eaafe615ca560dde44ad9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 01:19:58 -0700 Subject: [PATCH 02/21] PEP8, remove cargo code from Pyramid --- docs/conf.py | 345 ++++++++------------------------------------------- 1 file changed, 55 insertions(+), 290 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 9da831e..294d40f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,48 +3,26 @@ # pyramid documentation build configuration file, created by # sphinx-quickstart on Wed Jul 16 13:18:14 2008. # -# This file is execfile()d with the current directory set to its containing dir. +# This file is execfile()d with the current directory set to its containing +# dir. # # The contents of this file are pickled, so don't put values in the namespace -# that aren't pickleable (module imports are okay, they're removed automatically). +# that aren't pickleable (module imports are okay, they're removed +# automatically). # # All configuration values have a default value; values that are commented out # serve to show the default value. -import sys, os +import datetime import pkg_resources import pylons_sphinx_themes -import datetime -import inspect -import warnings - -warnings.simplefilter('ignore', DeprecationWarning) - -# skip raw nodes -from sphinx.writers.text import TextTranslator -from sphinx.writers.latex import LaTeXTranslator - -from docutils import nodes -from docutils import utils - -def raw(*arg): - raise nodes.SkipNode -TextTranslator.visit_raw = raw - - -# make sure :app:`Pyramid` doesn't mess up LaTeX rendering -def nothing(*arg): - pass -LaTeXTranslator.visit_inline = nothing -LaTeXTranslator.depart_inline = nothing -book = os.environ.get('BOOK') # General configuration # --------------------- -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', @@ -53,12 +31,12 @@ def nothing(*arg): intersphinx_mapping = { 'pyramid': ( - 'http://docs.pylonsproject.org/projects/pyramid/en/latest/', + 'https://docs.pylonsproject.org/projects/pyramid/en/latest/', None), } # Add any paths that contain templates here, relative to this directory. -#templates_path = ['_templates'] +# templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -68,7 +46,8 @@ def nothing(*arg): # General substitutions. project = 'Pyramid mailer library' -copyright = '%s, Dan Jacob' % datetime.datetime.now().year +thisyear = datetime.datetime.now().year +copyright = '2010 - %s, Dan Jacob' % thisyear # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -80,25 +59,26 @@ def nothing(*arg): # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. today_fmt = '%B %d, %Y' # List of documents that shouldn't be included in the build. -#unused_docs = [] +# unused_docs = [] -# List of directories, relative to source directories, that shouldn't be searched -# for source files. -#exclude_dirs = [] +# List of directories, relative to source directories, that shouldn't be +# searched for source files. +# exclude_dirs = [] # directories to ignore when looking for source files. -exclude_patterns = ['_themes/README.rst',] +exclude_patterns = ['_themes/README.rst', ] -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). @@ -106,15 +86,11 @@ def nothing(*arg): # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. -#pygments_style = book and 'bw' or 'tango' -if book: - pygments_style = 'bw' +pygments_style = 'sphinx' -# The default language to highlight source code in. -#highlight_language = 'guess' # Options for HTML output # ----------------------- @@ -122,71 +98,69 @@ def nothing(*arg): # Add and use Pylons theme html_theme_path = pylons_sphinx_themes.get_html_themes_path() html_theme = 'pyramid' -html_theme_options = dict(github_url='http://github.com/Pylons/pyramid_mailer') +html_theme_options = dict( + github_url='https://github.com/Pylons/pyramid_mailer') # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -#html_style = 'pyramid.css' +# html_style = 'pyramid.css' # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". html_title = 'pyramid_mailer v%s' % release # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = 'Home' +# html_short_title = 'Home' # The name of an image file (within the static path) to place at the top of # the sidebar. -#html_logo = '_static/pyramid.png' +# html_logo = '_static/pyramid.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = '_static/pyramid.ico' +# html_favicon = '_static/pyramid.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] +# html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%b %d, %Y' -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_use_modindex = True +# html_use_modindex = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, the reST sources are included in the HTML build as _sources/. -#html_copy_source = True +# html_copy_source = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' +# html_file_suffix = '' # Output file base name for HTML help builder. -htmlhelp_basename = 'pyramid' +htmlhelp_basename = 'pyramid_mailer' + # Options for LaTeX output # ------------------------ @@ -198,247 +172,38 @@ def nothing(*arg): latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, document class [howto/manual]). +# (source start file, target name, title, author, +# document class [howto/manual]). latex_documents = [ - ('latexindex', 'pyramid.tex', - 'The Pyramid Web Application Development Framework', - 'Chris McDonough', 'manual'), + ('latexindex', 'pyramid_mailer.tex', + 'pyramid_mailer', + 'Dan Jacob', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = '_static/pylons_small.png' +# latex_logo = '_static/pylons_small.png' # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -latex_use_parts = True +# latex_use_parts = True # Additional stuff for the LaTeX preamble. -#latex_preamble = '' +# latex_preamble = '' # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -latex_use_modindex = False - -## Say, for a moment that you have a twoside document that needs a 3cm -## inner margin to allow for binding and at least two centimetres the -## rest of the way around. You've been using the a4wide package up until -## now, because you like the amount of text it places on the -## page. Perhaps try something like this in your preamble: - -## \usepackage[bindingoffset=1cm,textheight=22cm,hdivide={2cm,*,2cm},vdivide={*,22cm,*}]{geometry} - -## _PREAMBLE = r"""\usepackage[bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}]{geometry}""" - -_PREAMBLE = r""" -\usepackage[]{geometry} -\geometry{bindingoffset=0.45in,textheight=7.25in,hdivide={0.5in,*,0.75in},vdivide={1in,7.25in,1in},papersize={7.5in,9.25in}} -\hypersetup{ - colorlinks=true, - linkcolor=black, - citecolor=black, - filecolor=black, - urlcolor=black -} -\fvset{frame=single,xleftmargin=9pt,numbersep=4pt} - -\pagestyle{fancy} - -% header and footer styles -\renewcommand{\chaptermark}[1]% - {\markboth{\MakeUppercase{\thechapter.\ #1}}{} - } -\renewcommand{\sectionmark}[1]% - {\markright{\MakeUppercase{\thesection.\ #1}} - } - -% defaults for fancy style -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\fancyhf{} -\fancyfoot[C]{\thepage} - -% plain style -\fancypagestyle{plain}{ - \renewcommand{\headrulewidth}{0pt} % ho header line - \renewcommand{\footrulewidth}{0pt}% no footer line - \fancyhf{} % empty header and footer - \fancyfoot[C]{\thepage} -} +# latex_use_modindex = False -% title page styles -\makeatletter -\def\@subtitle{\relax} -\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}} -\renewcommand{\maketitle}{ - \begin{titlepage} - {\rm\Huge\@title\par} - {\em\large\py@release\releaseinfo\par} - \if\@subtitle\relax\else\large\@subtitle\par\fi - {\large\@author\par} - \end{titlepage} -} -\makeatother - -% Redefine link and title colors -\definecolor{TitleColor}{rgb}{0,0,0} -\definecolor{InnerLinkColor}{rgb}{0.208,0.374,0.486} -\definecolor{OuterLinkColor}{rgb}{0.216,0.439,0.388} -% Redefine these colors to something not white if you want to have colored -% background and border for code examples. -\definecolor{VerbatimColor}{rgb}{1,1,1} -\definecolor{VerbatimBorderColor}{rgb}{1,1,1} - -\makeatletter -\renewcommand{\py@noticestart@warning}{\py@heavybox} -\renewcommand{\py@noticeend@warning}{\py@endheavybox} -\renewcommand{\py@noticestart@note}{\py@heavybox} -\renewcommand{\py@noticeend@note}{\py@endheavybox} -\makeatother - -% icons in note and warning boxes -\usepackage{ifthen} -% Keep a copy of the original notice environment -\let\origbeginnotice\notice -\let\origendnotice\endnotice - -% Redefine the notice environment so we can add our own code to it -\renewenvironment{notice}[2]{% - \origbeginnotice{#1}{}% equivalent to original \begin{notice}{#1}{#2} - % load graphics - \ifthenelse{\equal{#1}{warning}}{\includegraphics{latex-warning.png}}{} - \ifthenelse{\equal{#1}{note}}{\includegraphics{latex-note.png}}{} - % etc. -}{% - \origendnotice% equivalent to original \end{notice} -} - -% try to prevent code-block boxes from splitting across pages -\sloppy -\widowpenalty=300 -\clubpenalty=300 -\setlength{\parskip}{3ex plus 2ex minus 2ex} - -% suppress page numbers on pages showing part title -\makeatletter -\let\sv@endpart\@endpart -\def\@endpart{\thispagestyle{empty}\sv@endpart} -\makeatother - -% prevent page numbers in TOC (reset to fancy by frontmatter directive) -\pagestyle{empty} -""" - -latex_elements = { - 'preamble': _PREAMBLE, - 'wrapperclass':'book', - 'date':'', - 'releasename':'Version', - 'title':r'pyramid_mailer', -# 'pointsize':'12pt', # uncomment for 12pt version -} -# secnumdepth counter reset to 2 causes numbering in related matter; -# reset to -1 causes chapters to not be numbered, reset to -2 causes -# parts to not be numbered. - -#part -1 -#chapter 0 -#section 1 -#subsection 2 -#subsubsection 3 -#paragraph 4 -#subparagraph 5 - -def frontmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw( - '', - r""" -\frontmatter -% prevent part/chapter/section numbering -\setcounter{secnumdepth}{-2} -% suppress headers -\pagestyle{plain} -% reset page counter -\setcounter{page}{1} -% suppress first toc pagenum -\addtocontents{toc}{\protect\thispagestyle{empty}} -""", - format='latex')] - -def mainmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw( - '', - r""" -\mainmatter -% allow part/chapter/section numbering -\setcounter{secnumdepth}{2} -% get headers back -\pagestyle{fancy} -\fancyhf{} -\renewcommand{\headrulewidth}{0.5pt} -\renewcommand{\footrulewidth}{0pt} -\fancyfoot[C]{\thepage} -\fancyhead[RO]{\rightmark} -\fancyhead[LE]{\leftmark} -""", - format='latex')] - -def backmatter(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - return [nodes.raw('', '\\backmatter\n\\setcounter{secnumdepth}{-1}\n', - format='latex')] - -def app_role(role, rawtext, text, lineno, inliner, options={}, content=[]): - """custom role for :app: marker, does nothing in particular except allow - :app:`Pyramid` to work (for later search and replace).""" - if 'class' in options: - assert 'classes' not in options - options['classes'] = options['class'] - del options['class'] - return [nodes.inline(rawtext, utils.unescape(text), **options)], [] - - -def setup(app): - app.add_role('app', app_role) - app.add_directive('frontmatter', frontmatter, 1, (0, 0, 0)) - app.add_directive('mainmatter', mainmatter, 1, (0, 0, 0)) - app.add_directive('backmatter', backmatter, 1, (0, 0, 0)) - app.connect('autodoc-process-signature', resig) - -def resig(app, what, name, obj, options, signature, return_annotation): - """ Allow for preservation of ``@action_method`` decorated methods - in configurator """ - docobj = getattr(obj, '__docobj__', None) - if docobj is not None: - argspec = inspect.getargspec(docobj) - if argspec[0] and argspec[0][0] in ('cls', 'self'): - del argspec[0][0] - signature = inspect.formatargspec(*argspec) - return signature, return_annotation - -# turn off all line numbers in latex formatting - -## from pygments.formatters import LatexFormatter -## from sphinx.highlighting import PygmentsBridge - -## class NoLinenosLatexFormatter(LatexFormatter): -## def __init__(self, **options): -## LatexFormatter.__init__(self, **options) -## self.linenos = False - -## PygmentsBridge.latex_formatter = NoLinenosLatexFormatter - -# -- Options for Epub output --------------------------------------------------- +# -- Options for Epub output -------------------------------------------------- # Bibliographic Dublin Core info. epub_title = 'pyramid_mailer' epub_author = 'Dan Jacob' -epub_copyright = '2010-2011' +epub_copyright = '2010 - %s, Dan Jacob' % thisyear # The language of the text. It defaults to the language option # or en if the language is not set. @@ -455,14 +220,14 @@ def resig(app, what, name, obj, options, signature, return_annotation): # HTML files that should be inserted before the pages created by sphinx. # The format is a list of tuples containing the path and title. -#epub_pre_files = [] +# epub_pre_files = [] # HTML files shat should be inserted after the pages created by sphinx. # The format is a list of tuples containing the path and title. -#epub_post_files = [] +# epub_post_files = [] # A list of files that should not be packed into the epub file. -#epub_exclude_files = [] +# epub_exclude_files = [] # The depth of the table of contents in toc.ncx. epub_tocdepth = 3 From 9a74593a3f32bb49c51ffc69669509ad5ebea36b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 01:22:40 -0700 Subject: [PATCH 03/21] add contributing.md --- contributing.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 contributing.md diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..25960bb --- /dev/null +++ b/contributing.md @@ -0,0 +1,95 @@ +Contributing +============ + +All projects under the Pylons Projects, including this one, follow the guidelines established at [How to Contribute](https://pylonsproject.org/community-how-to-contribute.html) and [Coding Style and Standards](https://pylonsproject.org/community-coding-style-standards.html). + + +Get support +----------- + +See [Get Support](https://pylonsproject.org/community-support.html). You are reading this document most likely because you want to *contribute* to the project and not *get support*. + + +Working on issues +----------------- + +To respect both your time and ours, we emphasize the following points. + +* We use the [Issue Tracker on GitHub](https://github.com/Pylons/pyramid_mailer/issues) to discuss bugs, improvements, and feature requests. Search through existing issues before reporting a new one. Issues may be complex or wide-ranging. A discussion up front sets us all on the best path forward. +* Minor issues—such as spelling, grammar, and syntax—don't require discussion and a pull request is sufficient. +* After discussing the issue with maintainers and agreeing on a resolution, submit a pull request of your work. [GitHub Flow](https://guides.github.com/introduction/flow/index.html) describes the workflow process and why it's a good practice. + + +Git branches +------------ + +There is a single branch [master](https://github.com/Pylons/pyramid_mailer/) on which development takes place and from which releases to PyPI are tagged. This is the default branch on GitHub. + + +Running tests and building documentation +---------------------------------------- + +We use [tox](https://tox.readthedocs.io/en/latest/) to automate test running, coverage, and building documentation across all supported Python versions. + +To run everything configured in the `tox.ini` file: + + $ tox + +To run tests on Python 2 and 3, and ensure full coverage, but exclude building of docs: + + $ tox -e py2-cover,py3-cover,coverage + +To build the docs only: + + $ tox -e docs + +See the `tox.ini` file for details. + + +Contributing documentation +-------------------------- + +*Note:* These instructions might not work for Windows users. Suggestions to improve the process for Windows users are welcome by submitting an issue or a pull request. + +1. Fork the repo on GitHub by clicking the [Fork] button. +2. Clone your fork into a workspace on your local machine. + + cd ~/projects + git clone git@github.com:/pyramid_mailer.git + +3. Add a git remote "upstream" for the cloned fork. + + git remote add upstream git@github.com:Pylons/pyramid_mailer.git + +4. Set an environment variable to your virtual environment. + + # Mac and Linux + $ export VENV=~/projects/pyramid_mailer/env + + # Windows + set VENV=c:\projects\pyramid_mailer\env + +5. Try to build the docs in your workspace. + + # Mac and Linux + $ make clean html SPHINXBUILD=$VENV/bin/sphinx-build + + # Windows + c:\> make clean html SPHINXBUILD=%VENV%\bin\sphinx-build + + If successful, then you can make changes to the documentation. You can load the built documentation in the `/_build/html/` directory in a web browser. + +6. From this point forward, follow the typical [git workflow](https://help.github.com/articles/what-is-a-good-git-workflow/). Start by pulling from the upstream to get the most current changes. + + git pull upstream master + +7. Make a branch, make changes to the docs, and rebuild them as indicated in step 5. To speed up the build process, you can omit `clean` from the above command to rebuild only those pages that depend on the files you have changed. + +8. Once you are satisfied with your changes and the documentation builds successfully without errors or warnings, then git commit and push them to your "origin" repository on GitHub. + + git commit -m "commit message" + git push -u origin --all # first time only, subsequent can be just 'git push'. + +9. Create a [pull request](https://help.github.com/articles/using-pull-requests/). + +10. Repeat the process starting from Step 6. From b99925b330213daf8cea61fb59b245eb1c718028 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 01:55:30 -0700 Subject: [PATCH 04/21] Include CHANGES.rst into index.rst - Cleanup syntax for both files --- CHANGES.rst | 91 ++++++++++++++++++++++++++++++++------------------ docs/index.rst | 14 ++++++-- 2 files changed, 69 insertions(+), 36 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 6e9a6eb..ee75590 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,40 +1,57 @@ -Changelog -========= +.. _vunreleased: + +unreleased +^^^^^^^^^^ + +- Bring repo up to Pylons Project standards. + See https://github.com/Pylons/pyramid_mailer/pull/89 + +- Optionally include bcc information on send. + See https://github.com/Pylons/pyramid_mailer/pull/87 + +.. _v0.15.1: 0.15.1 (2016-12-13) -------------------- +^^^^^^^^^^^^^^^^^^^ -- Pull #83: Add the new ``.bind`` method to the ``DebugMailer`` and the +- Add the new ``.bind`` method to the ``DebugMailer`` and the ``DummyMailer``. Also ``pyramid_mailer.testing`` and ``pyramid_mailer.debug`` now add the ``request.mailer`` request attribute. + https://github.com/Pylons/pyramid_mailer/pull/83 0.15 (2016-12-06) ------------------ +^^^^^^^^^^^^^^^^^ -- Pull #49: Support '7bit' and '8bit' transfer-encoding. +- Support '7bit' and '8bit' transfer-encoding. + https://github.com/Pylons/pyramid_mailer/pull/49 -- Pull #70: If ``username`` and ``password`` are both set to the empty string, +- If ``username`` and ``password`` are both set to the empty string, ``Mailer.from_settings``, now interprets them as being set to ``None``. Previously, setting them to the empty string caused SMTP authentication to be force with empty username and password. + https://github.com/Pylons/pyramid_mailer/pull/70 -- Pull #71: Add a ``content_id`` argument to the ``Attachment`` constructor +- Add a ``content_id`` argument to the ``Attachment`` constructor which allows you to set the Content-ID header so you can reference it from an HTML body. + https://github.com/Pylons/pyramid_mailer/pull/71 -- Pull #72: Change file extension to ``.eml`` for mails saved from +- Change file extension to ``.eml`` for mails saved from ``DebugMailer``. ``.eml`` is the standard file format for storing plaintext MIME (rfc822) emails. + https://github.com/Pylons/pyramid_mailer/pull/72 -- Pull #77: Drop Python 2.6 and 3.2 support. +- Drop Python 2.6 and 3.2 support. + https://github.com/Pylons/pyramid_mailer/pull/77 - Add Python 3.5 support. -- Pull #78: Support per-request transaction managers if available via +- Support per-request transaction managers if available via ``request.tm`` set by ``pyramid_tm``. + https://github.com/Pylons/pyramid_mailer/pull/78 0.14.1 (2015-05-21) -------------------- +^^^^^^^^^^^^^^^^^^^ - Enable compatibility testing with Pyramid all the way back to 1.2. It may work earlier but we aren't testing it any longer. @@ -45,31 +62,36 @@ Changelog See https://github.com/Pylons/pyramid_mailer/pull/68 0.14 (2014-12-10) ------------------ +^^^^^^^^^^^^^^^^^ - Added support for Python3.4, PyPy3. -- Pull #56: Ensure that ``DebugMailer`` emulates ``Mailer`` by generating +- Ensure that ``DebugMailer`` emulates ``Mailer`` by generating a sender if none is passed. + https://github.com/Pylons/pyramid_mailer/pull/56 -- Pull #52: Add configuration options for ``mail.sendmail_app`` and +- Add configuration options for ``mail.sendmail_app`` and ``mail.sendmail_template`` to allow use with non-default sendmail configurations. + https://github.com/Pylons/pyramid_mailer/pull/52 -- Pull #50: Add ``pyramid_mailer.debug`` shorthand: via one line in +- Add ``pyramid_mailer.debug`` shorthand: via one line in ``development.ini``, enables writing emails to a file instead of sending them. + https://github.com/Pylons/pyramid_mailer/pull/50 0.13 (2013-07-13) ------------------ +^^^^^^^^^^^^^^^^^ -- Pull #45: Default transfer encoding for mail messages is now +- Default transfer encoding for mail messages is now 'quoted-printable'. + https://github.com/Pylons/pyramid_mailer/pull/45 0.12 (2013-06-26) ------------------ +^^^^^^^^^^^^^^^^^ -- Pull #35: aadded support for sendmail binary via repoze.sendmail >= 4.0b2. +- Added support for sendmail binary via repoze.sendmail >= 4.0b2. + https://github.com/Pylons/pyramid_mailer/pull/35 - Remove "all_parts" and "attach_all_parts" from MailResponse object (unused by pyramid_mailer). @@ -85,21 +107,24 @@ Changelog - Requires repoze.sendmail >= 4.1 0.11 (2013-03-28) ------------------ +^^^^^^^^^^^^^^^^^ -- Issue #29: Allow setting Content-Transfer-Encoding for body and html +- Allow setting Content-Transfer-Encoding for body and html via Attachments. + https://github.com/Pylons/pyramid_mailer/issue/29 -- Issue #32: Fix handling of messages with both HTML and plain text +- Fix handling of messages with both HTML and plain text bodies that also have attachments. + https://github.com/Pylons/pyramid_mailer/issue/32 -- Issue #24: ensure that ``pyramid_mailer.response.to_message`` returns +- ensure that ``pyramid_mailer.response.to_message`` returns text under Python 3.x. + https://github.com/Pylons/pyramid_mailer/issue/24 - Dropped support for Python 2.5. 0.10 (2012-11-22) ------------------ +^^^^^^^^^^^^^^^^^ - Set default transfer encoding for attachments to ``base64`` and allow an optional ``transfer_encoding`` argument for attachments. This currently @@ -113,7 +138,7 @@ Changelog - Use ``setup.py dev`` in tox.ini. 0.9 (2012-05-03) ----------------- +^^^^^^^^^^^^^^^^ - Add a test for uncode encoding in multipart messages. @@ -121,7 +146,7 @@ Changelog encoding). 0.8 (2012-03-26) ----------------- +^^^^^^^^^^^^^^^^ - Work around a Python 3.2.0 bug in handling emails with empty headers. This allows cc-only and bcc-only emails to be handled properly on all platforms @@ -129,12 +154,12 @@ Changelog https://github.com/Pylons/pyramid_mailer/issues/14. 0.7 (2012-03-26) ----------------- +^^^^^^^^^^^^^^^^ - Packaging release 0.6 (2012-03-20) ----------------- +^^^^^^^^^^^^^^^^ - Python 2.5, 2.6, 2.7, 3.2, and pypy compatibility. @@ -147,7 +172,7 @@ Changelog bcc-only messages. See https://github.com/Pylons/pyramid_mailer/issues/14 0.6 (2012-01-22) ----------------- +^^^^^^^^^^^^^^^^ - Use ',' as an email header field separator rather than ';' when multiple values are in the same header (as per RFC822). @@ -159,19 +184,19 @@ Changelog See https://github.com/Pylons/pyramid_mailer/pull/10 0.5.1 (2011-11-13) ------------------- +^^^^^^^^^^^^^^^^^^ - Fixed a bug where the mailer was only sending email to addresses in the "TO" field. 0.5 (2011-10-24) ----------------- +^^^^^^^^^^^^^^^^ - Drop Lamson dependency by copying Lamson's MailResponse and dependent code into ``pyramid_mailer.response``. 0.4.X ------ +^^^^^ - ``pyramid_mailer.includeme`` function added for ``config.include('pyramid_mailer')`` support diff --git a/docs/index.rst b/docs/index.rst index 743f3ad..e408fe5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,7 @@ +.. _index: + pyramid_mailer -================== +============== **pyramid_mailer** is a package for the `Pyramid`_ framework to take the pain out of sending emails. It is compatible with Python 2.7, 3.3, and 3.4, as well @@ -263,7 +265,7 @@ transaction will implicitly be aborted and mail will not be sent; otherwise it will be committed, and mail will be sent. HTML email --------------------- +---------- Below is a recipe how to send templatized HTML and plain text email. The email is assembled from three templates: subject, HTML body and text @@ -345,7 +347,6 @@ class:: You can pass the data either as a string or file object, so the above code could be rewritten:: - from pyramid_mailer.message import Attachment from pyramid_mailer.message import Message @@ -525,6 +526,13 @@ API .. autoclass:: BadHeaders :members: + +Change History +-------------- + +.. include:: ../CHANGES.rst + + .. _Github: https://github.com/Pylons/pyramid_mailer .. _Pyramid: https://pypi.org/project/pyramid/ .. _Ubuntu's Postfix guide: https://help.ubuntu.com/lts/serverguide/postfix.html From e892d386be0c902473fcf2052b1a7c58b026c1d0 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 01:58:48 -0700 Subject: [PATCH 05/21] Add RELEASING.txt --- RELEASING.txt | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 RELEASING.txt diff --git a/RELEASING.txt b/RELEASING.txt new file mode 100644 index 0000000..078e608 --- /dev/null +++ b/RELEASING.txt @@ -0,0 +1,106 @@ +Releasing +========= + +- For clarity, we define releases as follows. + + - Alpha, beta, dev and similar statuses do not qualify whether a release is + major or minor. The term "pre-release" means alpha, beta, or dev. + + - A release is final when it is no longer pre-release. + + - A *major* release is where the first number either before or after the + first dot increases. Examples: 1.0 to 1.1a1, or 0.9 to 1.0. + + - A *minor* or *bug fix* release is where the number after the second dot + increases. Example: 1.0 to 1.0.1. + +Prepare new release +------------------- + +- Do platform test via tox: + + $ tox -r + + Make sure statement coverage is at 100% (the test run will fail if not). + +- Run tests on Windows if feasible. + +- Ensure all features of the release are documented (audit CHANGES.rst or + communicate with contributors). + +- Change CHANGES.rst heading to reflect the new version number. + +- Minor releases should include a link under "Bug Fix Releases" to the minor + feature changes in CHANGES.rst. + +- Change setup.py version to the release version number. + +- Make sure PyPI long description renders (requires ``readme_renderer`` + installed into your Python):: + + $ python setup.py check -r -s -m + +- Create a release tag. + +- Make sure your Python has ``setuptools-git``, ``twine``, and ``wheel`` + installed and release to PyPI:: + + $ python setup.py sdist bdist_wheel + $ twine upload dist/pyramid_mailer-X.X-* + + +Prepare master for further development (major releases only) +------------------------------------------------------------ + +- In CHANGES.rst, preserve headings but clear out content. Add heading + "unreleased" for the version number. + +- Change setup.py version to the next version number. + + +Marketing and communications +---------------------------- + +- Announce to Twitter. + +``` +pyramid_mailer 1.x released. + +PyPI +https://pypi.org/project/pyramid_mailer/1.x/ + +Changes +https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#change-history + +Documentation: +https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ + +Issues +https://github.com/Pylons/pyramid_mailer/issues +``` + +- Announce to maillist. + +``` +pyramid_mailer 1.X has been released. + +The full changelog is here: +https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#change-history + +What's New In pyramid_mailer 1.X: +https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#VERSION-ANCHOR + +Documentation: +https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ + +You can install it via PyPI: + + pip install pyramid_mailer==1.X + +Enjoy, and please report any issues you find to the issue tracker at +https://github.com/Pylons/pyramid_mailer/issues + +Thanks! + +- pyramid_mailer core developers +``` From 4687e0be1ff1d5cc40735a4d7ca574e2919f5800 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 02:01:06 -0700 Subject: [PATCH 06/21] fix links, drop Python 3.3, add Python 3.6, fix syntax --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 16722e8..c1d242c 100644 --- a/README.rst +++ b/README.rst @@ -5,18 +5,18 @@ :target: https://travis-ci.org/Pylons/pyramid_mailer .. image:: https://readthedocs.org/projects/pyramid_mailer/badge/?version=latest - :target: http://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ + :target: https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ :alt: Documentation Status pyramid_mailer is a package for sending email from your Pyramid application. -It is compatible with Python 2.7, 3.3, 3.4, and 3.5, as well as PyPy. +It is compatible with Python 2.7, 3.4, 3.5, and 3.6, as well as PyPy. This package includes: 1. Wrapping the low-level Python ``email`` library with an easy-to-use API, which includes attachments and mulipart content. -2. Send emails immediately or to add to a maildir queue. +2. Send emails immediately or add to a ``maildir`` queue. 3. Managing email sends inside a transaction, to prevent emails being sent if your code raises an exception. @@ -32,7 +32,7 @@ Links ----- - `documentation - `_ + `_ -- `development version +- `code repository `_ From df9a414c89df15ef0b6fbbed7a07f7bb7b985943 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 02:02:27 -0700 Subject: [PATCH 07/21] fix link, drop Python 3.3, add Python 3.6 --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 11fe59c..0795af9 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ author_email='danjac354@gmail.com', description='Sendmail package for Pyramid', long_description='\n\n'.join([README, CHANGES]), - url="http://docs.pylonsproject.org/projects/pyramid-mailer/en/latest/", + url="https://docs.pylonsproject.org/projects/pyramid-mailer/en/latest/", packages=[ 'pyramid_mailer', ], @@ -59,8 +59,9 @@ "Programming Language :: Python", "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", "Framework :: Pyramid", From 6e27f18b3b100f57b36b4dbd175e3b7a656c3892 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 02:03:19 -0700 Subject: [PATCH 08/21] use consistent indentation --- .travis.yml | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 849a515..468abc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,31 +3,31 @@ language: python sudo: false matrix: - include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.3 - env: TOXENV=py34 - - python: 3.4 - env: TOXENV=py34 - - python: 3.5 - env: TOXENV=py35 - - python: pypy - env: TOXENV=pypy - - python: 3.5 - env: TOXENV=py2-cover,py3-cover,coverage - - python: 3.5 - env: TOXENV=docs - - python: 2.7 - env: TOXENV=py27-pyramid12 - - python: 2.7 - env: TOXENV=py27-pyramid13 - - python: 2.7 - env: TOXENV=py27-pyramid14 - - python: 2.7 - env: TOXENV=py27-pyramid15 - - python: 2.7 - env: TOXENV=py27-pyramid16 + include: + - python: 2.7 + env: TOXENV=py27 + - python: 3.3 + env: TOXENV=py34 + - python: 3.4 + env: TOXENV=py34 + - python: 3.5 + env: TOXENV=py35 + - python: pypy + env: TOXENV=pypy + - python: 3.5 + env: TOXENV=py2-cover,py3-cover,coverage + - python: 3.5 + env: TOXENV=docs + - python: 2.7 + env: TOXENV=py27-pyramid12 + - python: 2.7 + env: TOXENV=py27-pyramid13 + - python: 2.7 + env: TOXENV=py27-pyramid14 + - python: 2.7 + env: TOXENV=py27-pyramid15 + - python: 2.7 + env: TOXENV=py27-pyramid16 install: - travis_retry pip install tox From bace888c399c96d2941f194de81907ecf57d6b65 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 02:07:50 -0700 Subject: [PATCH 09/21] Drop Python 3.3. Add Python 3.6. Add Python 3.7 with allowed failure. Add notification to IRC --- .travis.yml | 11 +++++++++-- tox.ini | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 468abc3..486198b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,14 @@ matrix: include: - python: 2.7 env: TOXENV=py27 - - python: 3.3 - env: TOXENV=py34 - python: 3.4 env: TOXENV=py34 - python: 3.5 env: TOXENV=py35 + - python: 3.6 + env: TOXENV=py36 + - python: nightly + env: TOXENV=py37 - python: pypy env: TOXENV=pypy - python: 3.5 @@ -28,6 +30,8 @@ matrix: env: TOXENV=py27-pyramid15 - python: 2.7 env: TOXENV=py27-pyramid16 + allow_failures: + - env: TOXENV=py37 install: - travis_retry pip install tox @@ -38,3 +42,6 @@ script: notifications: email: - pyramid-checkins@lists.repoze.org + irc: + channels: + - "chat.freenode.net#pyramid" diff --git a/tox.ini b/tox.ini index 27cc5d1..ab69f9c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py27,py33,py34,py35,pypy, + py27,py34,py35,py36,py37,pypy, py27-pyramid{12,13,14,15,16}, docs, {py2,py3}-cover,coverage @@ -10,9 +10,10 @@ envlist = # to defaults for others. basepython = py27: python2.7 - py33: python3.3 py34: python3.4 py35: python3.5 + py36: python3.6 + py37: python3.7 pypy: pypy pypy3: pypy3 py2: python2.7 From f13fd0787c09955b372090ca7ef07d96fcb67c04 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 1 Jun 2018 15:22:31 -0700 Subject: [PATCH 10/21] Remove old and static Pyramid versions from testing --- .travis.yml | 10 ---------- tox.ini | 8 -------- 2 files changed, 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 486198b..6c90afb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,16 +20,6 @@ matrix: env: TOXENV=py2-cover,py3-cover,coverage - python: 3.5 env: TOXENV=docs - - python: 2.7 - env: TOXENV=py27-pyramid12 - - python: 2.7 - env: TOXENV=py27-pyramid13 - - python: 2.7 - env: TOXENV=py27-pyramid14 - - python: 2.7 - env: TOXENV=py27-pyramid15 - - python: 2.7 - env: TOXENV=py27-pyramid16 allow_failures: - env: TOXENV=py37 diff --git a/tox.ini b/tox.ini index ab69f9c..247e251 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] envlist = py27,py34,py35,py36,py37,pypy, - py27-pyramid{12,13,14,15,16}, docs, {py2,py3}-cover,coverage @@ -19,13 +18,6 @@ basepython = py2: python2.7 py3: python3.5 -deps = - pyramid12: pyramid <= 1.2.99 - pyramid13: pyramid <= 1.3.99 - pyramid14: pyramid <= 1.4.99 - pyramid15: pyramid <= 1.5.99 - pyramid16: pyramid <= 1.6.99 - commands = pip install -q pyramid_mailer[testing] nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:} From 0976410756a2368aded1e5d6230015c19df5f59d Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 2 Jun 2018 13:47:56 -0700 Subject: [PATCH 11/21] Change verb tense to align with others --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c1d242c..94bf75a 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ This package includes: 1. Wrapping the low-level Python ``email`` library with an easy-to-use API, which includes attachments and mulipart content. -2. Send emails immediately or add to a ``maildir`` queue. +2. Sending emails immediately or add to a ``maildir`` queue. 3. Managing email sends inside a transaction, to prevent emails being sent if your code raises an exception. From 1774f7eedaf82a3794534ff90c8dcf61f5546b65 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 4 Oct 2018 04:24:30 -0700 Subject: [PATCH 12/21] Add support for Ethical Ads on RTD - Fix broken links from linkcheck - No smartquotes --- CHANGES.rst | 6 +++--- README.rst | 2 +- docs/conf.py | 13 +++++++++++-- setup.py | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ee75590..049c61c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -111,15 +111,15 @@ unreleased - Allow setting Content-Transfer-Encoding for body and html via Attachments. - https://github.com/Pylons/pyramid_mailer/issue/29 + https://github.com/Pylons/pyramid_mailer/issues/29 - Fix handling of messages with both HTML and plain text bodies that also have attachments. - https://github.com/Pylons/pyramid_mailer/issue/32 + https://github.com/Pylons/pyramid_mailer/issues/32 - ensure that ``pyramid_mailer.response.to_message`` returns text under Python 3.x. - https://github.com/Pylons/pyramid_mailer/issue/24 + https://github.com/Pylons/pyramid_mailer/issues/24 - Dropped support for Python 2.5. diff --git a/README.rst b/README.rst index 94bf75a..a3d737f 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ :alt: Documentation Status pyramid_mailer is a package for sending email from your Pyramid application. -It is compatible with Python 2.7, 3.4, 3.5, and 3.6, as well as PyPy. +It is compatible with Python 2.7, 3.4, 3.5, 3.6, and 3.7 as well as PyPy. This package includes: diff --git a/docs/conf.py b/docs/conf.py index 294d40f..75e2954 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -71,7 +71,7 @@ # exclude_dirs = [] # directories to ignore when looking for source files. -exclude_patterns = ['_themes/README.rst', ] +# exclude_patterns = ['_themes/README.rst', ] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -132,7 +132,14 @@ html_last_updated_fmt = '%b %d, %Y' # Custom sidebar templates, maps document names to template names. -# html_sidebars = {} +# Control display of sidebars and include ethical ads from RTD +html_sidebars = {'**': [ + 'localtoc.html', + 'ethicalads.html', + 'relations.html', + 'sourcelink.html', + 'searchbox.html', +]} # Additional templates that should be rendered to pages, maps page names to # template names. @@ -197,6 +204,8 @@ # If false, no module index is generated. # latex_use_modindex = False +# Do not use smart quotes. +smartquotes = False # -- Options for Epub output -------------------------------------------------- diff --git a/setup.py b/setup.py index 0795af9..a4dafd4 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ from setuptools import setup docs_extras = [ - 'Sphinx', + 'Sphinx >= 1.8.1', 'docutils', 'repoze.sphinx.autointerface', - 'pylons-sphinx-themes >= 0.3', + 'pylons-sphinx-themes >= 1.0.10', ] tests_require = [] From 8079f3e78e80c35a0a4f0a100459133ca2c3ff00 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 4 Oct 2018 04:27:29 -0700 Subject: [PATCH 13/21] Support Python 3.7 and 3.8, with 3.8 as an allowed failure --- .travis.yml | 12 +++++++++--- docs/index.rst | 6 +++--- setup.py | 1 + tox.ini | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c90afb..6575f18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,16 +12,22 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 - - python: nightly + - python: 3.7 env: TOXENV=py37 + dist: xenial + sudo: true + - python: 3.8-dev + env: TOXENV=py38 + dist: xenial + sudo: true - python: pypy env: TOXENV=pypy - python: 3.5 env: TOXENV=py2-cover,py3-cover,coverage - python: 3.5 env: TOXENV=docs - allow_failures: - - env: TOXENV=py37 +allow_failures: + - env: TOXENV=py38 install: - travis_retry pip install tox diff --git a/docs/index.rst b/docs/index.rst index e408fe5..449e65f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,9 +3,9 @@ pyramid_mailer ============== -**pyramid_mailer** is a package for the `Pyramid`_ framework to take the pain -out of sending emails. It is compatible with Python 2.7, 3.3, and 3.4, as well -as PyPy. It has the following features: +**pyramid_mailer** is a package for the `Pyramid`_ framework to take the pain out of sending emails. +It is compatible with Python 2.7, 3.4, 3.5, 3.6, and 3.7 as well as PyPy. +It has the following features: 1. A wrapper around the low-level email functionality of standard Python. This includes handling multipart emails with both text and HTML diff --git a/setup.py b/setup.py index a4dafd4..71132ba 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,7 @@ "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", "Framework :: Pyramid", diff --git a/tox.ini b/tox.ini index 247e251..d52fb45 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py27,py34,py35,py36,py37,pypy, + py27,py34,py35,py36,py37,py38,pypy, docs, {py2,py3}-cover,coverage @@ -13,6 +13,7 @@ basepython = py35: python3.5 py36: python3.6 py37: python3.7 + py38: python3.8 pypy: pypy pypy3: pypy3 py2: python2.7 From b3f2059e9d09118b679c4ae385caa7fc0d7b70a8 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 4 Oct 2018 04:51:18 -0700 Subject: [PATCH 14/21] fix indent --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6575f18..794db5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: env: TOXENV=py2-cover,py3-cover,coverage - python: 3.5 env: TOXENV=docs -allow_failures: + allow_failures: - env: TOXENV=py38 install: From 12f164ff4d07ec8cd2c99b5ec04c175b96a10550 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 4 Oct 2018 05:01:34 -0700 Subject: [PATCH 15/21] Standardize contributing.md --- contributing.md | 86 ++++++++----------------------------------------- 1 file changed, 14 insertions(+), 72 deletions(-) diff --git a/contributing.md b/contributing.md index 25960bb..cbb6754 100644 --- a/contributing.md +++ b/contributing.md @@ -1,33 +1,24 @@ -Contributing -============ +# Contributing -All projects under the Pylons Projects, including this one, follow the guidelines established at [How to Contribute](https://pylonsproject.org/community-how-to-contribute.html) and [Coding Style and Standards](https://pylonsproject.org/community-coding-style-standards.html). +All projects under the Pylons Project, including this one, follow the guidelines established at [How to Contribute](https://pylonsproject.org/community-how-to-contribute.html), [Coding Style and Standards](https://pylonsproject.org/community-coding-style-standards.html), and [Pylons Project Documentation Style Guide](https://docs.pylonsproject.org/projects/pyramid_mailer/). +You can contribute to this project in several ways. -Get support ------------ +* [File an Issue on GitHub](https://github.com/Pylons/pyramid_mailer/issues) +* Fork this project, create a new branch, commit your suggested change, and push to your fork on GitHub. + When ready, submit a pull request for consideration. + [GitHub Flow](https://guides.github.com/introduction/flow/index.html) describes the workflow process and why it's a good practice. + When submitting a pull request, sign [CONTRIBUTORS.txt](https://github.com/Pylons/pyramid_mailer/blob/master/CONTRIBUTORS.txt) if you have not yet done so. +* Join the [IRC channel #pyramid on irc.freenode.net](https://webchat.freenode.net/?channels=pyramid). -See [Get Support](https://pylonsproject.org/community-support.html). You are reading this document most likely because you want to *contribute* to the project and not *get support*. +## Git Branches +Git branches and their purpose and status at the time of this writing are listed below. -Working on issues ------------------ +* [master](https://github.com/Pylons/pyramid_mailer/) - The branch which should always be *deployable*. The default branch on GitHub. +* For development, create a new branch. If changes on your new branch are accepted, they will be merged into the master branch and deployed. -To respect both your time and ours, we emphasize the following points. - -* We use the [Issue Tracker on GitHub](https://github.com/Pylons/pyramid_mailer/issues) to discuss bugs, improvements, and feature requests. Search through existing issues before reporting a new one. Issues may be complex or wide-ranging. A discussion up front sets us all on the best path forward. -* Minor issues—such as spelling, grammar, and syntax—don't require discussion and a pull request is sufficient. -* After discussing the issue with maintainers and agreeing on a resolution, submit a pull request of your work. [GitHub Flow](https://guides.github.com/introduction/flow/index.html) describes the workflow process and why it's a good practice. - - -Git branches ------------- - -There is a single branch [master](https://github.com/Pylons/pyramid_mailer/) on which development takes place and from which releases to PyPI are tagged. This is the default branch on GitHub. - - -Running tests and building documentation ----------------------------------------- +## Running tests and building documentation We use [tox](https://tox.readthedocs.io/en/latest/) to automate test running, coverage, and building documentation across all supported Python versions. @@ -44,52 +35,3 @@ To build the docs only: $ tox -e docs See the `tox.ini` file for details. - - -Contributing documentation --------------------------- - -*Note:* These instructions might not work for Windows users. Suggestions to improve the process for Windows users are welcome by submitting an issue or a pull request. - -1. Fork the repo on GitHub by clicking the [Fork] button. -2. Clone your fork into a workspace on your local machine. - - cd ~/projects - git clone git@github.com:/pyramid_mailer.git - -3. Add a git remote "upstream" for the cloned fork. - - git remote add upstream git@github.com:Pylons/pyramid_mailer.git - -4. Set an environment variable to your virtual environment. - - # Mac and Linux - $ export VENV=~/projects/pyramid_mailer/env - - # Windows - set VENV=c:\projects\pyramid_mailer\env - -5. Try to build the docs in your workspace. - - # Mac and Linux - $ make clean html SPHINXBUILD=$VENV/bin/sphinx-build - - # Windows - c:\> make clean html SPHINXBUILD=%VENV%\bin\sphinx-build - - If successful, then you can make changes to the documentation. You can load the built documentation in the `/_build/html/` directory in a web browser. - -6. From this point forward, follow the typical [git workflow](https://help.github.com/articles/what-is-a-good-git-workflow/). Start by pulling from the upstream to get the most current changes. - - git pull upstream master - -7. Make a branch, make changes to the docs, and rebuild them as indicated in step 5. To speed up the build process, you can omit `clean` from the above command to rebuild only those pages that depend on the files you have changed. - -8. Once you are satisfied with your changes and the documentation builds successfully without errors or warnings, then git commit and push them to your "origin" repository on GitHub. - - git commit -m "commit message" - git push -u origin --all # first time only, subsequent can be just 'git push'. - -9. Create a [pull request](https://help.github.com/articles/using-pull-requests/). - -10. Repeat the process starting from Step 6. From 8cb79e5ab576344216d10aef01b170a593e0017e Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 5 Oct 2018 19:44:24 -0700 Subject: [PATCH 16/21] Add anchors for releases. - There was a missing development release between 0.6 and 0.7 with the heading of 0.6. I renamed it to 0.7dev per setup.py at the time. --- CHANGES.rst | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 049c61c..ad50079 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -19,6 +19,9 @@ unreleased ``pyramid_mailer.debug`` now add the ``request.mailer`` request attribute. https://github.com/Pylons/pyramid_mailer/pull/83 + +.. _v0.15: + 0.15 (2016-12-06) ^^^^^^^^^^^^^^^^^ @@ -50,6 +53,9 @@ unreleased ``request.tm`` set by ``pyramid_tm``. https://github.com/Pylons/pyramid_mailer/pull/78 + +.. _v0.14.1: + 0.14.1 (2015-05-21) ^^^^^^^^^^^^^^^^^^^ @@ -61,6 +67,9 @@ unreleased to int comparisons are valid there but it was a latent bug. See https://github.com/Pylons/pyramid_mailer/pull/68 + +.. _v0.14: + 0.14 (2014-12-10) ^^^^^^^^^^^^^^^^^ @@ -80,6 +89,9 @@ unreleased them. https://github.com/Pylons/pyramid_mailer/pull/50 + +.. _v0.13: + 0.13 (2013-07-13) ^^^^^^^^^^^^^^^^^ @@ -87,6 +99,9 @@ unreleased 'quoted-printable'. https://github.com/Pylons/pyramid_mailer/pull/45 + +.. _v0.12: + 0.12 (2013-06-26) ^^^^^^^^^^^^^^^^^ @@ -106,6 +121,9 @@ unreleased - Requires repoze.sendmail >= 4.1 + +.. _v0.11: + 0.11 (2013-03-28) ^^^^^^^^^^^^^^^^^ @@ -123,6 +141,9 @@ unreleased - Dropped support for Python 2.5. + +.. _v0.10: + 0.10 (2012-11-22) ^^^^^^^^^^^^^^^^^ @@ -137,6 +158,9 @@ unreleased - Use ``setup.py dev`` in tox.ini. + +.. _v0.9: + 0.9 (2012-05-03) ^^^^^^^^^^^^^^^^ @@ -145,6 +169,9 @@ unreleased - Depend on ``repoze.sendmail`` >= 3.2 (fixes unicode multipart message encoding). + +.. _v0.8: + 0.8 (2012-03-26) ^^^^^^^^^^^^^^^^ @@ -153,13 +180,19 @@ unreleased (no recipient= required anymore). See https://github.com/Pylons/pyramid_mailer/issues/14. + +.. _v0.7: + 0.7 (2012-03-26) ^^^^^^^^^^^^^^^^ - Packaging release -0.6 (2012-03-20) -^^^^^^^^^^^^^^^^ + +.. _v0.7dev: + +0.7dev (2012-03-20) +^^^^^^^^^^^^^^^^^^^ - Python 2.5, 2.6, 2.7, 3.2, and pypy compatibility. @@ -171,6 +204,9 @@ unreleased - More descriptive exception raised when attempting to send cc-only or bcc-only messages. See https://github.com/Pylons/pyramid_mailer/issues/14 + +.. _v0.6: + 0.6 (2012-01-22) ^^^^^^^^^^^^^^^^ @@ -183,18 +219,27 @@ unreleased - Don't include ``Bcc`` header in mail messages (breaks secrecy of BCC). See https://github.com/Pylons/pyramid_mailer/pull/10 + +.. _v0.5.1: + 0.5.1 (2011-11-13) ^^^^^^^^^^^^^^^^^^ - Fixed a bug where the mailer was only sending email to addresses in the "TO" field. + +.. _v0.5: + 0.5 (2011-10-24) ^^^^^^^^^^^^^^^^ - Drop Lamson dependency by copying Lamson's MailResponse and dependent code into ``pyramid_mailer.response``. + +.. _v0.4.x: + 0.4.X ^^^^^ From 18257b2247f82487b187e368b737e07be9ba1289 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 5 Oct 2018 19:49:33 -0700 Subject: [PATCH 17/21] Move heading into proper location --- CHANGES.rst | 3 +++ docs/index.rst | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index ad50079..13347b8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,6 @@ +Change History +-------------- + .. _vunreleased: unreleased diff --git a/docs/index.rst b/docs/index.rst index 449e65f..c4731d8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -527,9 +527,6 @@ API :members: -Change History --------------- - .. include:: ../CHANGES.rst From bde87203143c4272754862030261f8d0fb07ab21 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 5 Oct 2018 20:09:09 -0700 Subject: [PATCH 18/21] Remove py38 from envlist --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d52fb45..1a23a05 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py27,py34,py35,py36,py37,py38,pypy, + py27,py34,py35,py36,py37,pypy, docs, {py2,py3}-cover,coverage From 494bdfdf39ee244fd242dc468e39c335006b2778 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Mon, 5 Nov 2018 12:44:58 +0900 Subject: [PATCH 19/21] restore old versions of Pyramid --- tox.ini | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tox.ini b/tox.ini index 1a23a05..4ab1e52 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = py27,py34,py35,py36,py37,pypy, + py27-pyramid{12,13,14,15,16,17,18,19}, docs, {py2,py3}-cover,coverage @@ -19,6 +20,16 @@ basepython = py2: python2.7 py3: python3.5 +deps = + pyramid12: pyramid <= 1.2.99 + pyramid13: pyramid <= 1.3.99 + pyramid14: pyramid <= 1.4.99 + pyramid15: pyramid <= 1.5.99 + pyramid16: pyramid <= 1.6.99 + pyramid17: pyramid <= 1.7.99 + pyramid18: pyramid <= 1.8.99 + pyramid19: pyramid <= 1.9.99 + commands = pip install -q pyramid_mailer[testing] nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:} From 8b432260d629604a5db7160d12b66d1a508a1a47 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 6 Nov 2018 08:15:50 +0900 Subject: [PATCH 20/21] - Revert heading level underlines in CHANGES.rst - Add symlink docs/changes.rst -> ../CHANGES.rst --- CHANGES.rst | 36 ++++++++++++++++++------------------ docs/changes.rst | 1 + docs/index.rst | 8 +++++++- 3 files changed, 26 insertions(+), 19 deletions(-) create mode 120000 docs/changes.rst diff --git a/CHANGES.rst b/CHANGES.rst index 13347b8..3580176 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,10 +1,10 @@ Change History --------------- +============== .. _vunreleased: unreleased -^^^^^^^^^^ +---------- - Bring repo up to Pylons Project standards. See https://github.com/Pylons/pyramid_mailer/pull/89 @@ -15,7 +15,7 @@ unreleased .. _v0.15.1: 0.15.1 (2016-12-13) -^^^^^^^^^^^^^^^^^^^ +------------------- - Add the new ``.bind`` method to the ``DebugMailer`` and the ``DummyMailer``. Also ``pyramid_mailer.testing`` and @@ -26,7 +26,7 @@ unreleased .. _v0.15: 0.15 (2016-12-06) -^^^^^^^^^^^^^^^^^ +----------------- - Support '7bit' and '8bit' transfer-encoding. https://github.com/Pylons/pyramid_mailer/pull/49 @@ -60,7 +60,7 @@ unreleased .. _v0.14.1: 0.14.1 (2015-05-21) -^^^^^^^^^^^^^^^^^^^ +------------------- - Enable compatibility testing with Pyramid all the way back to 1.2. It may work earlier but we aren't testing it any longer. @@ -74,7 +74,7 @@ unreleased .. _v0.14: 0.14 (2014-12-10) -^^^^^^^^^^^^^^^^^ +----------------- - Added support for Python3.4, PyPy3. @@ -96,7 +96,7 @@ unreleased .. _v0.13: 0.13 (2013-07-13) -^^^^^^^^^^^^^^^^^ +----------------- - Default transfer encoding for mail messages is now 'quoted-printable'. @@ -106,7 +106,7 @@ unreleased .. _v0.12: 0.12 (2013-06-26) -^^^^^^^^^^^^^^^^^ +----------------- - Added support for sendmail binary via repoze.sendmail >= 4.0b2. https://github.com/Pylons/pyramid_mailer/pull/35 @@ -128,7 +128,7 @@ unreleased .. _v0.11: 0.11 (2013-03-28) -^^^^^^^^^^^^^^^^^ +----------------- - Allow setting Content-Transfer-Encoding for body and html via Attachments. @@ -148,7 +148,7 @@ unreleased .. _v0.10: 0.10 (2012-11-22) -^^^^^^^^^^^^^^^^^ +----------------- - Set default transfer encoding for attachments to ``base64`` and allow an optional ``transfer_encoding`` argument for attachments. This currently @@ -165,7 +165,7 @@ unreleased .. _v0.9: 0.9 (2012-05-03) -^^^^^^^^^^^^^^^^ +---------------- - Add a test for uncode encoding in multipart messages. @@ -176,7 +176,7 @@ unreleased .. _v0.8: 0.8 (2012-03-26) -^^^^^^^^^^^^^^^^ +---------------- - Work around a Python 3.2.0 bug in handling emails with empty headers. This allows cc-only and bcc-only emails to be handled properly on all platforms @@ -187,7 +187,7 @@ unreleased .. _v0.7: 0.7 (2012-03-26) -^^^^^^^^^^^^^^^^ +---------------- - Packaging release @@ -195,7 +195,7 @@ unreleased .. _v0.7dev: 0.7dev (2012-03-20) -^^^^^^^^^^^^^^^^^^^ +------------------- - Python 2.5, 2.6, 2.7, 3.2, and pypy compatibility. @@ -211,7 +211,7 @@ unreleased .. _v0.6: 0.6 (2012-01-22) -^^^^^^^^^^^^^^^^ +---------------- - Use ',' as an email header field separator rather than ';' when multiple values are in the same header (as per RFC822). @@ -226,7 +226,7 @@ unreleased .. _v0.5.1: 0.5.1 (2011-11-13) -^^^^^^^^^^^^^^^^^^ +------------------ - Fixed a bug where the mailer was only sending email to addresses in the "TO" field. @@ -235,7 +235,7 @@ unreleased .. _v0.5: 0.5 (2011-10-24) -^^^^^^^^^^^^^^^^ +---------------- - Drop Lamson dependency by copying Lamson's MailResponse and dependent code into ``pyramid_mailer.response``. @@ -244,7 +244,7 @@ unreleased .. _v0.4.x: 0.4.X -^^^^^ +----- - ``pyramid_mailer.includeme`` function added for ``config.include('pyramid_mailer')`` support diff --git a/docs/changes.rst b/docs/changes.rst new file mode 120000 index 0000000..9d60ba9 --- /dev/null +++ b/docs/changes.rst @@ -0,0 +1 @@ +../CHANGES.rst \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index c4731d8..5c04332 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -527,7 +527,13 @@ API :members: -.. include:: ../CHANGES.rst +Change History +-------------- + +.. toctree:: + :maxdepth: 2 + + changes .. _Github: https://github.com/Pylons/pyramid_mailer From 4a8cc64fba70bbc4a16e0d408131121b939fbe45 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 7 Nov 2018 20:37:25 +0900 Subject: [PATCH 21/21] Remove RELEASING.txt. It's better to put this generic repo stuff in either a separate repo and point to it or put it up on pylonsproject.org, given the number of repos under Pylons. --- RELEASING.txt | 106 -------------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 RELEASING.txt diff --git a/RELEASING.txt b/RELEASING.txt deleted file mode 100644 index 078e608..0000000 --- a/RELEASING.txt +++ /dev/null @@ -1,106 +0,0 @@ -Releasing -========= - -- For clarity, we define releases as follows. - - - Alpha, beta, dev and similar statuses do not qualify whether a release is - major or minor. The term "pre-release" means alpha, beta, or dev. - - - A release is final when it is no longer pre-release. - - - A *major* release is where the first number either before or after the - first dot increases. Examples: 1.0 to 1.1a1, or 0.9 to 1.0. - - - A *minor* or *bug fix* release is where the number after the second dot - increases. Example: 1.0 to 1.0.1. - -Prepare new release -------------------- - -- Do platform test via tox: - - $ tox -r - - Make sure statement coverage is at 100% (the test run will fail if not). - -- Run tests on Windows if feasible. - -- Ensure all features of the release are documented (audit CHANGES.rst or - communicate with contributors). - -- Change CHANGES.rst heading to reflect the new version number. - -- Minor releases should include a link under "Bug Fix Releases" to the minor - feature changes in CHANGES.rst. - -- Change setup.py version to the release version number. - -- Make sure PyPI long description renders (requires ``readme_renderer`` - installed into your Python):: - - $ python setup.py check -r -s -m - -- Create a release tag. - -- Make sure your Python has ``setuptools-git``, ``twine``, and ``wheel`` - installed and release to PyPI:: - - $ python setup.py sdist bdist_wheel - $ twine upload dist/pyramid_mailer-X.X-* - - -Prepare master for further development (major releases only) ------------------------------------------------------------- - -- In CHANGES.rst, preserve headings but clear out content. Add heading - "unreleased" for the version number. - -- Change setup.py version to the next version number. - - -Marketing and communications ----------------------------- - -- Announce to Twitter. - -``` -pyramid_mailer 1.x released. - -PyPI -https://pypi.org/project/pyramid_mailer/1.x/ - -Changes -https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#change-history - -Documentation: -https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ - -Issues -https://github.com/Pylons/pyramid_mailer/issues -``` - -- Announce to maillist. - -``` -pyramid_mailer 1.X has been released. - -The full changelog is here: -https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#change-history - -What's New In pyramid_mailer 1.X: -https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/#VERSION-ANCHOR - -Documentation: -https://docs.pylonsproject.org/projects/pyramid_mailer/en/latest/ - -You can install it via PyPI: - - pip install pyramid_mailer==1.X - -Enjoy, and please report any issues you find to the issue tracker at -https://github.com/Pylons/pyramid_mailer/issues - -Thanks! - -- pyramid_mailer core developers -```