Skip to content

Commit

Permalink
Updates for python 3.9 for v1.x (#36)
Browse files Browse the repository at this point in the history
* Set version to v1.0.2

* Update setup.py for python 3.9

* Add .cpp to package data
* Add setup requires
* Add python 3.9 classifier

* Update CI for python 3.9

* Remove numpy from setup_requires

* Update tests to use to/frombytes instead of to/fromstrings
  • Loading branch information
adrianeboyd authored Nov 3, 2020
1 parent 7618c0b commit d1fac67
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
19 changes: 14 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
imageName: 'ubuntu-16.04'
python.version: '2.7'
Python27Mac:
imageName: 'macos-10.13'
imageName: 'macos-10.14'
python.version: '2.7'
Python35Linux:
imageName: 'ubuntu-16.04'
Expand All @@ -22,7 +22,7 @@ jobs:
imageName: 'vs2017-win2016'
python.version: '3.5'
Python35Mac:
imageName: 'macos-10.13'
imageName: 'macos-10.14'
python.version: '3.5'
Python36Linux:
imageName: 'ubuntu-16.04'
Expand All @@ -31,7 +31,7 @@ jobs:
imageName: 'vs2017-win2016'
python.version: '3.6'
Python36Mac:
imageName: 'macos-10.13'
imageName: 'macos-10.14'
python.version: '3.6'
Python37Linux:
imageName: 'ubuntu-16.04'
Expand All @@ -40,7 +40,7 @@ jobs:
imageName: 'vs2017-win2016'
python.version: '3.7'
Python37Mac:
imageName: 'macos-10.13'
imageName: 'macos-10.14'
python.version: '3.7'
Python38Linux:
imageName: 'ubuntu-16.04'
Expand All @@ -49,8 +49,17 @@ jobs:
imageName: 'vs2017-win2016'
python.version: '3.8'
Python38Mac:
imageName: 'macos-10.13'
imageName: 'macos-10.14'
python.version: '3.8'
Python39Linux:
imageName: 'ubuntu-16.04'
python.version: '3.9'
Python39Windows:
imageName: 'vs2017-win2016'
python.version: '3.9'
Python39Mac:
imageName: 'macos-10.14'
python.version: '3.9'
maxParallel: 4
pool:
vmImage: $(imageName)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from setuptools import Extension, setup, find_packages


PACKAGE_DATA = {"": ["*.pyx", "*.pxd", "*.c", "*.h"]}
PACKAGE_DATA = {"": ["*.pyx", "*.pxd", "*.c", "*.h", "*.cpp"]}


PACKAGES = find_packages()
Expand Down Expand Up @@ -169,7 +169,7 @@ def setup_package():
url=about["__uri__"],
license=about["__license__"],
ext_modules=ext_modules,
setup_requires=[],
setup_requires=["cython>=0.29.1,<0.30.0"],
install_requires=['pathlib==1.0.1; python_version < "3.4"'],
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand All @@ -189,6 +189,7 @@ def setup_package():
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
],
cmdclass={"build_ext": build_ext_subclass},
Expand Down
2 changes: 1 addition & 1 deletion srsly/tests/msgpack/test_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def test_unpack_buffer():
from array import array
buf = array('b')
buf.fromstring(packb((b'foo', b'bar')))
buf.frombytes(packb((b'foo', b'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj

Expand Down
4 changes: 2 additions & 2 deletions srsly/tests/msgpack/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def default(obj):
print('default called', obj)
if isinstance(obj, array.array):
typecode = 123 # application specific typecode
data = obj.tostring()
data = obj.tobytes()
return ExtType(typecode, data)
raise TypeError("Unknown type object %r" % (obj,))

def ext_hook(code, data):
print('ext_hook called', code, data)
assert code == 123
obj = array.array('d')
obj.fromstring(data)
obj.frombytes(data)
return obj

obj = [42, b'hello', array.array('d', [1.1, 2.2, 3.3])]
Expand Down

0 comments on commit d1fac67

Please sign in to comment.