Commit c494f9ba authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

feat(mypy): Add basic configuration file for Mypy

- add basic mypy config
- update mypy command inside tox config
- set hg to ignore mypy_cache folder
- add just enough type inside schema.py to please mypy
parent 192585298359
Pipeline #59938 failed
......@@ -2,3 +2,4 @@ dist
.tox/
cubicweb_intranet.egg-info/
test/data/database
.mypy_cache/
......@@ -13,6 +13,7 @@ from cubicweb_card.schema import Card
from cubicweb_blog.schema import BlogEntry
from cubicweb_file.schema import File
from cubicweb_link.schema import Link
from typing import Tuple
PERMISSIONS = {
"read": (
......@@ -46,7 +47,15 @@ class interested_in(RelationDefinition):
object = "Event"
BASETYPES = ("Card", "BlogEntry", "File", "Event", "Link", "Task", "Book")
BASETYPES: Tuple[str, ...] = (
"Card",
"BlogEntry",
"File",
"Event",
"Link",
"Task",
"Book",
)
if "VersionedFile" in context.defined:
BASETYPES += ("VersionedFile",)
from cubicweb_vcsfile.schema import VersionedFile, VersionContent
......
[mypy]
ignore_missing_imports = True
show_error_codes = True
exclude = cubicweb_intranet/migration
......@@ -37,7 +37,7 @@ commands =
[testenv:mypy]
deps =
mypy >= 0.761
commands = mypy --ignore-missing-imports cubicweb_intranet
commands = mypy {posargs} cubicweb_intranet
[testenv:black]
basepython = python3
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment