mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-11 18:13:26 +00:00
add type annotation for mypy
mypy comlains: ``` ubuntutools/config.py:53: error: Need type annotation for "config" (hint: "config: dict[<type>, <type>] = ...") [var-annotated] ubuntutools/lp/lpapicache.py:1504: error: Need type annotation for "_source_sets" (hint: "_source_sets: dict[<type>, <type>] = ...") [var-annotated] ```
This commit is contained in:
parent
aa439fec02
commit
f0326592bd
@ -50,7 +50,7 @@ class UDTConfig:
|
||||
"KEYID": None,
|
||||
}
|
||||
# Populated from the configuration files:
|
||||
config = {}
|
||||
config: dict[str, str] = {}
|
||||
|
||||
def __init__(self, no_conf=False, prefix=None):
|
||||
self.no_conf = no_conf
|
||||
@ -61,7 +61,7 @@ class UDTConfig:
|
||||
self.config = self.parse_devscripts_config()
|
||||
|
||||
@staticmethod
|
||||
def parse_devscripts_config():
|
||||
def parse_devscripts_config() -> dict[str, str]:
|
||||
"""Read the devscripts configuration files, and return the values as a
|
||||
dictionary
|
||||
"""
|
||||
|
||||
@ -26,6 +26,7 @@ import logging
|
||||
import os
|
||||
import re
|
||||
from copy import copy
|
||||
from typing import Any
|
||||
from urllib.error import URLError
|
||||
from urllib.parse import urlparse
|
||||
|
||||
@ -1501,7 +1502,7 @@ class Packageset(BaseWrapper): # pylint: disable=too-few-public-methods
|
||||
|
||||
resource_type = "packageset"
|
||||
_lp_packagesets = None
|
||||
_source_sets = {}
|
||||
_source_sets: dict[tuple[str, str | None, bool], Any] = {}
|
||||
|
||||
@classmethod
|
||||
def setsIncludingSource(cls, sourcepackagename, distroseries=None, direct_inclusion=False):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user