← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~jugmac00/launchpad:run-mypy-via-tox into launchpad:master

 

Jürgen Gmach has proposed merging ~jugmac00/launchpad:run-mypy-via-tox into launchpad:master.

Commit message:
Run mypy via tox

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/427961
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:run-mypy-via-tox into launchpad:master.
diff --git a/lib/lp/services/database/sqlobject/__init__.py b/lib/lp/services/database/sqlobject/__init__.py
index e1fcf9d..4013d35 100644
--- a/lib/lp/services/database/sqlobject/__init__.py
+++ b/lib/lp/services/database/sqlobject/__init__.py
@@ -7,7 +7,31 @@
 import datetime
 
 from storm.expr import SQL
-from storm.sqlobject import *  # noqa: F401,F403
+from storm.sqlobject import (  # noqa: F401
+    AND,
+    CONTAINSSTRING,
+    DESC,
+    IN,
+    LIKE,
+    NOT,
+    OR,
+    BoolCol,
+    DateCol,
+    FloatCol,
+    ForeignKey,
+    IntCol,
+    IntervalCol,
+    SingleJoin,
+    SQLConstant,
+    SQLMultipleJoin,
+    SQLObjectBase,
+    SQLObjectMoreThanOneResultError,
+    SQLObjectNotFound,
+    SQLObjectResultSet,
+    SQLRelatedJoin,
+    StringCol,
+    UtcDateTimeCol,
+)
 
 _sqlStringReplace = [
     ("\\", "\\\\"),
diff --git a/tox.ini b/tox.ini
index 2bf5ee3..74f44ed 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,4 +1,8 @@
 [tox]
+envlist =
+    docs
+    mypy
+
 
 [testenv:docs]
 basepython = python3
@@ -14,3 +18,13 @@ deps =
     pip-tools
 commands =
     pip-compile --upgrade {toxinidir}/requirements/docs.in --output-file {toxinidir}/requirements/docs.txt
+
+[testenv:mypy]
+description = run via `tox -e mypy` from outside the LXC container on Python 3.6+
+skip_install = true
+deps =
+    mypy
+    -r requirements/types.txt
+commands =
+    mypy --follow-imports=silent \
+    {posargs:lib/lp/answers}

Follow ups