[PATCH 02 of 24 yams V2] [tox] add mypy

Nicola Spanti nicola.spanti at logilab.fr
Wed Mar 4 16:09:40 CET 2020


$ hg id
deb24bc5407f
$ mypy --ignore-missing-imports yams
yams/schema.py:178: error: Need type annotation for '_specialized_by' 
(hint: "_specialized_by: List[<type>] = ...")
yams/reader.py:277: error: Cannot assign to a method
Found 2 errors in 2 files (checked 12 source files)

Et en fait ce patch a déjà été publié, par moi je le crains, alors qu'il 
casse tox. :-/

Le 04/03/2020 à 15:17, Laurent Peuch a écrit :
> # HG changeset patch
> # User Laurent Peuch <cortex at worlddomination.be>
> # Date 1579279651 -3600
> #      Fri Jan 17 17:47:31 2020 +0100
> # Node ID fadce0cbddeb3c003361d439be6a901e592d1042
> # Parent  4a3921f215e07cbc3561ab87354462a1a7413b8a
> # Available At https://hg.logilab.org/users/lpeuch/yams
> #              hg pull https://hg.logilab.org/users/lpeuch/yams -r fadce0cbddeb
> # EXP-Topic type_annotations
> [tox] add mypy
> 
> diff --git a/tox.ini b/tox.ini
> --- a/tox.ini
> +++ b/tox.ini
> @@ -1,5 +1,5 @@
>   [tox]
> -envlist=py3,check-manifest,flake8
> +envlist=py3,check-manifest,flake8,mypy
>   
>   [testenv]
>   basepython=python3
> @@ -28,3 +28,8 @@ exclude = docs/*,.tox/*
>   
>   [pytest]
>   python_files = *test_*.py
> +
> +[testenv:mypy]
> +deps =
> +  mypy >= 0.761
> +commands = mypy --ignore-missing-imports yams
> 



More information about the cubicweb-devel mailing list