diff options
| -rw-r--r-- | setup.py | 4 | ||||
| -rw-r--r-- | src/mailman/docs/DEVELOP.rst | 5 | ||||
| -rw-r--r-- | src/mailman/docs/INTRODUCTION.rst | 4 | ||||
| -rw-r--r-- | src/mailman/docs/START.rst | 29 | ||||
| -rw-r--r-- | src/mailman/docs/STYLEGUIDE.rst | 28 | ||||
| -rw-r--r-- | template.py | 3 | ||||
| -rw-r--r-- | tox.ini | 11 |
7 files changed, 35 insertions, 49 deletions
@@ -24,8 +24,8 @@ import sys from setuptools import setup, find_packages from string import Template -if sys.hexversion < 0x20700f0: - print('Mailman requires at least Python 2.7') +if sys.hexversion < 0x30400f0: + print('Mailman requires at least Python 3.4') sys.exit(1) diff --git a/src/mailman/docs/DEVELOP.rst b/src/mailman/docs/DEVELOP.rst index c9e1bd596..f1225658e 100644 --- a/src/mailman/docs/DEVELOP.rst +++ b/src/mailman/docs/DEVELOP.rst @@ -3,7 +3,9 @@ Developing Mailman ================== The following documentation is generated from the internal developer -documentation. This documentation is also used by the test suite. +documentation. This documentation is also used by the test suite. Another +good source of architectural information is available in the chapter written +by Barry Warsaw for the `Architecture of Open Source Applications`_. For now, this will have to suffice as an overview of the Mailman system. @@ -154,3 +156,4 @@ extensive set of command line commands, and email commands. .. _`Python pickles`: http://docs.python.org/2/library/pickle.html +.. _`Architecture of Open Source Applications`: http://www.aosabook.org/en/mailman.html diff --git a/src/mailman/docs/INTRODUCTION.rst b/src/mailman/docs/INTRODUCTION.rst index ac77d0e72..b4f016c46 100644 --- a/src/mailman/docs/INTRODUCTION.rst +++ b/src/mailman/docs/INTRODUCTION.rst @@ -82,7 +82,7 @@ lists and archives, etc., are available at: Requirements ============ -Mailman 3.0 requires `Python 2.7`_. +Mailman 3 requires `Python 3.4`_ or newer. .. _`GNU Mailman`: http://www.list.org @@ -90,4 +90,4 @@ Mailman 3.0 requires `Python 2.7`_. .. _`Getting Started`: START.html .. _Python: http://www.python.org .. _FAQ: http://wiki.list.org/display/DOC/Frequently+Asked+Questions -.. _`Python 2.7`: http://www.python.org/download/releases/2.7.3/ +.. _`Python 3.4`: https://www.python.org/downloads/release/python-342/ diff --git a/src/mailman/docs/START.rst b/src/mailman/docs/START.rst index 794740c64..454f6a387 100644 --- a/src/mailman/docs/START.rst +++ b/src/mailman/docs/START.rst @@ -39,12 +39,11 @@ list, or ask on IRC channel ``#mailman`` on Freenode. Requirements ============ -Python 2.7 is required. It can either be the default 'python' on your -``$PATH`` or it can be accessible via the ``python2.7`` binary. If -your operating system does not include Python, see http://www.python.org -for information about downloading installers (where available) and -installing it from source (when necessary or preferred). Python 3 is -not yet supported. +Python 3.4 or newer is required. It can either be the default 'python3' on +your ``$PATH`` or it can be accessible via the ``python3.4`` binary. If your +operating system does not include Python, see http://www.python.org for +information about downloading installers (where available) and installing it +from source (when necessary or preferred). Python 2 is not supported. You may need some additional dependencies, which are either available from your OS vendor, or can be downloaded automatically from the `Python @@ -80,9 +79,9 @@ downloads everything from the Cheeseshop. You do have access to the virtualenv, and you can use this to run individual tests, e.g.:: - $ .tox/py27/bin/python -m nose2 -vv -P user + $ .tox/py34/bin/python -m nose2 -vv -P user -Use `.tox/py27/bin/python -m nose2 --help` for more options. +Use `.tox/py34/bin/python -m nose2 --help` for more options. If you want to run the full test suite against the PostgreSQL database, set the database up as described in :doc:`DATABASE`, then create a `postgres.cfg` @@ -112,23 +111,23 @@ installed. First, create a virtual environment. By default ``virtualenv`` uses the ``python`` executable it finds first on your ``$PATH``. Make sure this is -Python 2.7 (just start the interactive interpreter and check the version in +Python 3.4 (just start the interactive interpreter and check the version in the startup banner). The directory you install the virtualenv into is up to -you, but for purposes of this document, we'll install it into ``/tmp/py27``:: +you, but for purposes of this document, we'll install it into ``/tmp/mm3``:: - % virtualenv --system-site-packages /tmp/py27 + % virtualenv -p python3 --system-site-packages /tmp/mm3 -If your default Python is not version 2.7, use the ``--python`` option to +If your default Python is not version 3.4, use the ``--python`` option to specify the Python executable. You can use the command name if this version is on your ``PATH``:: - % virtualenv --system-site-packages --python=python2.7 /tmp/py27 + % virtualenv --system-site-packages --python=python3.4 /tmp/mm3 -or you may specify the full path to any Python 2.7 executable. +or you may specify the full path to any Python 3.4 executable. Now, activate the virtual environment and set it up for development:: - % source /tmp/py27/bin/activate + % source /tmp/mm3/bin/activate % python setup.py develop Sit back and have some Kombucha while you wait for everything to download and diff --git a/src/mailman/docs/STYLEGUIDE.rst b/src/mailman/docs/STYLEGUIDE.rst index 13fb0cdf1..1d63d2b46 100644 --- a/src/mailman/docs/STYLEGUIDE.rst +++ b/src/mailman/docs/STYLEGUIDE.rst @@ -15,33 +15,25 @@ http://barry.warsaw.us/software/STYLEGUIDE.txt This document contains a style guide for Python programming, as used in GNU Mailman. `PEP 8`_ is the basis for this style guide so it's recommendations should be followed except for the differences outlined here. This document -assumes the use of Python 2.7, but not (yet) Python 3. +assumes the use of Python 3. -* After file comments (e.g. license block), add a ``__metaclass__`` definition - so that all classes will be new-style. Following that, add an ``__all__`` - section that names, one-per-line, all the public names exported by this - module. You should enable absolute imports and unicode literals. See the +* After file comments (e.g. license block), add an ``__all__`` section that + names, one-per-line, all the public names exported by this module. See the `GNU Mailman Python template`_ as an example. * Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants, but after - any ``__future__`` imports, or ``__metaclass__`` and ``__all__`` - definitions. + any ``__all__`` definitions. Imports should be grouped, with the order being: - 1. non-from imports for standard and third party libraries - 2. non-from imports from the application - 3. from-imports from the standard and third party libraries - 4. from-imports from the application + 1. non-from imports, grouped from shorted module name to longest module + name, with ties being broken by alphabetical order. + 3. from-imports grouped alphabetically. - From-imports should follow non-from imports. Dotted imports should follow - non-dotted imports. Non-dotted imports should be grouped by increasing - length, while dotted imports should be grouped alphabetically. - -* In general, there should be one class per module. Keep files small, but - it's okay to group related code together. List everything exported from the - module in the ``__all__``. +* In general, there should be one class per module. This is not a + hard-and-fast rule. Keep files small, but it's okay to group related code + together. List everything exported from the module in the ``__all__``. * Right hanging comments are discouraged, in favor of preceding comments. E.g. bad:: diff --git a/template.py b/template.py index 5504d10fd..6304823c0 100644 --- a/template.py +++ b/template.py @@ -17,8 +17,5 @@ """Module stuff.""" -from __future__ import absolute_import, print_function, unicode_literals - -__metaclass__ = type __all__ = [ ] @@ -1,13 +1,8 @@ [tox] -envlist = py27,py34 +envlist = py34 recreate = True [testenv] -commands = python -3 -m nose2 -v -#sitepackages = True -usedevelop = True - -[testenv:py34] commands = python -m nose2 -v #sitepackages = True usedevelop = True @@ -15,7 +10,7 @@ usedevelop = True # This environment requires you to set up PostgreSQL and create a .cfg file # somewhere outside of the source tree. [testenv:pg] -basepython = python2.7 +basepython = python3.4 commands = python -m nose2 -v usedevelop = True deps = psycopg2 @@ -25,7 +20,7 @@ rcfile = {toxinidir}/coverage.ini rc = --rcfile={[coverage]rcfile} [testenv:coverage] -basepython = python2.7 +basepython = python3.4 commands = coverage run {[coverage]rc} -m nose2 -v coverage combine {[coverage]rc} |
