Skip to content

Commit

Permalink
fix typing in generete-pyi (#1661)
Browse files Browse the repository at this point in the history
use stefanzweifel/git-auto-commit-action v5 (that uses node.js 20)

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
  • Loading branch information
FredLL-Avaiga and Fred Lefévère-Laoide authored Aug 12, 2024
1 parent b07eab2 commit b126c80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: '*/version.json'
commit_message: Update version to ${{ needs.fetch-versions.outputs.NEW_VERSION }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-config-pyi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
python-version: '3.11'
- name: Update config.pyi
run: python taipy/config/stubs/generate_pyi.py
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update config.pyi"
8 changes: 4 additions & 4 deletions tools/gui/generate_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import os
import re
import sys
from typing import Any, List
from typing import Any, Dict, List

from markdownify import markdownify

Expand Down Expand Up @@ -79,7 +79,7 @@
file.write("from ._element import _Block, _Control, _Element\n")


def resolve_inherit(name: str, properties, inherits, viselements) -> List[dict[str, Any]]:
def resolve_inherit(name: str, properties, inherits, viselements) -> List[Dict[str, Any]]:
if not inherits:
return properties
for inherit_name in inherits:
Expand Down Expand Up @@ -137,7 +137,7 @@ def format_as_parameter(property):
return f"{property['name']}{type}{default_value}"


def build_doc(name: str, desc: dict[str, Any]):
def build_doc(name: str, desc: Dict[str, Any]):
if "doc" not in desc:
return ""
doc = str(desc["doc"])
Expand Down Expand Up @@ -166,7 +166,7 @@ def generate_elements(category: str, base_class: str):
name = element[0]
desc = element[1]
properties_doc = ""
property_list: List[dict[str, Any]] = []
property_list: List[Dict[str, Any]] = []
property_names: List[str] = []
properties = resolve_inherit(name, desc["properties"], desc.get("inherits", None), viselements)
# Remove hidden properties and indexed properties (TODO?)
Expand Down

0 comments on commit b126c80

Please sign in to comment.