Skip to content

Commit 81dc555

Browse files
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 typeddjango/django-stubs#1802
1 parent 3312913 commit 81dc555

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

ietf/doc/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class State(models.Model):
8383
desc = models.TextField(blank=True)
8484
order = models.IntegerField(default=0)
8585

86-
next_states = models.ManyToManyField('State', related_name="previous_states", blank=True)
86+
next_states = models.ManyToManyField('doc.State', related_name="previous_states", blank=True)
8787

8888
def __str__(self):
8989
return self.name

ietf/ipr/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
class IprDisclosureBase(models.Model):
1717
by = ForeignKey(Person) # who was logged in, or System if nobody was logged in
1818
compliant = models.BooleanField("Complies to RFC3979", default=True)
19-
docs = models.ManyToManyField(Document, through='IprDocRel')
19+
docs = models.ManyToManyField(Document, through='ipr.IprDocRel')
2020
holder_legal_name = models.CharField(max_length=255)
2121
notes = models.TextField("Additional notes", blank=True)
2222
other_designations = models.CharField("Designations for other contributions", blank=True, max_length=255)
23-
rel = models.ManyToManyField('self', through='RelatedIpr', symmetrical=False)
23+
rel = models.ManyToManyField('self', through='ipr.RelatedIpr', symmetrical=False)
2424
state = ForeignKey(IprDisclosureStateName)
2525
submitter_name = models.CharField(max_length=255,blank=True)
2626
submitter_email = models.EmailField(blank=True)

ietf/liaisons/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class LiaisonStatement(models.Model):
4444
body = models.TextField(blank=True)
4545

4646
tags = models.ManyToManyField(LiaisonStatementTagName, blank=True)
47-
attachments = models.ManyToManyField(Document, through='LiaisonStatementAttachment', blank=True)
47+
attachments = models.ManyToManyField(Document, through='liaisons.LiaisonStatementAttachment', blank=True)
4848
state = ForeignKey(LiaisonStatementState, default='pending')
4949

5050
class Meta:

ietf/mailtrigger/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def clean_duplicates(addrlist):
3636
class MailTrigger(models.Model):
3737
slug = models.CharField(max_length=64, primary_key=True)
3838
desc = models.TextField(blank=True)
39-
to = models.ManyToManyField('Recipient', blank=True, related_name='used_in_to')
40-
cc = models.ManyToManyField('Recipient', blank=True, related_name='used_in_cc')
39+
to = models.ManyToManyField('mailtrigger.Recipient', blank=True, related_name='used_in_to')
40+
cc = models.ManyToManyField('mailtrigger.Recipient', blank=True, related_name='used_in_cc')
4141

4242
class Meta:
4343
ordering = ["slug"]

ietf/meeting/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ class TimeSlot(models.Model):
569569
duration = models.DurationField(default=datetime.timedelta(0))
570570
location = ForeignKey(Room, blank=True, null=True)
571571
show_location = models.BooleanField(default=True, help_text="Show location in agenda.")
572-
sessions = models.ManyToManyField('Session', related_name='slots', through='SchedTimeSessAssignment', blank=True, help_text="Scheduled session, if any.")
572+
sessions = models.ManyToManyField('meeting.Session', related_name='slots', through='meeting.SchedTimeSessAssignment', blank=True, help_text="Scheduled session, if any.")
573573
modified = models.DateTimeField(auto_now=True)
574574
#
575575

ietf/name/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DraftSubmissionStateName(NameModel):
101101
"""Uploaded, Awaiting Submitter Authentication, Awaiting Approval from
102102
Previous Version Authors, Awaiting Initial Version Approval, Awaiting
103103
Manual Post, Cancelled, Posted"""
104-
next_states = models.ManyToManyField('DraftSubmissionStateName', related_name="previous_states", blank=True)
104+
next_states = models.ManyToManyField('name.DraftSubmissionStateName', related_name="previous_states", blank=True)
105105
class RoomResourceName(NameModel):
106106
"Room resources: Audio Stream, Meetecho, . . ."
107107
class IprDisclosureStateName(NameModel):

ietf/nomcom/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class Nominee(models.Model):
148148

149149
email = ForeignKey(Email)
150150
person = ForeignKey(Person, blank=True, null=True)
151-
nominee_position = models.ManyToManyField('Position', through='NomineePosition')
151+
nominee_position = models.ManyToManyField('nomcom.Position', through='nomcom.NomineePosition')
152152
duplicated = ForeignKey('Nominee', blank=True, null=True)
153153
nomcom = ForeignKey('NomCom')
154154

@@ -293,9 +293,9 @@ def get_description(self):
293293
class Feedback(models.Model):
294294
nomcom = ForeignKey('NomCom')
295295
author = models.EmailField(verbose_name='Author', blank=True)
296-
positions = models.ManyToManyField('Position', blank=True)
297-
nominees = models.ManyToManyField('Nominee', blank=True)
298-
topics = models.ManyToManyField('Topic', blank=True)
296+
positions = models.ManyToManyField('nomcom.Position', blank=True)
297+
nominees = models.ManyToManyField('nomcom.Nominee', blank=True)
298+
topics = models.ManyToManyField('nomcom.Topic', blank=True)
299299
subject = models.TextField(verbose_name='Subject', blank=True)
300300
comments = models.BinaryField(verbose_name='Comments')
301301
type = ForeignKey(FeedbackTypeName, blank=True, null=True)

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ django-markup>=1.5 # Limited use - need to reconcile against direct use of ma
2222
django-oidc-provider>=0.8.1 # 0.8 dropped Django 2 support
2323
django-referrer-policy>=1.0
2424
django-simple-history>=3.0.0
25-
#django-stubs>=4.2.0 # The django-stubs version used determines the the mypy version indicated below
26-
django-stubs==4.2.4 # Pin here until we fix test failures (and update mypy version, too)
25+
django-stubs>=4.2.7 # The django-stubs version used determines the the mypy version indicated below
2726
django-tastypie>=0.14.5 # Version must be locked in sync with version of Django
2827
django-vite>=2.0.2,<3
2928
django-webtest>=1.9.10 # Only used in tests
@@ -46,7 +45,7 @@ markdown>=3.3.6
4645
types-markdown>=3.3.6
4746
mock>=4.0.3 # Used only by tests, of course
4847
types-mock>=4.0.3
49-
mypy~=1.2.0 # Version requirements determined by django-stubs.
48+
mypy~=1.7.0 # Version requirements determined by django-stubs.
5049
oic>=1.3 # Used only by tests
5150
Pillow>=9.1.0
5251
psycopg2>=2.9.6

0 commit comments

Comments
 (0)