Skip to content

Commit 9d6b417

Browse files
authored
Merge pull request #519 from ankostis/appveyor
Test project on Windows with MINGW/Cygwin git (conda2.7&3.4/cpy-3.5)
2 parents 4592785 + 9a52168 commit 9d6b417

40 files changed

+1493
-1132
lines changed

.appveyor.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# CI on Windows via appveyor
2+
environment:
3+
GIT_DAEMON_PATH: "C:\\Program Files\\Git\\mingw64\\libexec\\git-core"
4+
CYGWIN_GIT_PATH: "C:\\cygwin\\bin;%GIT_DAEMON_PATH%"
5+
CYGWIN64_GIT_PATH: "C:\\cygwin64\\bin;%GIT_DAEMON_PATH%"
6+
7+
matrix:
8+
## MINGW
9+
#
10+
- PYTHON: "C:\\Python27"
11+
PYTHON_VERSION: "2.7"
12+
GIT_PATH: "%GIT_DAEMON_PATH%"
13+
- PYTHON: "C:\\Python34-x64"
14+
PYTHON_VERSION: "3.4"
15+
GIT_PATH: "%GIT_DAEMON_PATH%"
16+
- PYTHON: "C:\\Python35-x64"
17+
PYTHON_VERSION: "3.5"
18+
GIT_PATH: "%GIT_DAEMON_PATH%"
19+
- PYTHON: "C:\\Miniconda35-x64"
20+
PYTHON_VERSION: "3.5"
21+
IS_CONDA: "yes"
22+
GIT_PATH: "%GIT_DAEMON_PATH%"
23+
24+
# ## Cygwin
25+
# #
26+
# - PYTHON: "C:\\Miniconda-x64"
27+
# PYTHON_VERSION: "2.7"
28+
# IS_CONDA: "yes"
29+
# GIT_PATH: "%CYGWIN_GIT_PATH%"
30+
# - PYTHON: "C:\\Python34-x64"
31+
# PYTHON_VERSION: "3.4"
32+
# GIT_PATH: "%CYGWIN_GIT_PATH%"
33+
# - PYTHON: "C:\\Python35-x64"
34+
# PYTHON_VERSION: "3.5"
35+
# GIT_PATH: "%CYGWIN64_GIT_PATH%"
36+
37+
38+
install:
39+
- set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH%
40+
41+
## Print architecture, python & git used for debugging.
42+
#
43+
- |
44+
uname -a
45+
where git git-daemon python pip pip3 pip34
46+
python --version
47+
python -c "import struct; print(struct.calcsize('P') * 8)"
48+
49+
- IF "%IS_CONDA%"=="yes" (
50+
conda info -a &
51+
conda install --yes --quiet pip
52+
)
53+
- pip install nose ddt wheel coveralls
54+
- IF "%PYTHON_VERSION%"=="2.7" (
55+
pip install mock
56+
)
57+
58+
## Copied from `init-tests-after-clone.sh`.
59+
#
60+
- |
61+
git submodule update --init --recursive
62+
git fetch --tags
63+
git tag __testing_point__
64+
git checkout master || git checkout -b master
65+
git reset --hard HEAD~1
66+
git reset --hard HEAD~1
67+
git reset --hard HEAD~1
68+
git reset --hard __testing_point__
69+
70+
## For commits performed with the default user.
71+
- |
72+
git config --global user.email "travis@ci.com"
73+
git config --global user.name "Travis Runner"
74+
75+
- pip install -e .
76+
77+
build: false
78+
79+
test_script:
80+
- nosetests --with-coverage
81+
82+
#on_success:
83+
# - IF "%PYTHON_VERSION%"=="3.4" (coveralls)

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
git/test/fixtures/* eol=lf
2+
init-tests-after-clone.sh

.travis.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ git:
1616
install:
1717
- git submodule update --init --recursive
1818
- git fetch --tags
19-
- pip install coveralls flake8 sphinx
19+
- pip install coveralls flake8 ddt sphinx
2020

2121
# generate some reflog as git-python tests need it (in master)
2222
- ./init-tests-after-clone.sh
@@ -31,8 +31,9 @@ script:
3131
# Make sure we limit open handles to see if we are leaking them
3232
- ulimit -n 96
3333
- ulimit -n
34-
- nosetests -v --with-coverage
35-
- flake8
36-
- cd doc && make html
34+
- nosetests --with-coverage
35+
- if [ "$TRAVIS_PYTHON_VERSION" == '3.4' ]; then flake8; fi
36+
- if [ "$TRAVIS_PYTHON_VERSION" == '3.5' ]; then cd doc && make html; fi
37+
-
3738
after_success:
3839
- coveralls

README.md

+32-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
## GitPython
22

3-
GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing.
3+
GitPython is a python library used to interact with git repositories, high-level like git-porcelain,
4+
or low-level like git-plumbing.
45

5-
It provides abstractions of git objects for easy access of repository data, and additionally allows you to access the git repository more directly using either a pure python implementation, or the faster, but more resource intensive git command implementation.
6+
It provides abstractions of git objects for easy access of repository data, and additionally
7+
allows you to access the git repository more directly using either a pure python implementation,
8+
or the faster, but more resource intensive *git command* implementation.
69

7-
The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming.
10+
The object database implementation is optimized for handling large quantities of objects and large datasets,
11+
which is achieved by using low-level structures and data streaming.
812

913

1014
### REQUIREMENTS
1115

12-
GitPython needs the `git` executable to be installed on the system and available in your `PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
16+
GitPython needs the `git` executable to be installed on the system and available
17+
in your `PATH` for most operations.
18+
If it is not in your `PATH`, you can help GitPython find it by setting
19+
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
1320

1421
* Git (1.7.x or newer)
1522
* Python 2.7 to 3.5, while python 2.6 is supported on a *best-effort basis*.
1623

17-
The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`. The installer takes care of installing them for you.
24+
The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
25+
The installer takes care of installing them for you.
1826

1927
### INSTALL
2028

@@ -31,7 +39,7 @@ Both commands will install the required package dependencies.
3139
A distribution package can be obtained for manual installation at:
3240

3341
http://pypi.python.org/pypi/GitPython
34-
42+
3543
If you like to clone from source, you can do it like so:
3644

3745
```bash
@@ -45,7 +53,7 @@ git submodule update --init --recursive
4553
#### Leakage of System Resources
4654

4755
GitPython is not suited for long-running processes (like daemons) as it tends to
48-
leak system resources. It was written in a time where destructors (as implemented
56+
leak system resources. It was written in a time where destructors (as implemented
4957
in the `__del__` method) still ran deterministically.
5058

5159
In case you still want to use it in such a context, you will want to search the
@@ -61,17 +69,25 @@ as they are kept alive solely by their users, or not.
6169

6270
### RUNNING TESTS
6371

64-
*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.
72+
*Important*: Right after cloning this repository, please be sure to have executed
73+
the `./init-tests-after-clone.sh` script in the repository root. Otherwise
74+
you will encounter test failures.
75+
76+
On *Windows*, make sure you have `git-daemon` in your PATH. For MINGW-git, the `git-daemon.exe`
77+
exists in `Git\mingw64\libexec\git-core\`; CYGWIN has no daemon, but should get along fine
78+
with MINGW's.
6579

66-
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:
80+
The easiest way to run tests is by using [tox](https://pypi.python.org/pypi/tox)
81+
a wrapper around virtualenv. It will take care of setting up environnements with the proper
82+
dependencies installed and execute test commands. To install it simply:
6783

6884
pip install tox
6985

7086
Then run:
7187

7288
tox
73-
74-
89+
90+
7591
For more fine-grained control, you can use `nose`.
7692

7793
### Contributions
@@ -84,7 +100,8 @@ Please have a look at the [contributions file][contributing].
84100
* [Questions and Answers](http://stackexchange.com/filters/167317/gitpython)
85101
* Please post on stackoverflow and use the `gitpython` tag
86102
* [Issue Tracker](https://github.com/gitpython-developers/GitPython/issues)
87-
* Post reproducible bugs and feature requests as a new issue. Please be sure to provide the following information if posting bugs:
103+
* Post reproducible bugs and feature requests as a new issue.
104+
Please be sure to provide the following information if posting bugs:
88105
* GitPython version (e.g. `import git; git.__version__`)
89106
* Python version (e.g. `python --version`)
90107
* The encountered stack-trace, if applicable
@@ -100,7 +117,7 @@ Please have a look at the [contributions file][contributing].
100117
* Finally, set the upcoming version in the `VERSION` file, usually be
101118
incrementing the patch level, and possibly by appending `-dev`. Probably you
102119
want to `git push` once more.
103-
120+
104121
### LICENSE
105122

106123
New BSD License. See the LICENSE file.
@@ -113,7 +130,8 @@ New BSD License. See the LICENSE file.
113130
[![Stories in Ready](https://badge.waffle.io/gitpython-developers/GitPython.png?label=ready&title=Ready)](https://waffle.io/gitpython-developers/GitPython)
114131
[![Throughput Graph](https://graphs.waffle.io/gitpython-developers/GitPython/throughput.svg)](https://waffle.io/gitpython-developers/GitPython/metrics/throughput)
115132

116-
Now that there seems to be a massive user base, this should be motivation enough to let git-python return to a proper state, which means
133+
Now that there seems to be a massive user base, this should be motivation enough to let git-python
134+
return to a proper state, which means
117135

118136
* no open pull requests
119137
* no open issues describing bugs

doc/source/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
# built documents.
5151
#
5252
# The short X.Y version.
53-
VERSION = open(os.path.join(os.path.dirname(__file__),"..", "..", 'VERSION')).readline().strip()
53+
with open(os.path.join(os.path.dirname(__file__),"..", "..", 'VERSION')) as fd:
54+
VERSION = fd.readline().strip()
5455
version = VERSION
5556
# The full version, including alpha/beta/rc tags.
5657
release = VERSION

0 commit comments

Comments
 (0)