mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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
This commit is contained in:
parent
427a5ca3c3
commit
7057d3742b
6 changed files with 22 additions and 61 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
- "3.2"
|
- "3.3"
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -qq --no-install-recommends asciidoc
|
- sudo apt-get install -qq --no-install-recommends asciidoc
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Contribution submission guidelines
|
||||||
* Adhere to PEP8 coding standards whenever possible.
|
* Adhere to PEP8 coding standards whenever possible.
|
||||||
* Check for unnecessary whitespace via ``git diff --check`` before committing.
|
* Check for unnecessary whitespace via ``git diff --check`` before committing.
|
||||||
* **Add docs and tests for your changes**.
|
* **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.
|
accidentally broken.
|
||||||
* First line of your commit message should start with present-tense verb, be 50
|
* 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.
|
characters or less, and include the relevant issue number(s) if applicable.
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@ To install Pelican and its dependencies::
|
||||||
|
|
||||||
$ python setup.py develop
|
$ python setup.py develop
|
||||||
|
|
||||||
|
Or using ``pip``::
|
||||||
|
|
||||||
|
$ pip install -e .
|
||||||
|
|
||||||
Coding standards
|
Coding standards
|
||||||
================
|
================
|
||||||
|
|
||||||
|
|
@ -88,28 +92,22 @@ functional tests. To do so, you can use the following two commands::
|
||||||
samples/content/
|
samples/content/
|
||||||
$ pelican -o pelican/tests/output/basic/ 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
|
Testing on Python 3 currently requires some extra steps: installing
|
||||||
Python 3.x-compatible versions of dependent packages and plugins.
|
Python 3-compatible versions of dependent packages and plugins.
|
||||||
|
|
||||||
However, you must tell ``tox`` to use those Python 3.x-compatible libraries.
|
Tox_ is a useful tool to run tests on both versions. It will install the
|
||||||
If you forget this, ``tox`` will pull the regular packages from PyPI, and the
|
Python 3-compatible version of dependent packages.
|
||||||
tests will fail.
|
|
||||||
|
|
||||||
Tell ``tox`` about the local packages thusly: enter the source directory of
|
.. _Tox: http://testrun.org/tox/latest/
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
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):
|
- 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 it where I felt necessary.
|
||||||
|
|
||||||
- Changed xrange() back to range(), so it is valid in both Python versions.
|
- Changed xrange() back to range(), so it is valid in both Python versions.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@ Getting started
|
||||||
Installing Pelican
|
Installing Pelican
|
||||||
==================
|
==================
|
||||||
|
|
||||||
Pelican currently runs best on Python 2.7.x; earlier versions of Python are not
|
Pelican currently runs best on Python 2.7.x; earlier versions of Python are
|
||||||
supported. There is provisional support for Python 3.2 and higher, although
|
not supported. There is provisional support for Python 3.3, although there may
|
||||||
there may be rough edges, particularly with regards to optional 3rd-party
|
be rough edges, particularly with regards to optional 3rd-party components.
|
||||||
components.
|
|
||||||
|
|
||||||
You can install Pelican via several different methods. The simplest is via
|
You can install Pelican via several different methods. The simplest is via
|
||||||
`pip <http://www.pip-installer.org/>`_::
|
`pip <http://www.pip-installer.org/>`_::
|
||||||
|
|
|
||||||
7
setup.py
7
setup.py
|
|
@ -4,11 +4,6 @@ from setuptools import setup
|
||||||
requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.6', 'pygments', 'docutils',
|
requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.6', 'pygments', 'docutils',
|
||||||
'pytz', 'blinker', 'unidecode', 'six']
|
'pytz', 'blinker', 'unidecode', 'six']
|
||||||
|
|
||||||
try:
|
|
||||||
import argparse # NOQA
|
|
||||||
except ImportError:
|
|
||||||
requires.append('argparse')
|
|
||||||
|
|
||||||
entry_points = {
|
entry_points = {
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'pelican = pelican:main',
|
'pelican = pelican:main',
|
||||||
|
|
@ -41,9 +36,9 @@ setup(
|
||||||
'Environment :: Console',
|
'Environment :: Console',
|
||||||
'License :: OSI Approved :: GNU Affero General Public License v3',
|
'License :: OSI Approved :: GNU Affero General Public License v3',
|
||||||
'Operating System :: OS Independent',
|
'Operating System :: OS Independent',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',
|
||||||
'Programming Language :: Python :: 3',
|
'Programming Language :: Python :: 3',
|
||||||
'Programming Language :: Python :: 3.2',
|
|
||||||
'Programming Language :: Python :: 3.3',
|
'Programming Language :: Python :: 3.3',
|
||||||
'Topic :: Internet :: WWW/HTTP',
|
'Topic :: Internet :: WWW/HTTP',
|
||||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
||||||
|
|
|
||||||
34
tox.ini
34
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.
|
# 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]
|
[tox]
|
||||||
envlist = py27,py32,py33
|
envlist = py27,py33
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
commands =
|
commands =
|
||||||
|
|
@ -37,15 +16,6 @@ deps =
|
||||||
BeautifulSoup4
|
BeautifulSoup4
|
||||||
typogrify
|
typogrify
|
||||||
|
|
||||||
[testenv:py32]
|
|
||||||
deps =
|
|
||||||
mock
|
|
||||||
Markdown
|
|
||||||
BeautifulSoup4
|
|
||||||
feedgenerator
|
|
||||||
# {distshare}/smartypants-1.6.0.3.zip
|
|
||||||
# {distshare}/typogrify-2.0.0.zip
|
|
||||||
|
|
||||||
[testenv:py33]
|
[testenv:py33]
|
||||||
deps =
|
deps =
|
||||||
mock
|
mock
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue