Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneJiang committed Aug 22, 2023
1 parent 98ebee0 commit 6719c80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/actions_scripts/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,21 @@ def check_module(module_name: str) -> bool:
"""Check module name."""
import importlib
if module_name == "null":
print("module_name is null")# noqa: T201
return False
if "-" in module_name:
print("module_name contains '-'")# noqa: T201
return False
try:
importlib.invalidate_caches()
module = importlib.import_module(module_name)
importlib.reload(module)
print(f"module_name: {module_name}")# noqa: T201
except Exception: # noqa: BLE001
print("module_name is invalid")# noqa: T201
return False
else:
print("module_name is valid")# noqa: T201
return True

def parse_title(title: str) -> dict[str, Any]:
Expand All @@ -65,6 +70,7 @@ def main() -> None:
pypi_name = os.environ["PYPI_NAME"]
module_name = os.environ["MODULE_NAME"]
try:
print(f"module_name: {module_name}")# noqa: T201
if check_module(module_name) is False:
set_action_outputs({"result": "error", "output": "输入的module_name存在问题"})
return
Expand Down

0 comments on commit 6719c80

Please sign in to comment.