From 533c122fb5377bdff3b3755505be6b12290d43a9 Mon Sep 17 00:00:00 2001 From: JamzumSum Date: Mon, 3 Oct 2022 22:17:27 +0800 Subject: [PATCH] fix(script)!: 'CN' is choosed as the cls_name --- .github/workflows/test-pub.yml | 2 +- pyproject.toml | 2 +- src/genstub.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-pub.yml b/.github/workflows/test-pub.yml index 6205426..577fef8 100644 --- a/.github/workflows/test-pub.yml +++ b/.github/workflows/test-pub.yml @@ -3,7 +3,7 @@ name: Test, Build and Publish on: push: paths: - - "src/yacs_stubgen/**" + - "src/**" - "poetry.lock" - ".github/workflows/test-pub.yml" diff --git a/pyproject.toml b/pyproject.toml index 0203fd2..0399f7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "yacs-stubgen" -version = "0.2.0" +version = "0.2.1" description = "Generate stub file for yacs config." authors = ["JamzumSum "] license = "MIT" diff --git a/src/genstub.py b/src/genstub.py index 63131cd..2c633f9 100644 --- a/src/genstub.py +++ b/src/genstub.py @@ -33,7 +33,7 @@ def inspect_module(mod_path: Path, ROOT: Path): cfg = v varname = k elif isinstance(v, type): - if issubclass(v, CfgNode): + if k != "CN" and issubclass(v, CfgNode): clsname = k if clsname and varname: break