From a05bc3c43ddcf6d60275583411cb765bfef81e87 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 13:51:22 -0800 Subject: [PATCH 1/6] add workflow for testing cli commands --- .github/workflows/pytest.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 00000000..3ca539dc --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,27 @@ +name: Python Tests + +on: + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install pytest + + - name: Run tests + run: | + pytest \ No newline at end of file From 2529c7d29fa633b0f76a7119837420ce7b7b362a Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 14:17:15 -0800 Subject: [PATCH 2/6] use poetry to setup env --- .github/workflows/pytest.yml | 40 ++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 3ca539dc..fb13e941 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,27 +1,41 @@ -name: Python Tests +name: Test Vast CLI with Poetry on: + push: + branches: [ master, main ] pull_request: - branches: [ master ] + branches: [ master, main ] jobs: test: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Install Python + + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.x" - + python-version: "3.12" # or 3.11 if your CLI requires it + + - name: Install Poetry + uses: abatilo/actions-poetry@v3 + with: + poetry-version: "1.8.3" # stable version + + - name: Cache Poetry virtualenv and dependencies + uses: actions/cache@v4 + with: + path: | + .venv + .cache/pypoetry + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e . - pip install pytest - + run: poetry install --no-interaction --no-root + - name: Run tests - run: | - pytest \ No newline at end of file + run: poetry run pytest -v From 68eb32a2b705b44587c7b3062bc03be2eeb86078 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 14:24:18 -0800 Subject: [PATCH 3/6] download same version of pytest --- .github/workflows/pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index fb13e941..6df07a4c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -22,7 +22,7 @@ jobs: - name: Install Poetry uses: abatilo/actions-poetry@v3 with: - poetry-version: "1.8.3" # stable version + poetry-version: "1.7.1" # stable version - name: Cache Poetry virtualenv and dependencies uses: actions/cache@v4 @@ -35,7 +35,7 @@ jobs: ${{ runner.os }}-poetry- - name: Install dependencies - run: poetry install --no-interaction --no-root + run: poetry install --no-interaction - name: Run tests run: poetry run pytest -v From 25850138b93d0c0b098a5bd9f75bc59485081acb Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 14:40:50 -0800 Subject: [PATCH 4/6] remove cache venv --- .github/workflows/pytest.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 6df07a4c..3152b47e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -1,4 +1,4 @@ -name: Test Vast CLI with Poetry +name: Test Vast CLI (PEP 621 + Poetry Backend) on: push: @@ -13,29 +13,27 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" # or 3.11 if your CLI requires it + python-version: "3.12" - - name: Install Poetry - uses: abatilo/actions-poetry@v3 - with: - poetry-version: "1.7.1" # stable version + - name: Install Poetry and plugin + run: | + pip install poetry==1.8.3 poetry-dynamic-versioning[plugin] build - - name: Cache Poetry virtualenv and dependencies - uses: actions/cache@v4 - with: - path: | - .venv - .cache/pypoetry - key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} - restore-keys: | - ${{ runner.os }}-poetry- + - name: Build wheel + run: | + python -m build + ls -l dist/ - - name: Install dependencies - run: poetry install --no-interaction + - name: Install built package + run: | + pip install dist/*.whl + pip install pytest - name: Run tests - run: poetry run pytest -v + run: pytest -v From 104ff7c68ce00232f8cc3cb62dde3f10232220fd Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 14:43:03 -0800 Subject: [PATCH 5/6] add simple test --- tests/test_simple.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/test_simple.py diff --git a/tests/test_simple.py b/tests/test_simple.py new file mode 100644 index 00000000..b5689a74 --- /dev/null +++ b/tests/test_simple.py @@ -0,0 +1,3 @@ +def test_sanity(): + """Basic sanity check""" + assert 1 + 1 == 2 \ No newline at end of file From 36f58b452e0a0673c8737ac89093d8df846a3fd4 Mon Sep 17 00:00:00 2001 From: Zuby Javed Date: Wed, 5 Nov 2025 14:56:40 -0800 Subject: [PATCH 6/6] add init file --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b