Skip to content

Commit 0e27053

Browse files
committed
Merge branch 'develop'
2 parents 1c66482 + dc41a2a commit 0e27053

10 files changed

+39
-22
lines changed

Diff for: .travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
os: osx
22
language: generic
3+
osx_image: xcode6.4
34
env:
45
global:
56
- secure: "R5OivfMMAw1BhdwbBjEjfxhkqtj+Ntqf+jh+05Mr3y1aV8tC9J1vsq213Q7J7teweJ7WteHSj8ymJk2DdJ5mOIFEPAWQeuUIzcaplmfmsxYNdUhj19Ok8E8XG+ppBHccDaS3eE6GM6tDB9PouOE0MGA8/j9DLHXDSPTrjO/+G+AQ7V9M2+XqiEHJrPhlzas1h37XKLa5EzMIMK3atoUS1CLg6JOa+Rgz9OfXs+wQyErdQ5BjNfzZH4BKFhHl1zBViPv+j3SHDkyFw92mbXx14qn8xiyY3ZtKisMKT/X5o8DUJbWN3OdFF65NQq5lcnTFjIx06LJmy+zLjnZ83qggRuRPxAV2D9ODRBjDY3bdBMVSeaP/0yKldZyd14UXU3Ahwymi9lHC+MRgzRx5VyovptgOq3RfZ97peRT0NRDuotcxG1oFcAOIutH7oQZiAWZV7LLSSc3JdNCbwjRDm0MqzoD4TcMa8vCJMEZWSzLLygJYiZC0OklTnOYko5wdYms8aJw1FPjXbc2UNo6bVXXnbdoxEfadxtWKskNKF6tSdl766CMh/jM3gMv2bZkY2mYSnNp1RL1sslE33BZPgzW5fyFnUBskwQZEOidWx+uQ1eiPsnvb5FBC8on59fTVKkHh6Xiffqltq8Yvy33P12qoV+S9GHMT4DOm9bQf/qob2fQ="
@@ -8,6 +9,7 @@ env:
89
- VERSION=3.3
910
- VERSION=3.4
1011
- VERSION=3.5
12+
- VERSION=3.6
1113
matrix:
1214
include:
1315
- sudo: required

Diff for: README.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,32 @@ Usage
3030

3131
.. code-block:: python
3232
33-
from bencoder import bencode, bdecode
33+
from bencoder import bencode, bdecode, bdecode2
3434
3535
assert bencode("WWWWWW") == b'6:WWWWWW'
3636
assert bencode(233) == b'i233e'
3737
3838
with open("debian-8.3.0-amd64-netinst.iso.torrent", "rb") as f:
3939
torrent = bdecode(f.read())
4040
print(torrent['announce'])
41+
42+
decoded, length = bdecode2(b'6:WWWWWWi233e')
43+
assert decoded == b'WWWWWW'
44+
assert length == 8
4145
4246
ChangeLog
4347
----------
4448

49+
Version 1.2.0
50+
~~~~~~~~~~~~~~~
51+
52+
+ Add `bdecode2` method. `#6 <https://github.com/whtsky/bencoder.pyx/pull/6>`_
53+
4554
Version 1.1.3
4655
~~~~~~~~~~~~~~~
4756

4857
+ Performance Improvement
49-
+ Fix package metainfo ` #3 <https://github.com/whtsky/bencoder.pyx/issues/3>`_
58+
+ Fix package metainfo `#3 <https://github.com/whtsky/bencoder.pyx/issues/3>`_
5059

5160
Version 1.1.2
5261
~~~~~~~~~~~~~~~

Diff for: appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ environment:
1616
- PYTHON: "C:\\Python34-x64"
1717
- PYTHON: "C:\\Python35"
1818
- PYTHON: "C:\\Python35-x64"
19+
- PYTHON: "C:\\Python36"
20+
- PYTHON: "C:\\Python36-x64"
1921

2022
init:
2123
- ps: "ls C:/Python*"

Diff for: bencoder.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# Based on https://github.com/karamanolev/bencode3/blob/master/bencode.py
1414

15-
__version__ = '1.1.3'
15+
__version__ = '1.2.0'
1616

1717
import array
1818

Diff for: ci/travis_osx_install.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
git clone https://github.com/MacPython/terryfy.git
2-
source terryfy/library_installers.sh
3-
clean_builds
4-
get_python_environment macpython $VERSION venv
1+
git clone https://github.com/matthew-brett/multibuild.git
2+
source multibuild/osx_utils.sh
3+
get_macpython_environment $VERSION venv
54
pip install --upgrade pip wheel
65
pip install -r dev-requirements.txt

Diff for: dev-requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pytest
2-
pytest-benchmark
3-
coverage
4-
cython
5-
tox
1+
pytest==3.0.5
2+
pytest-benchmark==3.0.0
3+
coverage==4.3.1
4+
cython==0.25.2
5+
tox==2.5.0

Diff for: setup.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@
2525
# Remove C file to force Cython recompile.
2626
os.remove(c_path)
2727
if 'test' in sys.argv and platform.python_implementation() == 'CPython':
28-
from Cython.Compiler.Options import directive_defaults
29-
30-
directive_defaults['linetrace'] = True
31-
directive_defaults['binding'] = True
32-
3328
from Cython.Build import cythonize
3429
ext_modules = cythonize(Extension(
3530
"bencoder",
3631
[pyx_path],
3732
define_macros=[('CYTHON_TRACE', '1')]
38-
))
33+
), compiler_directives={
34+
'linetrace': True,
35+
'binding': True
36+
})
3937
else:
4038
from Cython.Build import cythonize
4139
ext_modules = cythonize(Extension(
@@ -99,7 +97,7 @@ def get_tag(self):
9997

10098
setup(
10199
name='bencoder.pyx',
102-
version='1.1.3',
100+
version='1.2.0',
103101
description='Yet another bencode implementation in Cython',
104102
long_description=open('README.rst', 'r').read(),
105103
author='whtsky',
@@ -125,6 +123,7 @@ def get_tag(self):
125123
'Programming Language :: Python :: 3.3',
126124
'Programming Language :: Python :: 3.4',
127125
'Programming Language :: Python :: 3.5',
126+
'Programming Language :: Python :: 3.6',
128127
'Programming Language :: Python :: Implementation :: CPython',
129128
'Programming Language :: Python :: Implementation :: PyPy',
130129
'Intended Audience :: Developers',

Diff for: tests/test_decode.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
from bencoder import bdecode
3+
from bencoder import bdecode, bdecode2
44
import os
55
import sys
66

@@ -10,6 +10,12 @@
1010
)
1111

1212

13+
def test_decode2():
14+
decoded, length = bdecode2(b'6:WWWWWWi233e')
15+
assert decoded == b'WWWWWW'
16+
assert length == 8
17+
18+
1319
def test_decode_str(benchmark):
1420
assert benchmark(bdecode, b'6:WWWWWW') == b"WWWWWW"
1521

Diff for: tox-wheels.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py26, py27, py33, py34, py35
2+
envlist = py26, py27, py33, py34, py35, py36
33

44
[testenv]
55
commands = pip wheel {toxinidir} -w {toxinidir}/wheelhouse/

Diff for: tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py26, py27, py33, py34, py35, pypy
2+
envlist = py26, py27, py33, py34, py35, py36, pypy
33

44
[testenv]
55
commands =

0 commit comments

Comments
 (0)