chore: stricter mypy (#2053)
* chore: improve mypy Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * chore(types): type functions in tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * chore(types): No partial types in tests Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import platform
|
||||
import re
|
||||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -46,8 +47,8 @@ build-backend = "setuptools.build_meta"
|
||||
VERSION_REGEX = r"([\w-]+)==([^\s]+)"
|
||||
|
||||
|
||||
def get_versions_from_constraint_file(constraint_file):
|
||||
constraint_file_text = constraint_file.read_text(encoding="utf8")
|
||||
def get_versions_from_constraint_file(constraint_file: Path) -> dict[str, str]:
|
||||
constraint_file_text = constraint_file.read_text(encoding="utf-8")
|
||||
|
||||
return dict(re.findall(VERSION_REGEX, constraint_file_text))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user