Skip to content

Commit

Permalink
linter fix for py3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
danwos committed May 3, 2023
1 parent 73ca7eb commit b8b762f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sphinx_needs/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import wraps
from pathlib import Path
from timeit import default_timer as timer # Used for timing measurements
from typing import Any, Callable, Dict, Optional
from typing import Any, Callable, Dict, List, Optional

from jinja2 import Environment, PackageLoader, select_autoescape
from sphinx.application import Sphinx
Expand All @@ -16,7 +16,7 @@


def measure_time(
category: str | None = None, source: str = "internal", name: str | None = None, func: object | None = None
category: "str | None" = None, source: str = "internal", name: "str | None" = None, func: "object | None" = None
) -> Callable[..., Callable[..., Any]]:
"""
Measures the needed execution time of a specific function.
Expand Down Expand Up @@ -56,7 +56,7 @@ def my_cool_function(a, b,c ):

def inner(func: Any) -> Callable[..., Any]:
@wraps(func)
def wrapper(*args: list[object], **kwargs: dict[object, object]) -> Any:
def wrapper(*args: List[object], **kwargs: Dict[object, object]) -> Any:
"""
Wrapper function around a given/decorated function, which cares about measurement and storing the result
Expand Down Expand Up @@ -134,7 +134,7 @@ def print_timing_results() -> None:
print(f' min: {value["min"]:2f} \n')


def store_timing_results_json(outdir: str, build_data: dict[str, Any]) -> None:
def store_timing_results_json(outdir: str, build_data: Dict[str, Any]) -> None:
json_result_path = os.path.join(outdir, "debug_measurement.json")

data = {"build": build_data, "measurements": TIME_MEASUREMENTS}
Expand All @@ -144,7 +144,7 @@ def store_timing_results_json(outdir: str, build_data: dict[str, Any]) -> None:
print(f"Timing measurement results (JSON) stored under {json_result_path}")


def store_timing_results_html(outdir: str, build_data: dict[str, Any]) -> None:
def store_timing_results_html(outdir: str, build_data: Dict[str, Any]) -> None:
jinja_env = Environment(loader=PackageLoader("sphinx_needs"), autoescape=select_autoescape())
template = jinja_env.get_template("time_measurements.html")
out_file = Path(outdir) / "debug_measurement.html"
Expand Down

0 comments on commit b8b762f

Please sign in to comment.