Skip to content

Commit e15d221

Browse files
authored
Merge pull request #70 from Rafiot/master
Update travis config
2 parents 0c0c0eb + eb92d2f commit e15d221

6 files changed

Lines changed: 22 additions & 16 deletions

File tree

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
language: python
2-
python: "3.6"
2+
matrix:
3+
include:
4+
- python: 3.5
5+
env: TOXENV=py27,py34,py35
6+
- python: 3.6
7+
env: TOXENV=py36
38

49
branches:
510
only:
@@ -16,8 +21,8 @@ env:
1621
before_install:
1722
- sudo apt-get install -y zlib1g-dev liblzma-dev libbz2-dev libxml2-dev nettle-dev libattr1-dev libacl1-dev
1823
- "if [ ! -e $LIBARCHIVE ]; then
19-
wget http://libarchive.org/downloads/libarchive-3.1.2.tar.gz &&
20-
tar -xf libarchive-3.1.2.tar.gz && cd libarchive-3.1.2 &&
24+
wget http://libarchive.org/downloads/libarchive-3.3.2.tar.gz &&
25+
tar -xf libarchive-3.3.2.tar.gz && cd libarchive-3.3.2 &&
2126
./configure --prefix=/opt/python-libarchive-c --disable-bsdcpio --disable-bsdtar &&
2227
make && sudo make install && cd .. ;
2328
fi"

libarchive/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from .entry import ArchiveEntry
22
from .exception import ArchiveError
33
from .extract import extract_fd, extract_file, extract_memory
4-
from .read import custom_reader, fd_reader, file_reader, memory_reader, stream_reader
4+
from .read import (
5+
custom_reader, fd_reader, file_reader, memory_reader, stream_reader
6+
)
57
from .write import custom_writer, fd_writer, file_writer, memory_writer
68

79
__all__ = [

libarchive/read.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,11 @@ def memory_reader(buf, format_name='all', filter_name='all'):
9696

9797

9898
@contextmanager
99-
def stream_reader(stream, format_name='all', filter_name='all', block_size=page_size):
100-
"""Read an archive from a stream (an object supporting the `readinto` method).
99+
def stream_reader(stream, format_name='all', filter_name='all',
100+
block_size=page_size):
101+
"""Read an archive from a stream.
102+
103+
The `stream` object must support the standard `readinto` method.
101104
"""
102105
buf = create_string_buffer(block_size)
103106
buf_p = cast(buf, c_void_p)

libarchive/write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def new_archive_write(format_name, filter_name=None):
118118
yield archive_p
119119
ffi.write_close(archive_p)
120120
ffi.write_free(archive_p)
121-
except:
121+
except Exception:
122122
ffi.write_fail(archive_p)
123123
ffi.write_free(archive_p)
124124
raise

tests/data/testtar.tar.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@
608608
"mode": "rw-r--r--",
609609
"mtime": 1041808783,
610610
"path": "pax/regtype4",
611-
"size": 0,
611+
"size": 7011,
612612
"uid": 123
613613
},
614614
{
@@ -662,4 +662,4 @@
662662
"size": 0,
663663
"uid": 1000
664664
}
665-
]
665+
]

tox.ini

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
[tox]
2-
envlist=lint,py27,py34,py35,py36
2+
envlist=py27,py34,py35,py36
33
skipsdist=True
44

55
[testenv]
66
passenv = LIBARCHIVE
77
commands=
88
python -m pytest -vv --boxed --cov libarchive --cov-report term-missing {toxinidir}/tests {posargs}
9+
flake8 {toxinidir}
910
deps=
11+
flake8
1012
pytest
1113
pytest-cov
1214
pytest-xdist
1315
six
1416
mock
15-
16-
[testenv:lint]
17-
commands=
18-
flake8 {toxinidir}
19-
deps=
20-
flake8

0 commit comments

Comments
 (0)