From 7bfa67b138737106cf04b7e5c8bf3fca1becbe10 Mon Sep 17 00:00:00 2001 From: shaoyijia Date: Sun, 22 Sep 2024 23:30:16 -0700 Subject: [PATCH] Enforce checking of python package version. --- .github/workflows/python-package.yml | 11 +++++++++++ knowledge_storm/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index fa4cf56e..2ec48d8d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,6 +14,17 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.11" + - name: Compare versions in setup.py and knowledge_storm/__init__.py + run: | + VERSION_SETUP=$(grep -oP '(?<=version=\").*(?=\")' setup.py) + VERSION_INIT=$(grep -oP '(?<=__version__ = \").*(?=\")' knowledge_storm/__init__.py) + echo "Version in setup.py: $VERSION_SETUP" + echo "Version in __init__.py: $VERSION_INIT" + if [ "$VERSION_SETUP" != "$VERSION_INIT" ]; then + echo "Error: Version mismatch between setup.py ($VERSION_SETUP) and knowledge_storm/__init__.py ($VERSION_INIT)" + exit 1 + fi + shell: bash - name: Install dependencies run: python3 -m pip install setuptools wheel twine - name: Install dependencies diff --git a/knowledge_storm/__init__.py b/knowledge_storm/__init__.py index e862724e..b142a586 100644 --- a/knowledge_storm/__init__.py +++ b/knowledge_storm/__init__.py @@ -4,4 +4,4 @@ STORMWikiRunner, ) -__version__ = "0.2.5" +__version__ = "0.2.7" diff --git a/setup.py b/setup.py index 6b562cd8..633ce785 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name="knowledge-storm", - version="0.2.6", + version="0.2.7", author="Yijia Shao, Yucheng Jiang", author_email="shaoyj@stanford.edu, yuchengj@stanford.edu", description="STORM: A language model-powered knowledge curation engine.",