test: unpin django-stubs and update mypy (#6901)

* chore: Unpin django-stubs / update mypy

* test: Use "app.model" for ManyToManyField

django-stubs requires "app.model" instead of just "model" for
ManyToManyField lazy model references.

See https://github.com/typeddjango/django-stubs/issues/1802
This commit is contained in:
Jennifer Richards 2024-01-10 11:53:43 -04:00 committed by GitHub
parent 3312913c6f
commit 81dc5554a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 15 deletions

View file

@ -83,7 +83,7 @@ class State(models.Model):
desc = models.TextField(blank=True)
order = models.IntegerField(default=0)
next_states = models.ManyToManyField('State', related_name="previous_states", blank=True)
next_states = models.ManyToManyField('doc.State', related_name="previous_states", blank=True)
def __str__(self):
return self.name

View file

@ -16,11 +16,11 @@ from ietf.utils.models import ForeignKey
class IprDisclosureBase(models.Model):
by = ForeignKey(Person) # who was logged in, or System if nobody was logged in
compliant = models.BooleanField("Complies to RFC3979", default=True)
docs = models.ManyToManyField(Document, through='IprDocRel')
docs = models.ManyToManyField(Document, through='ipr.IprDocRel')
holder_legal_name = models.CharField(max_length=255)
notes = models.TextField("Additional notes", blank=True)
other_designations = models.CharField("Designations for other contributions", blank=True, max_length=255)
rel = models.ManyToManyField('self', through='RelatedIpr', symmetrical=False)
rel = models.ManyToManyField('self', through='ipr.RelatedIpr', symmetrical=False)
state = ForeignKey(IprDisclosureStateName)
submitter_name = models.CharField(max_length=255,blank=True)
submitter_email = models.EmailField(blank=True)

View file

@ -44,7 +44,7 @@ class LiaisonStatement(models.Model):
body = models.TextField(blank=True)
tags = models.ManyToManyField(LiaisonStatementTagName, blank=True)
attachments = models.ManyToManyField(Document, through='LiaisonStatementAttachment', blank=True)
attachments = models.ManyToManyField(Document, through='liaisons.LiaisonStatementAttachment', blank=True)
state = ForeignKey(LiaisonStatementState, default='pending')
class Meta:

View file

@ -36,8 +36,8 @@ def clean_duplicates(addrlist):
class MailTrigger(models.Model):
slug = models.CharField(max_length=64, primary_key=True)
desc = models.TextField(blank=True)
to = models.ManyToManyField('Recipient', blank=True, related_name='used_in_to')
cc = models.ManyToManyField('Recipient', blank=True, related_name='used_in_cc')
to = models.ManyToManyField('mailtrigger.Recipient', blank=True, related_name='used_in_to')
cc = models.ManyToManyField('mailtrigger.Recipient', blank=True, related_name='used_in_cc')
class Meta:
ordering = ["slug"]

View file

@ -569,7 +569,7 @@ class TimeSlot(models.Model):
duration = models.DurationField(default=datetime.timedelta(0))
location = ForeignKey(Room, blank=True, null=True)
show_location = models.BooleanField(default=True, help_text="Show location in agenda.")
sessions = models.ManyToManyField('Session', related_name='slots', through='SchedTimeSessAssignment', blank=True, help_text="Scheduled session, if any.")
sessions = models.ManyToManyField('meeting.Session', related_name='slots', through='meeting.SchedTimeSessAssignment', blank=True, help_text="Scheduled session, if any.")
modified = models.DateTimeField(auto_now=True)
#

View file

@ -101,7 +101,7 @@ class DraftSubmissionStateName(NameModel):
"""Uploaded, Awaiting Submitter Authentication, Awaiting Approval from
Previous Version Authors, Awaiting Initial Version Approval, Awaiting
Manual Post, Cancelled, Posted"""
next_states = models.ManyToManyField('DraftSubmissionStateName', related_name="previous_states", blank=True)
next_states = models.ManyToManyField('name.DraftSubmissionStateName', related_name="previous_states", blank=True)
class RoomResourceName(NameModel):
"Room resources: Audio Stream, Meetecho, . . ."
class IprDisclosureStateName(NameModel):

View file

@ -148,7 +148,7 @@ class Nominee(models.Model):
email = ForeignKey(Email)
person = ForeignKey(Person, blank=True, null=True)
nominee_position = models.ManyToManyField('Position', through='NomineePosition')
nominee_position = models.ManyToManyField('nomcom.Position', through='nomcom.NomineePosition')
duplicated = ForeignKey('Nominee', blank=True, null=True)
nomcom = ForeignKey('NomCom')
@ -293,9 +293,9 @@ class Topic(models.Model):
class Feedback(models.Model):
nomcom = ForeignKey('NomCom')
author = models.EmailField(verbose_name='Author', blank=True)
positions = models.ManyToManyField('Position', blank=True)
nominees = models.ManyToManyField('Nominee', blank=True)
topics = models.ManyToManyField('Topic', blank=True)
positions = models.ManyToManyField('nomcom.Position', blank=True)
nominees = models.ManyToManyField('nomcom.Nominee', blank=True)
topics = models.ManyToManyField('nomcom.Topic', blank=True)
subject = models.TextField(verbose_name='Subject', blank=True)
comments = models.BinaryField(verbose_name='Comments')
type = ForeignKey(FeedbackTypeName, blank=True, null=True)

View file

@ -22,8 +22,7 @@ django-markup>=1.5 # Limited use - need to reconcile against direct use of ma
django-oidc-provider>=0.8.1 # 0.8 dropped Django 2 support
django-referrer-policy>=1.0
django-simple-history>=3.0.0
#django-stubs>=4.2.0 # The django-stubs version used determines the the mypy version indicated below
django-stubs==4.2.4 # Pin here until we fix test failures (and update mypy version, too)
django-stubs>=4.2.7 # The django-stubs version used determines the the mypy version indicated below
django-tastypie>=0.14.5 # Version must be locked in sync with version of Django
django-vite>=2.0.2,<3
django-webtest>=1.9.10 # Only used in tests
@ -46,7 +45,7 @@ markdown>=3.3.6
types-markdown>=3.3.6
mock>=4.0.3 # Used only by tests, of course
types-mock>=4.0.3
mypy~=1.2.0 # Version requirements determined by django-stubs.
mypy~=1.7.0 # Version requirements determined by django-stubs.
oic>=1.3 # Used only by tests
Pillow>=9.1.0
psycopg2>=2.9.6