Skip to content

Commit

Permalink
Support mypy for type annotations (#29)
Browse files Browse the repository at this point in the history
* Initial static type checker (mypy) setup to add and validate future type annotations
* Fix an type mismatch error detected by mypy
  • Loading branch information
sedman authored and achimnol committed Aug 15, 2017
1 parent d20c972 commit fc58380
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions aiodocker/swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ async def init(self,
'Spec': swarm_spec,
}

data = json.dumps(data)
data_str = json.dumps(data)

response = await self.docker._query(
"swarm/init",
method='POST',
headers={"content-type": "application/json", },
data=data
data=data_str
)

return response
Expand Down
1 change: 1 addition & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pytest==3.2.1
pytest-cov==2.5.1
pytest-asyncio==0.6.0
flake8==3.4.1
mypy==0.521
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
envlist = py35, py36, flake8
envlist = py35, py36, flake8, mypy
skipsdist=True

[travis]
python =
3.5: py35, flake8
3.6: py36, flake8
3.5: py35, flake8, mypy
3.6: py36, flake8, mypy

[testenv]
passenv=DOCKER_HOST DOCKER_VERSION
Expand All @@ -18,3 +18,7 @@ deps =
[testenv:flake8]
commands = flake8 aiodocker tests setup.py
deps = flake8

[testenv:mypy]
commands = mypy aiodocker tests --ignore-missing-imports
deps = mypy

0 comments on commit fc58380

Please sign in to comment.