diff --git a/.gitignore b/.gitignore index 1a26c03a1..f6f85969d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ cover/ /doc/_build nbproject *.sublime-workspace + +/*egg-info +/.tox diff --git a/MANIFEST.in b/MANIFEST.in index 89f5b92d0..95b2e883f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,7 @@ include LICENSE include CHANGES include AUTHORS include README +include requirements.txt graft git/test/fixtures graft git/test/performance diff --git a/README.md b/README.md index d2a858bf9..fcf74c3d6 100644 --- a/README.md +++ b/README.md @@ -13,21 +13,36 @@ The object database implementation is optimized for handling large quantities of - Tested with nose 1.3.0 * Mock by Michael Foord used for tests - Tested with 1.0.1 +* Coverage - used for tests coverage + +The list of dependencies are listed in /requirements.txt and /test-requirements.txt. The installer takes care of installing them for you though. ### INSTALL If you have downloaded the source code: python setup.py install - -or if you want to obtain a copy more easily: + +or if you want to obtain a copy from the Pypi repository: pip install gitpython - + +Both commands will install the required package dependencies. + A distribution package can be obtained for manual installation at: http://pypi.python.org/pypi/GitPython +### RUNNING TESTS + +The easiest way to run test is by using [tox](https://pypi.python.org/pypi/tox) a wrapper around virtualenv. It will take care of setting up environnements with the proper dependencies installed and execute test commands. To install it simply: + + pip install tox + +Then run: + + tox + ### DEVELOPMENT STATUS [![Build Status](https://travis-ci.org/gitpython-developers/GitPython.svg?branch=0.3)](https://travis-ci.org/gitpython-developers/GitPython) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..67f5eb742 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# Remember to update README.md +gitdb>=0.5.1 diff --git a/setup.py b/setup.py index e7c927b13..58a763e49 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,8 @@ VERSION = v.readline().strip() v.close() +with open('requirements.txt') as reqs_file: + requirements = reqs_file.read().splitlines() class build_py(_build_py): def run(self): @@ -73,7 +75,7 @@ def _stamp_version(filename): package_data = {'git.test' : ['fixtures/*']}, package_dir = {'git':'git'}, license = "BSD License", - install_requires='gitdb >= 0.5.1', + install_requires=requirements, zip_safe=False, long_description = """\ GitPython is a python library used to interact with Git repositories""", diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..116fbbd38 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,5 @@ +# Remember to update README.md +coverage +flake8 +nose +mock diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..60bfb1d97 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +envlist = py26,py27,flake8 + +[testenv] +commands = nosetests +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +[testenv:cover] +commands = nosetests --with-coverage + +[testenv:flake8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[flake8] +#show-source = True +exclude = .tox,.venv,build,dist,doc,git/ext/