Skip to content

Commit 389c2e6

Browse files
committed
fixed mypy issues
1 parent 34de26c commit 389c2e6

5 files changed

Lines changed: 25 additions & 21 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ A simple and minimalistic Config Manager using YAML.
77
[![Tests](https://github.com/felixscode/heracless/actions/workflows/test.yml/badge.svg)](https://github.com/felixscode/heracless/actions/workflows/test.yml)
88
[![Publish](https://github.com/felixscode/heracless/actions/workflows/publish.yml/badge.svg)](https://github.com/felixscode/heracless/actions/workflows/publish.yml)
99
[![codecov](https://codecov.io/gh/felixscode/heracless/branch/main/graph/badge.svg)](https://codecov.io/gh/felixscode/heracless)
10+
[![mypy](https://img.shields.io/badge/mypy-checked-blue)](http://mypy-lang.org/)
1011
[![Python Version](https://img.shields.io/pypi/pyversions/heracless)](https://pypi.org/project/heracless/)
1112
[![PyPI version](https://badge.fury.io/py/heracless.svg)](https://badge.fury.io/py/heracless)
1213
[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/felixscode/heracless)

heracless/utils/cfg_tree.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def tree_builder(obj_type: Type[Node], name: str, value: Union[Value, Iterable])
152152

153153
iterables = iterable_generator(value, name)
154154
# Handle empty iterables (e.g., empty dict)
155+
children: tuple[Union[Node, Tree], ...]
155156
if not iterables:
156157
children = tuple()
157158
else:

heracless/wapp/pages/ConfigGenerator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from pathlib import Path
2+
13
import streamlit as st
24
from streamlit_ace import st_ace
35
from streamlit_ace import THEMES
@@ -28,7 +30,7 @@
2830
)
2931
if st.button("Generate ⚡"):
3032
if is_valid_yaml(content):
31-
stub_string, template_str = get_file_content(content, config_dir, frozen)
33+
stub_string, template_str = get_file_content(content, Path(config_dir), frozen)
3234
st.write("### Python Stub File")
3335
st.code(stub_string, language="python", line_numbers=True)
3436
download_button(label="Download 📥", data=stub_string, file_name=load_file_name.split(".")[0] + ".pyi")

tests/config/types.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ from pathlib import Path
55

66

77
@dataclass(frozen=True)
8-
class Address:
9-
lines: str
10-
city: str
11-
state: str
12-
postal: int
8+
class ShipTo:
9+
given: str
10+
family: str
11+
address: "Address"
1312

1413

1514
@dataclass(frozen=True)
@@ -33,14 +32,15 @@ class ProductItem:
3332

3433

3534
@dataclass(frozen=True)
36-
class BillTo:
37-
given: str
38-
family: str
39-
address: "Address"
35+
class Address:
36+
lines: str
37+
city: str
38+
state: str
39+
postal: int
4040

4141

4242
@dataclass(frozen=True)
43-
class ShipTo:
43+
class BillTo:
4444
given: str
4545
family: str
4646
address: "Address"

tests/conftest.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ from pathlib import Path
55

66

77
@dataclass(frozen=True)
8-
class Address:
9-
lines: str
10-
city: str
11-
state: str
12-
postal: int
8+
class ShipTo:
9+
given: str
10+
family: str
11+
address: "Address"
1312

1413

1514
@dataclass(frozen=True)
@@ -33,14 +32,15 @@ class ProductItem:
3332

3433

3534
@dataclass(frozen=True)
36-
class BillTo:
37-
given: str
38-
family: str
39-
address: "Address"
35+
class Address:
36+
lines: str
37+
city: str
38+
state: str
39+
postal: int
4040

4141

4242
@dataclass(frozen=True)
43-
class ShipTo:
43+
class BillTo:
4444
given: str
4545
family: str
4646
address: "Address"

0 commit comments

Comments
 (0)