Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
axelpale committed Mar 21, 2016
2 parents e327604 + b6d0545 commit d07ee0b
Show file tree
Hide file tree
Showing 28 changed files with 840 additions and 381 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_static/
# Files generated by sphinx-apidoc
docs/modules.*
docs/gazelib.*

# PyBuilder
Expand Down
6 changes: 3 additions & 3 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2.7.10
3.3.6
3.4.3
3.5.0
3.4.3
3.3.6
2.7.10
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ python:
install:
- pip install tox-travis python-coveralls

######
# If numpy is installing too slowly, see:
# - https://gist.github.com/dan-blanchard/7045057
# - http://conda.pydata.org/docs/travis.html

# command to run tests
script:
- tox
Expand Down
140 changes: 14 additions & 126 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
gazelib
========

The Python package *gazelib* provides software tools to manage and analyze gaze data from eye-trackers.
This **Python** package provides software tools to manage and analyze **gaze data from eye-trackers**.

*Gazelib* is developed at `Infant Cognition Laboratory
Gazelib is developed at `Infant Cognition Laboratory
<http://www.uta.fi/med/icl/index.html>`_ at University of Tampere.


.. image:: https://travis-ci.org/infant-cognition-tampere/gazelib.svg
:target: https://travis-ci.org/infant-cognition-tampere/gazelib
:alt: Travis CI build status
.. image:: https://coveralls.io/repos/infant-cognition-tampere/gazelib/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/infant-cognition-tampere/gazelib?branch=master
:alt: Coveralls.io test coverage
.. image:: https://readthedocs.org/projects/gazelib/badge/
:target: http://gazelib.readthedocs.org/en/latest/
:alt: Documentation Status
:alt: ReadTheDocs documentation status
.. image:: https://badge.fury.io/py/gazelib.svg
:target: https://pypi.python.org/pypi/gazelib
:alt: PyPI package version


Install
==========
Expand All @@ -25,138 +30,21 @@ With `pip
$ pip install gazelib



Docs
======

Examples and API docs are available at `http://gazelib.readthedocs.org/
<http://gazelib.readthedocs.org/>`_.

For developers
=================

Tips for the developers of the package.


Use Git
------------

To develop, clone the repository from GitHub::

$ git clone https://github.com/infant-cognition-tampere/gazelib

Make changes to files, add them to commit, and do commit::

(edit README.rst)
$ git add README.rst
$ git commit -m "Improved documentation"

List files that are not added or not committed::

$ git status

Push local commits to GitHub::

$ git push

Ignore some files by editing ``.gitignore``::

$ nano .gitignore


Virtualenv
---------------

Manage python versions and requirements by using virtualenv::

$ cd gazelib
$ virtualenv -p python3.5 venv
$ source venv/bin/activate
...
$ deactivate


Testing
------------

Follow `instructions to install pyenv
<http://sqa.stackexchange.com/a/15257/14918>`_ and then either run quick tests::

$ python3.5 setup.py test

or run comprehensive tests for multiple Python versions listed in ``tox.ini``::

$ pyenv local 2.7.10 3.1.5 3.2.6 3.3.6 3.4.3 3.5.0
$ eval "$(pyenv init -)"
$ pyenv rehash
$ tox

Install new pyenv environments for example by::

$ pyenv install 3.5.0

Validate README.rst at `http://rst.ninjs.org/
<http://rst.ninjs.org/>`_

Tox + Travis CI + `Coveralls
<https://coveralls.io/github/infant-cognition-tampere/gazelib>`_:

- https://www.rfk.id.au/blog/entry/testing-better-coverage-tox/
- http://coverage.readthedocs.org/en/latest/
- https://github.com/z4r/python-coveralls
- https://github.com/ryanhiebert/tox-travis
- http://jsatt.com/blog/using-tox-with-travis-ci-to-test-django-apps/
- http://agiliq.com/blog/2014/05/continuous-integration-with-travis-and-coverallsio/
- https://github.com/openwebinars-django/testango



