diff options
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | README.md | 13 | ||||
-rwxr-xr-x | init-tests-after-clone.sh | 15 |
3 files changed, 29 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 99ecd4aa..31f2c00c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,12 +19,7 @@ install: - pip install coveralls flake8 sphinx # generate some reflog as git-python tests need it (in master) - - git tag __testing_point__ - - git checkout master || git checkout -b master - - git reset --hard HEAD~1 - - git reset --hard HEAD~1 - - git reset --hard HEAD~1 - - git reset --hard __testing_point__ + - ./init-tests-after-clone.sh # as commits are performed with the default user, it needs to be set for travis too - git config --global user.email "travis@ci.com" @@ -34,9 +34,19 @@ Both commands will install the required package dependencies. A distribution package can be obtained for manual installation at: http://pypi.python.org/pypi/GitPython + +If you like to clone from source, you can do it like so: + +```bash +git clone https://github.com/gitpython-developers/GitPython +git submodule update --init --recursive +./init-tests-after-clone.sh +``` ### RUNNING TESTS +*Important*: Right after cloning this repository, please be sure to have executed the `init-tests-after-clone.sh` script in the repository root. Otherwise you will encounter test failures. + 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 @@ -44,6 +54,9 @@ The easiest way to run test is by using [tox](https://pypi.python.org/pypi/tox) Then run: tox + + +For more fine-grained control, you can use `nose`. ### Contributions diff --git a/init-tests-after-clone.sh b/init-tests-after-clone.sh new file mode 100755 index 00000000..0d445891 --- /dev/null +++ b/init-tests-after-clone.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e + +if [[ -z "$TRAVIS" ]]; then + read -p "This operation will destroy locally modified files. Continue ? [N/y]: " answer + if [[ ! $answer =~ [yY] ]]; then + exit 2 + fi +fi + +git tag __testing_point__ +git checkout master || git checkout -b master +git reset --hard HEAD~1 +git reset --hard HEAD~1 +git reset --hard HEAD~1 +git reset --hard __testing_point__
\ No newline at end of file |