Page MenuHomeSoftware Heritage

typing: minimal changes to make a no-op mypy run pass
Needs ReviewPublic

Authored by zack on Tue, Sep 24, 11:05 AM.

Details

Diff Detail

Repository
rDDEP swh-deposit
Branch
feature/typing
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8047
Build 11597: tox-on-jenkinsJenkins
Build 11596: arc lint + arc unit

Event Timeline

zack created this revision.Tue, Sep 24, 11:05 AM
zack updated this revision to Diff 6828.Wed, Sep 25, 11:08 AM
  • models: add required on_delete kwarg to ForeignKey
  • models: add migration to on_delete=protect
  • typing: minimal changes to make a no-op mypy run pass
zack updated this revision to Diff 6829.Wed, Sep 25, 11:41 AM
  • typing: convert leftover variable annotation to comments
ardumont added inline comments.
swh/deposit/migrations/0017_auto_20190925_0906.py
21 ↗(On Diff #6829)

This is out of scope for this diff, this is D2031's
You need to arc diff HEAD~3 --update D2032 (3 commits you made for this diff).

As the diff is stacked (i don't see the Depends on D2031 in the diff description but you probably added the diff's dependency yourself), the build should be ok.

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Sep 26, 3:49 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
zack reopened this revision.Fri, Sep 27, 10:34 AM
zack updated this revision to Diff 6834.Fri, Sep 27, 10:35 AM
  • typing: minimal changes to make a no-op mypy run pass
  • typing: convert leftover variable annotation to comments
  • init.py: switch to documented way of extending path
zack added a comment.Fri, Sep 27, 10:36 AM

this is now (also) waiting for an upstream release of django-stubs compatible with mypy >= 0.730

zack updated this revision to Diff 6903.Tue, Oct 1, 12:28 PM
  • tox: add mypy environment

where should the mypy_django_plugin dependency be? looks like this is required.

zack added a comment.Wed, Oct 2, 11:46 AM

where should the mypy_django_plugin dependency be? looks like this is required.

It comes from the django-stubs PyPI package, which is added by this diff to requirements-test.txt. But. The most recent release of django-stubs is incompatible (and declared as such in its dependencies) with the most recent release of mypy (0.730). I'm waiting for a new release of django-stubs to be made by upstream. See discussion here: https://github.com/typeddjango/django-stubs/issues/160