Skip to content

Enable Appveyor CI for Windows #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# CI on Windows via appveyor
environment:

matrix:
## MINGW
#
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7"
- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4"
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5"
- PYTHON: "C:\\Miniconda35-x64"
PYTHON_VERSION: "3.5"
IS_CONDA: "yes"

install:
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

## Print configuration for debugging.
#
- |
echo %PATH%
uname -a
where python pip pip2 pip3 pip34
python --version
python -c "import struct; print(struct.calcsize('P') * 8)"

- IF "%IS_CONDA%"=="yes" (
conda info -a &
conda install --yes --quiet pip
)
- pip install nose wheel coveralls

## For commits performed with the default user.
- |
git config --global user.email "[email protected]"
git config --global user.name "Travis Runner"

- pip install -e .

build: false

test_script:
- IF "%PYTHON_VERSION%"=="3.5" (
nosetests -v --with-coverage
) ELSE (
nosetests -v
)
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,21 @@ Once the clone is complete, please be sure to initialize the submodules using
cd gitdb
git submodule update --init

Run the tests with
Run the tests with

nosetests

DEVELOPMENT
===========

.. image:: https://travis-ci.org/gitpython-developers/gitdb.svg?branch=master
:target: https://travis-ci.org/gitpython-developers/gitdb

.. image:: https://ci.appveyor.com/api/projects/status/2qa4km4ln7bfv76r/branch/master?svg=true&passingText=windows%20OK&failingText=windows%20failed
:target: https://ci.appveyor.com/project/ankostis/gitpython/branch/master)
.. image:: https://coveralls.io/repos/gitpython-developers/gitdb/badge.png
:target: https://coveralls.io/r/gitpython-developers/gitdb

.. image:: http://www.issuestats.com/github/gitpython-developers/gitdb/badge/pr
:target: http://www.issuestats.com/github/gitpython-developers/gitdb

.. image:: http://www.issuestats.com/github/gitpython-developers/gitdb/badge/issue
:target: http://www.issuestats.com/github/gitpython-developers/gitdb

Expand Down
10 changes: 5 additions & 5 deletions gitdb/test/performance/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_pack_random_access(self):
sha_list = list(pdb.sha_iter())
elapsed = time() - st
ns = len(sha_list)
print("PDB: looked up %i shas by index in %f s ( %f shas/s )" % (ns, elapsed, ns / elapsed), file=sys.stderr)
print("PDB: looked up %i shas by index in %f s ( %f shas/s )" % (ns, elapsed, ns / (elapsed or 1)), file=sys.stderr)

# sha lookup: best-case and worst case access
pdb_pack_info = pdb._pack_info
Expand All @@ -51,7 +51,7 @@ def test_pack_random_access(self):
del(pdb._entities)
pdb.entities()
print("PDB: looked up %i sha in %i packs in %f s ( %f shas/s )" %
(ns, len(pdb.entities()), elapsed, ns / elapsed), file=sys.stderr)
(ns, len(pdb.entities()), elapsed, ns / (elapsed or 1)), file=sys.stderr)
# END for each random mode

# query info and streams only
Expand All @@ -62,7 +62,7 @@ def test_pack_random_access(self):
pdb_fun(sha)
elapsed = time() - st
print("PDB: Obtained %i object %s by sha in %f s ( %f items/s )" %
(max_items, pdb_fun.__name__.upper(), elapsed, max_items / elapsed), file=sys.stderr)
(max_items, pdb_fun.__name__.upper(), elapsed, max_items / (elapsed or 1)), file=sys.stderr)
# END for each function

# retrieve stream and read all
Expand All @@ -78,7 +78,7 @@ def test_pack_random_access(self):
elapsed = time() - st
total_kib = total_size / 1000
print("PDB: Obtained %i streams by sha and read all bytes totallying %i KiB ( %f KiB / s ) in %f s ( %f streams/s )" %
(max_items, total_kib, total_kib / elapsed, elapsed, max_items / elapsed), file=sys.stderr)
(max_items, total_kib, total_kib / (elapsed or 1), elapsed, max_items / (elapsed or 1)), file=sys.stderr)

