Skip to content
This repository was archived by the owner on Apr 23, 2022. It is now read-only.

Commit 1303c45

Browse files
committed
improve readme and fix travis
1 parent 5358fa8 commit 1303c45

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
- postgresql
77

88
python:
9+
- '3.5'
910
- '3.6'
1011
- 'nightly' # currently 3.7
1112

@@ -25,7 +26,6 @@ addons:
2526
- ubuntu-toolchain-r-test
2627
packages:
2728
- gcc-5
28-
- patchelf
2929

3030
install:
3131
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
@@ -38,7 +38,8 @@ script:
3838
- make lint
3939
- make test
4040
- ./tests/check_tag.py
41-
#- docker run --rm -v `pwd`:/io $DOCKER_IMAGE /io/tests/build-wheels.sh TODO currently broken as gcc-5 isn't available on centos 5
41+
# TODO manylinux is currently broken as gcc-5 isn't available on centos 5
42+
#- docker run --rm -v `pwd`:/io $DOCKER_IMAGE /io/tests/build-wheels.sh
4243

4344
after_success:
4445
- ls -lha

README.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ Fast delta encoding in python using xdelta3.
88
Requirements
99
------------
1010

11-
* **Python 3.6**
12-
* **linux**
11+
* **Python 3.5 or 3.6** - it's 2017: you should be using python 3.6 by now anyway.
12+
* **linux** - compilation only tested on ubuntu, might work on other platform.
13+
14+
Installation
15+
------------
16+
17+
.. code:: shell
18+
19+
pip install xdelta3
1320
1421
Usage
1522
-----
1623

1724
.. code:: python
1825
1926
import xdelta3
20-
value_one = b'this is a wonderful string to demonstrate with. Much of the two strings is duplicated.'
21-
value_two = b'this is a different string to demonstrate with. Much of the two strings is duplicated.'
27+
value_one = b'wonderful string to demonstrate xdelta3, much of these two strings is the same.'
28+
value_two = b'different string to demonstrate xdelta3, much of these two strings is the same.'
2229
delta = xdelta3.encode(value_one, value_two)
2330
2431
print(f'New string length: {len(value_two)}, delta length: {len(delta)}')

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ max-line-length = 120
88
max-complexity = 10
99

1010
[bdist_wheel]
11-
python-tag = py36
11+
python-tag = py35-py36
1212

1313
[coverage:run]
1414
source = xdelta3

tests/test_main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ def test_no_delta():
2121
with pytest.raises(xdelta3.NoDeltaFound) as exc_info:
2222
xdelta3.encode(b'hello', b'goodbye')
2323
assert exc_info.value.args[0] == 'No delta found shorter than the input value'
24+
25+
26+
def test_readme():
27+
value_one = b'wonderful string to demonstrate xdelta3, much of these two strings is the same.'
28+
value_two = b'different string to demonstrate xdelta3, much of these two strings is the same.'
29+
delta = xdelta3.encode(value_one, value_two)
30+
31+
value_two_rebuilt = xdelta3.decode(value_one, delta)
32+
assert value_two_rebuilt == value_two

0 commit comments

Comments
 (0)