From 7057d3742bfdbed91dec87c315686024758d9ed2 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 26 May 2013 12:44:32 +0200 Subject: [PATCH] Drop python 3.2 support and move to python 3.3. Jinja 2.7 (released 2013-05-20) supports only Python3 >=3.3 so it is time to drop Python 3.2 and move to 3.3 --- .travis.yml | 2 +- CONTRIBUTING.rst | 2 +- docs/contribute.rst | 31 ++++++++++++++----------------- docs/getting_started.rst | 7 +++---- setup.py | 7 +------ tox.ini | 34 ++-------------------------------- 6 files changed, 22 insertions(+), 61 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa0c2f0a..1ff512b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: - "2.7" - - "3.2" + - "3.3" before_install: - sudo apt-get update -qq - sudo apt-get install -qq --no-install-recommends asciidoc diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 41c38cc7..b28b22a3 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -13,7 +13,7 @@ Contribution submission guidelines * Adhere to PEP8 coding standards whenever possible. * Check for unnecessary whitespace via ``git diff --check`` before committing. * **Add docs and tests for your changes**. -* `Run all the tests`_ **on both Python 2.7+ and 3.2+** to ensure nothing was +* `Run all the tests`_ **on both Python 2.7 and 3.3** to ensure nothing was accidentally broken. * First line of your commit message should start with present-tense verb, be 50 characters or less, and include the relevant issue number(s) if applicable. diff --git a/docs/contribute.rst b/docs/contribute.rst index ffdda986..80d07644 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -43,6 +43,10 @@ To install Pelican and its dependencies:: $ python setup.py develop +Or using ``pip``:: + + $ pip install -e . + Coding standards ================ @@ -88,28 +92,22 @@ functional tests. To do so, you can use the following two commands:: samples/content/ $ pelican -o pelican/tests/output/basic/ samples/content/ -Testing on Python 3.x ---------------------- +Testing on Python 2 and 3 +------------------------- -Testing on Python 3.x currently requires some extra steps: installing -Python 3.x-compatible versions of dependent packages and plugins. +Testing on Python 3 currently requires some extra steps: installing +Python 3-compatible versions of dependent packages and plugins. -However, you must tell ``tox`` to use those Python 3.x-compatible libraries. -If you forget this, ``tox`` will pull the regular packages from PyPI, and the -tests will fail. +Tox_ is a useful tool to run tests on both versions. It will install the +Python 3-compatible version of dependent packages. -Tell ``tox`` about the local packages thusly: enter the source directory of -smartypants and run ``tox`` there. Do this again for the ``typogrify`` and -``webassets`` packages. SmartyPants and Typogrify do not have real tests, and -``webassets`` will fail noisily, but as a result we get these libraries neatly -packaged in tox's ``distshare`` directory, which we need in order to run -``tox`` for Pelican. +.. _Tox: http://testrun.org/tox/latest/ -Python 3.x development tips -=========================== +Python 3 development tips +========================= Here are some tips that may be useful when doing some code for both Python 2.7 -and Python 3.x at the same time: +and Python 3 at the same time: - Assume every string and literal is unicode (import unicode_literals): @@ -144,4 +142,3 @@ and Python 3.x at the same time: changed it where I felt necessary. - Changed xrange() back to range(), so it is valid in both Python versions. - diff --git a/docs/getting_started.rst b/docs/getting_started.rst index c93e0844..ddffb5ff 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -4,10 +4,9 @@ Getting started Installing Pelican ================== -Pelican currently runs best on Python 2.7.x; earlier versions of Python are not -supported. There is provisional support for Python 3.2 and higher, although -there may be rough edges, particularly with regards to optional 3rd-party -components. +Pelican currently runs best on Python 2.7.x; earlier versions of Python are +not supported. There is provisional support for Python 3.3, although there may +be rough edges, particularly with regards to optional 3rd-party components. You can install Pelican via several different methods. The simplest is via `pip `_:: diff --git a/setup.py b/setup.py index cd05b924..83beb461 100755 --- a/setup.py +++ b/setup.py @@ -4,11 +4,6 @@ from setuptools import setup requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.6', 'pygments', 'docutils', 'pytz', 'blinker', 'unidecode', 'six'] -try: - import argparse # NOQA -except ImportError: - requires.append('argparse') - entry_points = { 'console_scripts': [ 'pelican = pelican:main', @@ -41,9 +36,9 @@ setup( 'Environment :: Console', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries :: Python Modules', diff --git a/tox.ini b/tox.ini index 65f398bc..d9d759e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,29 +1,8 @@ -# This tests the unified codebase (py26-py32) of Pelican. +# This tests the unified codebase (py27, py33) of Pelican. # depends on some external libraries that aren't released yet. -# -# To run Pelican, you will already have checked out and installed them. -# -# Now we must tell tox about this package, otherwise tox would load the old -# libraries from PyPi. -# -# Run tox from the libraries source tree. It will save its package in -# the distshare directory from where the tests here will pick it up. -# -# Do that for -# https://github.com/dmdm/smartypants.git -# -# and typogrify: -# https://github.com/dmdm/typogrify/tree/py3k -# -# CAVEAT: -# ------- -# -# Please be aware that my port of typogrify is just 2to3'd. -# It is not backwards compatible with Python 2. - [tox] -envlist = py27,py32,py33 +envlist = py27,py33 [testenv] commands = @@ -37,15 +16,6 @@ deps = BeautifulSoup4 typogrify -[testenv:py32] -deps = - mock - Markdown - BeautifulSoup4 - feedgenerator -# {distshare}/smartypants-1.6.0.3.zip -# {distshare}/typogrify-2.0.0.zip - [testenv:py33] deps = mock