Skip to content
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
21 changes: 5 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
language: python
python:
- 2.7
- 3.4
- 3.5
install:
- pip install -U pip setuptools docutils
- pip install -e .[tests]
python: [2.7, 3.4, 3.5, 3.6]
install: pip install tox-travis
script:
- py.test tests -v
- pip install 'typing<3.5.2' && py.test tests -v
- rst2html.py --strict CHANGES.rst
- rst2html.py --strict README.rst
- python setup.py --long-description | rst2html.py --strict
- |
if [ -z "$(git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep CHANGES\.rst)" ]; then
exit 1
fi
- tox
- tox -e docs
- git diff --name-only "$TRAVIS_COMMIT_RANGE" | grep CHANGES\.rst
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 0.5.1

To be released.

- Added Python 3.6 support.
- Wheel distributions (``nirum-*.whl``) are now universal between Python 2
and 3. [`#78`_]
- ``nirum.rpc.Client`` and its subtype became to raise ``TypeError`` with
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nirum-python
============

Python rumtime for Nirum_ IDL. Distributed under MIT license.
The Nirum_ runtime library for Python. Distributed under MIT license.

(You probably don't need directly use this package.)

Expand Down
4 changes: 0 additions & 4 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@
set -e

flake8 .

if [[ "$(python -c "import sys;print(sys.version[0])")" != "2" ]]; then
import-order nirum ./nirum
fi
2 changes: 1 addition & 1 deletion nirum/deserialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from iso8601 import iso8601, parse_date
from six import text_type

from .datastructures import Map
from ._compat import get_tuple_param_types, get_union_types, is_union_type
from .datastructures import Map

__all__ = (
'deserialize_abstract_type',
Expand Down
27 changes: 20 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
import sys

from setuptools import find_packages, setup, __version__ as setuptools_version
from setuptools import find_packages, setup, __version__ as setuptools_version


def readme(name='README.rst'):
Expand Down Expand Up @@ -39,10 +39,10 @@ def get_version():
'six', 'iso8601',
] + service_requires
tests_require = [
'pytest >= 2.9.0',
'import-order',
'flake8',
'tox',
'pytest >= 3.1.2, < 4.0.0',
'pytest-flake8 >= 0.8.1, < 1.0.0',
'flake8-import-order >= 0.12, < 1.0',
'flake8-import-order-spoqa >= 1.0.0, < 2.0.0',
]
docs_require = [
'Sphinx',
Expand Down Expand Up @@ -77,7 +77,7 @@ def get_version():
setup(
name='nirum',
version=get_version(),
description='',
description='The Nirum runtime library for Python',
long_description=readme(),
url='https://github.com/spoqa/nirum-python',
author='Kang Hyojun',
Expand All @@ -92,5 +92,18 @@ def get_version():
},
setup_requires=setup_requires,
extras_require=extras_require,
classifiers=[]
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Object Brokering',
]
)
1 change: 1 addition & 0 deletions tests/compat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from pytest import mark
from six import text_type

from nirum._compat import (get_abstract_param_types,
get_tuple_param_types,
get_union_types,
Expand Down
4 changes: 2 additions & 2 deletions tests/deserialize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
import datetime
import decimal
import numbers
import uuid
import typing
import uuid

from pytest import raises, mark
from six import PY3, text_type

from nirum._compat import utc
from nirum.serialize import serialize_record_type
from nirum.deserialize import (deserialize_unboxed_type, deserialize_meta,
deserialize_tuple_type,
deserialize_record_type, deserialize_union_type,
deserialize_optional, deserialize_primitive)
from nirum.serialize import serialize_record_type


def test_deserialize_unboxed_type(fx_unboxed_type, fx_token_type):
Expand Down
4 changes: 2 additions & 2 deletions tests/func_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

def test_import_string():
assert import_string('collections:OrderedDict') == collections.OrderedDict
assert import_string('collections:OrderedDict({"a": 1})') == \
collections.OrderedDict({"a": 1})
assert (import_string('collections:OrderedDict({"a": 1})') ==
collections.OrderedDict({"a": 1}))
with raises(ValueError):
# malformed
import_string('world')
Expand Down
12 changes: 6 additions & 6 deletions tests/py2_nirum.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import enum
import typing
import decimal
import enum
import json
import typing
import uuid

from six import text_type

from nirum.serialize import (serialize_record_type, serialize_unboxed_type,
serialize_meta, serialize_union_type)
from nirum.constructs import NameDict, name_dict_type
from nirum.deserialize import (deserialize_record_type,
deserialize_unboxed_type,
deserialize_meta,
deserialize_union_type)
from nirum.rpc import Client, Service
from nirum.serialize import (serialize_record_type, serialize_unboxed_type,
serialize_meta, serialize_union_type)
from nirum.validate import (validate_unboxed_type, validate_record_type,
validate_union_type)
from nirum.constructs import NameDict, name_dict_type
from nirum.rpc import Client, Service


class Offset(object):
Expand Down
12 changes: 6 additions & 6 deletions tests/py3_nirum.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import enum
import typing
import decimal
import enum
import json
import typing
import uuid

from nirum.serialize import (serialize_record_type, serialize_unboxed_type,
serialize_meta, serialize_union_type)
from nirum.constructs import NameDict, name_dict_type
from nirum.deserialize import (deserialize_record_type,
deserialize_unboxed_type,
deserialize_meta,
deserialize_union_type)
from nirum.rpc import Client, Service
from nirum.serialize import (serialize_record_type, serialize_unboxed_type,
serialize_meta, serialize_union_type)
from nirum.validate import (validate_unboxed_type, validate_record_type,
validate_union_type)
from nirum.constructs import NameDict, name_dict_type
from nirum.rpc import Client, Service


class Offset:
Expand Down
3 changes: 1 addition & 2 deletions tests/rpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
from werkzeug.test import Client as TestClient
from werkzeug.wrappers import Response

from .nirum_schema import import_nirum_fixture
from nirum.exc import (InvalidNirumServiceMethodTypeError,
InvalidNirumServiceMethodNameError,
UnexpectedNirumResponseError)
from nirum.rpc import Client, WsgiApp
from nirum.test import MockOpener

from .nirum_schema import import_nirum_fixture


nf = import_nirum_fixture()

Expand Down
2 changes: 1 addition & 1 deletion tests/serialize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from pytest import mark

from .nirum_schema import import_nirum_fixture
from nirum._compat import utc
from nirum.serialize import (serialize_unboxed_type, serialize_record_type,
serialize_meta, serialize_union_type)
from .nirum_schema import import_nirum_fixture


nirum_fixture = import_nirum_fixture()
Expand Down
17 changes: 14 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[tox]
envlist = py27,py34,py35,docs
envlist = {py27,py34,py35,py36}-{typing351,typing352},docs

[testenv]
deps = -e.[tests]
deps =
-e.[tests]
typing351: typing<3.5.2
typing352: typing>=3.5.2
commands=
py.test -v tests
pytest -v

[testenv:docs]
basepython = python3
Expand All @@ -13,3 +16,11 @@ commands =
rst2html.py --strict CHANGES.rst
rst2html.py --strict README.rst
python3 setup.py --long-description | rst2html.py --strict

[pytest]
addopts = --ff --flake8
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


[flake8]
exclude = .env, .tox, tests/py2_nirum.py, tests/py3_nirum.py
import-order-style = spoqa
application-import-names = nirum, tests