Publishing to PyPI
-----------------------

Follow `python packaging instructions
<https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/>`_:

1. Create an unpacked sdist: ``$ python setup.py sdist``
2. Create a universal wheel: ``$ python setup.py bdist_wheel --universal``
3. Go to `PyPI and register the project by filling the package form
<https://pypi.python.org/pypi?%3Aaction=submit_form>`_ by uploading
``gazelib.egg-info/PKG_INFO`` file.
4. Upload the package with twine:

1. Sign the dist: ``$ gpg --detach-sign -a dist/gazelib-1.2.3.tar.gz`` and ``$ gpg --detach-sign -a dist/gazelib-1.2.3-py2.py3-none-any.whl``
2. Upload: ``twine upload dist/gazelib-1.2.3*`` (will ask your PyPI password)

5. Package published!

Updating the package takes same steps except the 3rd.


Version release
-------------------

1. Change version string in ``gazelib/version.py`` and ``setup.py`` to
``'1.2.3'``
2. Run tox tests. See *4.3. Testing*.
3. Git commit: ``$ git commit --all -m "v1.2.3 release"``
4. Create tag: ``$ git tag -a 1.2.3 -m "v1.2.3 stable"``
5. Push commits and tags: ``$ git push && git push --tags``
6. Publish to PyPI. See *4.4. Publishing to PyPI*.

See also `a successful Git branching model
<http://nvie.com/posts/a-successful-git-branching-model/>`_.


Compile documentation
---------------------

Run ``$ make -C docs html``

This will execute ``$ sphinx-apidoc -o docs gazelib`` automatically.
For developers
=================

ReadTheDocs.org builds the documentation automatically after push to GitHub.
Tips, conventions, and specifications for the developers are available at `wiki
<https://github.com/infant-cognition-tampere/gazelib/wiki>`_.

Manage ReadTheDocs build at `readthedocs.org/projects/gazelib
<https://readthedocs.org/projects/gazelib/>`_.


Versioning
Expand Down
28 changes: 18 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

# Include variables from setup.py
import gazelib
pkg_name = gazelib.package.name
pkg_version = gazelib.package.version
pkg_author = gazelib.package.author
pkg_description = gazelib.package.description


# From ReadTheDocs.org:
# http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
# If you experience import errors on libraries that depend on C modules:
Expand Down Expand Up @@ -101,18 +109,18 @@ def setup(app):
master_doc = 'index'

# General information about the project.
project = 'gazelib'
copyright = '2016, Akseli Palen'
author = 'Akseli Palen'
project = pkg_name
copyright = '2016, ' + pkg_author
author = pkg_author

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1.1'
version = pkg_version
# The full version, including alpha/beta/rc tags.
release = '0.1.1'
release = pkg_version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -277,8 +285,8 @@ def setup(app):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'gazelib.tex', 'gazelib Documentation',
'Akseli Palen', 'manual'),
(master_doc, 'gazelib.tex', 'Gazelib Documentation',
pkg_author, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -307,7 +315,7 @@ def setup(app):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gazelib', 'gazelib Documentation',
(master_doc, pkg_name, 'Gazelib Documentation',
[author], 1)
]

Expand All @@ -321,8 +329,8 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'gazelib', 'gazelib Documentation',
author, 'gazelib', 'One line description of project.',
(master_doc, pkg_name, 'Gazelib Documentation',
author, pkg_name, pkg_description,
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Lots of eyetracker data to be managed? No common schema for the data? Tired of r
Contents:

.. toctree::
:maxdepth: 3
:maxdepth: 4

gazelib
modules

See also
--------
Expand Down
7 changes: 0 additions & 7 deletions docs/modules.rst

This file was deleted.

5 changes: 1 addition & 4 deletions gazelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
'''
Gazelib, a toolkit for gaze analysis.
'''
from gazelib import containers
from gazelib import validation
from gazelib import io
from gazelib.version import version
from gazelib.package import version as __version__ # noqa
Loading

0 comments on commit d07ee0b

Please sign in to comment.