@skip_on_travis_ci
def test_loose_correctness(self):
Expand Down Expand Up @@ -129,5 +129,5 @@ def test_correctness(self):
# END for each entity
elapsed = time() - st
print("PDB: verified %i objects (crc=%i) in %f s ( %f objects/s )" %
(count, crc, elapsed, count / elapsed), file=sys.stderr)
(count, crc, elapsed, count / (elapsed or 1)), file=sys.stderr)
# END for each verify mode
6 changes: 3 additions & 3 deletions gitdb/test/performance/test_pack_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def test_pack_writing(self):
# END gather objects for pack-writing
elapsed = time() - st
print("PDB Streaming: Got %i streams by sha in in %f s ( %f streams/s )" %
(ni, elapsed, ni / elapsed), file=sys.stderr)
(ni, elapsed, ni / (elapsed or 1)), file=sys.stderr)

st = time()
PackEntity.write_pack((pdb.stream(sha) for sha in pdb.sha_iter()), ostream.write, object_count=ni)
elapsed = time() - st
total_kb = ostream.bytes_written() / 1000
print(sys.stderr, "PDB Streaming: Wrote pack of size %i kb in %f s (%f kb/s)" %
(total_kb, elapsed, total_kb / elapsed), sys.stderr)
(total_kb, elapsed, total_kb / (elapsed or 1)), sys.stderr)

@skip_on_travis_ci
def test_stream_reading(self):
Expand All @@ -82,4 +82,4 @@ def test_stream_reading(self):
elapsed = time() - st
total_kib = total_size / 1000
print(sys.stderr, "PDB Streaming: Got %i streams by sha and read all bytes totallying %i KiB ( %f KiB / s ) in %f s ( %f streams/s )" %
(ni, total_kib, total_kib / elapsed, elapsed, ni / elapsed), sys.stderr)
(ni, total_kib, total_kib / (elapsed or 1), elapsed, ni / (elapsed or 1)), sys.stderr)
6 changes: 3 additions & 3 deletions gitdb/test/performance/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_large_data_streaming(self, path):

size_kib = size / 1000
print("Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)" %
(size_kib, fsize_kib, desc, elapsed_add, size_kib / elapsed_add), file=sys.stderr)
(size_kib, fsize_kib, desc, elapsed_add, size_kib / (elapsed_add or 1)), file=sys.stderr)

# reading all at once
st = time()
Expand All @@ -81,7 +81,7 @@ def test_large_data_streaming(self, path):
stream.seek(0)
assert shadata == stream.getvalue()
print("Read %i KiB of %s data at once from loose odb in %f s ( %f Read KiB / s)" %
(size_kib, desc, elapsed_readall, size_kib / elapsed_readall), file=sys.stderr)
(size_kib, desc, elapsed_readall, size_kib / (elapsed_readall or 1)), file=sys.stderr)

# reading in chunks of 1 MiB
cs = 512 * 1000
Expand All @@ -101,7 +101,7 @@ def test_large_data_streaming(self, path):

cs_kib = cs / 1000
print("Read %i KiB of %s data in %i KiB chunks from loose odb in %f s ( %f Read KiB / s)" %
(size_kib, desc, cs_kib, elapsed_readchunks, size_kib / elapsed_readchunks), file=sys.stderr)
(size_kib, desc, cs_kib, elapsed_readchunks, size_kib / (elapsed_readchunks or 1)), file=sys.stderr)

# del db file so we keep something to do
os.remove(db_file)
Expand Down
9 changes: 6 additions & 3 deletions gitdb/test/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,18 @@ def test_pack_entity(self, rw_dir):

# pack writing - write all packs into one
# index path can be None
pack_path = tempfile.mktemp('', "pack", rw_dir)
pack_path1 = tempfile.mktemp('', "pack1", rw_dir)
pack_path2 = tempfile.mktemp('', "pack2", rw_dir)
index_path = tempfile.mktemp('', 'index', rw_dir)
iteration = 0

def rewind_streams():
for obj in pack_objs:
obj.stream.seek(0)
# END utility
for ppath, ipath, num_obj in zip((pack_path, ) * 2, (index_path, None), (len(pack_objs), None)):
for ppath, ipath, num_obj in zip((pack_path1, pack_path2),
(index_path, None),
(len(pack_objs), None)):
iwrite = None
if ipath:
ifile = open(ipath, 'wb')
Expand All @@ -214,7 +217,7 @@ def rewind_streams():
assert os.path.getsize(ppath) > 100

# verify pack
pf = PackFile(ppath)
pf = PackFile(ppath) # FIXME: Leaks file-pointer(s)!
assert pf.size() == len(pack_objs)
assert pf.version() == PackFile.pack_version_default
assert pf.checksum() == pack_sha
Expand Down