mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 16:08:10 +01:00
Bump pylint from 3.0.3 to 3.1.0 (#6287)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
27b286b57f
commit
01419822f7
4 changed files with 13 additions and 7 deletions
|
@ -400,8 +400,7 @@ class BitmapFontWrapper:
|
||||||
for glyph in glyphs:
|
for glyph in glyphs:
|
||||||
mask = self.getmask(glyph, mode="1")
|
mask = self.getmask(glyph, mode="1")
|
||||||
_, height = mask.size
|
_, height = mask.size
|
||||||
if height > max_height:
|
max_height = max(max_height, height)
|
||||||
max_height = height
|
|
||||||
return (max_height, 0)
|
return (max_height, 0)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ def _load_tzdata(iana_key: str) -> Optional[bytes]:
|
||||||
package = "tzdata.zoneinfo." + package_loc.replace("/", ".")
|
package = "tzdata.zoneinfo." + package_loc.replace("/", ".")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return resources.read_binary(package, resource)
|
return (resources.files(package) / resource).read_bytes()
|
||||||
except (FileNotFoundError, ModuleNotFoundError):
|
except (FileNotFoundError, ModuleNotFoundError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,9 @@ class FileResource:
|
||||||
resource: str
|
resource: str
|
||||||
|
|
||||||
def path(self) -> ContextManager[Path]:
|
def path(self) -> ContextManager[Path]:
|
||||||
return importlib.resources.path(self.package, self.resource)
|
return importlib.resources.as_file(
|
||||||
|
importlib.resources.files(self.package) / self.resource
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ComponentManifest:
|
class ComponentManifest:
|
||||||
|
@ -101,10 +103,15 @@ class ComponentManifest:
|
||||||
loaded .py file (does not look through subdirectories)
|
loaded .py file (does not look through subdirectories)
|
||||||
"""
|
"""
|
||||||
ret = []
|
ret = []
|
||||||
for resource in importlib.resources.contents(self.package):
|
|
||||||
|
for resource in (
|
||||||
|
r.name
|
||||||
|
for r in importlib.resources.files(self.package).iterdir()
|
||||||
|
if r.is_file()
|
||||||
|
):
|
||||||
if Path(resource).suffix not in SOURCE_FILE_EXTENSIONS:
|
if Path(resource).suffix not in SOURCE_FILE_EXTENSIONS:
|
||||||
continue
|
continue
|
||||||
if not importlib.resources.is_resource(self.package, resource):
|
if not importlib.resources.files(self.package).joinpath(resource).is_file():
|
||||||
# Not a resource = this is a directory (yeah this is confusing)
|
# Not a resource = this is a directory (yeah this is confusing)
|
||||||
continue
|
continue
|
||||||
ret.append(FileResource(self.package, resource))
|
ret.append(FileResource(self.package, resource))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
pylint==3.0.3
|
pylint==3.1.0
|
||||||
flake8==7.0.0 # also change in .pre-commit-config.yaml when updating
|
flake8==7.0.0 # also change in .pre-commit-config.yaml when updating
|
||||||
black==24.4.0 # also change in .pre-commit-config.yaml when updating
|
black==24.4.0 # also change in .pre-commit-config.yaml when updating
|
||||||
pyupgrade==3.15.1 # also change in .pre-commit-config.yaml when updating
|
pyupgrade==3.15.1 # also change in .pre-commit-config.yaml when updating
|
||||||
|
|
Loading…
Reference in a new issue