Skip to content

Commit

Permalink
Added tox.ini file and updated README. This allows a developer / cont…
Browse files Browse the repository at this point in the history
…ributor

to test all of the code on all of the configurations, in much the same fashion
as Travis-CI does.
  • Loading branch information
IanLee1521 committed Sep 22, 2014
1 parent ad7ac43 commit cd96a9f
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 6 deletions.
58 changes: 52 additions & 6 deletions README.rst
Expand Up @@ -16,6 +16,7 @@ Geometries are handled as pygeoif_ or shapely_ (if installed) objects.
.. _collective.geo.fastkml: http://pypi.python.org/pypi/collective.geo.fastkml
.. _lxml: https://pypi.python.org/pypi/lxml
.. _dateutils: https://pypi.python.org/pypi/dateutils
.. _tox: https://pypi.python.org/pypi/tox

fastkml is continually tested with *Travis CI*

Expand All @@ -32,11 +33,11 @@ Rationale
==========

Why yet another KML library? None of the existing ones quite fitted my requirements
* fastkml can *read and write* KML files, feeding fastkmls output back into fastkml
and serializing it again will result in the same output.

* fastkml can *read and write* KML files, feeding fastkmls output back into fastkml
and serializing it again will result in the same output.
* You can parse any kml snipppet, it does not need to be a complete KML document.
* It runs on python 2 and 3.
* It runs on python 2 and 3.
* It is fully tested and actively maintained.
* Geometries are handled in the `__geo_interface__` standard.
* Minimal dependencies, pure python.
Expand All @@ -46,7 +47,7 @@ Why yet another KML library? None of the existing ones quite fitted my requireme
Install
========

You can install the package with `pip install fastkml` or `easy_install fastkml`
You can install the package with `pip install fastkml` or `easy_install fastkml`
which should also pull in all requirements.

Requirements
Expand All @@ -55,7 +56,8 @@ Requirements
* pygeoif_
* dateutils_

optional:
Optional:
---------

* lxml_
* shapely_
Expand All @@ -68,6 +70,50 @@ To install packages required for running tests:

pip install -r requirements/test.txt

Testing
-------

You can make use of tox_ >= 1.8 to test the entire matrix of options ``(with /
without lxml) * (pygeoif vs shapely) * (py26,py27,py32,py33,py34)`` as well as
pep8 style checking in a single call (this approximates what happens when the
package is run through Travis-CI):

# Install tox
pip install tox>=1.8
tox

# Or optionally (to skip tests for Python versions you do not have installed)
tox --skip-missing-interpreters

This will run through all of the tests and produce an output similar to:

______________________________________________________ summary ______________________________________________________
SKIPPED: py26: InterpreterNotFound: python2.6
py27: commands succeeded
SKIPPED: py32: InterpreterNotFound: python3.2
SKIPPED: py33: InterpreterNotFound: python3.3
py34: commands succeeded
SKIPPED: py26-shapely: InterpreterNotFound: python2.6
SKIPPED: py26-lxml: InterpreterNotFound: python2.6
py27-shapely: commands succeeded
py27-lxml: commands succeeded
SKIPPED: py32-shapely: InterpreterNotFound: python3.2
SKIPPED: py32-lxml: InterpreterNotFound: python3.2
SKIPPED: py33-shapely: InterpreterNotFound: python3.3
SKIPPED: py33-lxml: InterpreterNotFound: python3.3
py34-shapely: commands succeeded
py34-lxml: commands succeeded
SKIPPED: py26-shapely-lxml: InterpreterNotFound: python2.6
py27-shapely-lxml: commands succeeded
SKIPPED: py32-shapely-lxml: InterpreterNotFound: python3.2
SKIPPED: py33-shapely-lxml: InterpreterNotFound: python3.3
py34-shapely-lxml: commands succeeded
pep8: commands succeeded
congratulations :)

You are primarily looking for the ``congratulations :)`` line at the bottom,
signifying that the code is working as expected on all configurations
available.

Limitations
===========
Expand Down
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

0.9 (unreleased)
-----------------

- Add tox.ini for running tests using tox [Ian Lee]

0.8 (2014/09/18)
-----------------

Expand Down
22 changes: 22 additions & 0 deletions tox.ini
@@ -0,0 +1,22 @@
[tox]
envlist =
{py26,py27,py32,py33,py34},
{py26,py27,py32,py33,py34}-{shapely,lxml},
{py26,py27,py32,py33,py34}-shapely-lxml,
pep8

[testenv]
deps =
pytest
coverage
py26: unittest2
shapely: Shapely
lxml: lxml
commands =
coverage run -a --source=fastkml setup.py test

[testenv:pep8]
deps =
pep8
commands =
pep8 --exclude test_main.py fastkml

0 comments on commit cd96a9f

Please sign in to comment.