From 78ee7f9cadb8132a7d3b160e69fd91d5dd42aa41 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Fri, 4 Sep 2026 15:54:01 +0100 Subject: [PATCH 1/9] ci: bump all non-ISARIC actions to latest release commit SHAs --- .github/workflows/build.yaml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/test.yml | 18 +++++++++--------- .github/workflows/validate-project-outputs.yml | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0c3fac1..81438bc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up environment for CI run: | diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 698a422..b99bd5b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Assume AWS IAM Role uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f9c0b50..8bdc556 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: "3.11" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe83123..a39efa3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: "3.11" @@ -42,10 +42,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: "3.11" @@ -70,7 +70,7 @@ jobs: --cov-report=xml - name: Upload coverage.xml artifact - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: coverage-xml path: coverage.xml @@ -78,7 +78,7 @@ jobs: - name: Upload coverage report to Codecov (best effort) continue-on-error: true - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f with: files: ./coverage.xml token: ${{ secrets.CODECOV_TOKEN }} @@ -91,10 +91,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: "3.11" @@ -116,7 +116,7 @@ jobs: - name: Upload Playwright artifacts on failure if: failure() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: name: playwright-artifacts path: test-results/playwright diff --git a/.github/workflows/validate-project-outputs.yml b/.github/workflows/validate-project-outputs.yml index d54996c..78acf8c 100644 --- a/.github/workflows/validate-project-outputs.yml +++ b/.github/workflows/validate-project-outputs.yml @@ -32,10 +32,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: python-version: "3.11" From 735d93e6011b32e2005dc1f3d083bd6bdb508395 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 10:52:40 +0100 Subject: [PATCH 2/9] add Makefile and use Makefile targets to tidy up workflows --- .../workflows/{lint.yml => pre-commit.yml} | 7 +- .github/workflows/test.yml | 27 +--- Makefile | 123 ++++++++++++++++++ pyproject.toml | 1 + tests/unit/test_analysis_project_validator.py | 4 + tests/unit/test_callbacks.py | 2 + tests/unit/test_descriptive_analytics.py | 0 tests/unit/test_io.py | 2 + tests/unit/test_legacy_module_shims.py | 2 + tests/unit/test_map_filters.py | 3 + tests/unit/test_prebuilt_project_loading.py | 2 + tests/unit/test_project_access.py | 4 + tests/unit/test_project_contracts.py | 4 + tests/unit/test_project_ingestion.py | 3 + tests/unit/test_project_output_validator.py | 4 + tests/unit/test_roundtrip_layout.py | 3 + tests/unit/test_static_loading.py | 4 + 17 files changed, 170 insertions(+), 25 deletions(-) rename .github/workflows/{lint.yml => pre-commit.yml} (78%) create mode 100644 Makefile delete mode 100644 tests/unit/test_descriptive_analytics.py diff --git a/.github/workflows/lint.yml b/.github/workflows/pre-commit.yml similarity index 78% rename from .github/workflows/lint.yml rename to .github/workflows/pre-commit.yml index 8bdc556..5556d4c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/pre-commit.yml @@ -18,10 +18,7 @@ jobs: with: python-version: "3.11" - - name: Install pre-commit - run: | - pip install pre-commit - - name: Run pre-commit hooks run: | - pre-commit run --all-files + python3 -m pip install pre-commit + make pre-commit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a39efa3..79b3b51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,23 +51,14 @@ jobs: - name: Install project and unit test dependencies run: | - python -m pip install --upgrade pip - pip install -e ".[test]" + python -m pip install uv + make sync-deps-exact - - name: Run pytest with coverage + - name: Run unit tests and measure code coverage env: PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1" run: | - python -m pytest \ - -m "not e2e" \ - --ignore=tests/frontend-smoke/ \ - --code-highlight=yes \ - --color=yes \ - --verbosity=3 \ - -p pytest_cov \ - --cov=vertex \ - --cov-report=term-missing \ - --cov-report=xml + make test MARKER="unit" TESTS_PATH=tests/unit - name: Upload coverage.xml artifact uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a @@ -100,19 +91,15 @@ jobs: - name: Install frontend smoke test dependencies run: | - python -m pip install --upgrade pip - pip install -e ".[frontend-smoke-tests]" + python -m pip install uv + make sync-deps-exact - name: Run frontend smoke tests env: PLAYWRIGHT_ARTIFACTS_DIR: test-results/playwright PYTEST_DISABLE_PLUGIN_AUTOLOAD: "1" run: | - python -m pytest \ - --code-highlight=yes \ - --color=yes \ - --verbosity=3 \ - tests/frontend-smoke/test_playwright_smoke.py + make test MARKER="e2e" TESTS_PATH=tests/frontend-smoke - name: Upload Playwright artifacts on failure if: failure() diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d2228ce --- /dev/null +++ b/Makefile @@ -0,0 +1,123 @@ +SHELL := /bin/bash + +REPO := https://github.com/ISARICResearch/VERTEX + +PACKAGE_NAME := vertex +BRANCH := $(shell git rev-parse --abbrev-ref HEAD) +HEAD := $(shell git rev-parse --short=8 HEAD) +PACKAGE_VERSION := $(shell grep __version__ vertex/__init__.py | cut -d '=' -f 2 | xargs) + +PROJECT_ROOT := $(PWD) + +TESTS_ROOT := $(PROJECT_ROOT)/tests + +DOCS_ROOT := $(PROJECT_ROOT)/docs +DOCS_BUILD := $(DOCS_ROOT)/_build +DOCS_BUILD_HTML := $(DOCS_ROOT)/_build/html + + +# --- Git --- +# +# Git staging +git-stage: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Staging new, modified, deleted and/or renamed files in Git" + git status -uno | grep modified | tr -s ' ' | cut -d ' ' -f 2 | xargs git add && \ + git status -uno | grep deleted | tr -s ' ' | cut -d ' ' -f 2 | xargs git add -A && \ + git status -uno + +# --- Housekeeping --- +.PHONY: clean +clean: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Deleting all temporary files" + rm -fr dist/* docs/_build/* .pytest_cache *.pyc *__pycache__* ./dist/* ./build/* *.egg-info* + python3 -m pip uninstall -y isaric-vertex + +# --- Version commands --- +# +# A simple file-based version check for the installed package (local, sdist or wheel) +version-check: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Checking installed package version (if it is installed)" + python3 -c "import os; os.chdir('src/arc'); from __init__ import __version__; print(__version__); os.chdir('../')" + +# Just display the version +version-extract: + echo "$(PACKAGE_VERSION)" + +# --- Member inspection of Python files --- +# +# Parameterised command to lexicographically list all callables (functions, +# classes) in path-specified Python modules including: +# +# functions: +# +# list-members MEMBER_REGEX="def" FILE_PATH="/path/to/py/file" +# +# classes: +# +# list-members MEMBER_REGEX="class" FILE_PATH="/path/to/py/file" +# +# functions or classes (inclusive): +# +# list-members MEMBER_REGEX="def\|class" FILE_PATH="/path/to/py/file" +# +# where the '|' represents an OR operator for grep that needs to be escaped with the backslash '\'. +list-callables: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Lexicographical isting of all callable members ($(MEMBER_REGEX)) of a Python file" + grep "$(MEMBER_REGEX)" $(FILE_PATH) | sort | cut -d ' ' -f 2 | cut -d '(' -f 1 + +# --- Dependency management --- +sync-deps-exact: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Syncing all package + development dependencies with lockfile, removing unrelated dependencies" + rm -f uv.lock && \ + uv sync --verbose --active --all-groups --no-install-project --no-cache --refresh + +sync-deps-inexact: + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Syncing all package + development dependencies with lockfile, preserving unrelated dependencies" + rm -f uv.lock && \ + uv sync --verbose --active --all-groups --no-install-project --no-cache --refresh --inexact + +# --- Package artifacts --- +# +# Only source distributions are required, no wheel. +.PHONY: sdist +sdist: clean + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Building a source distribution of VERTEX" + uv build --verbose --sdist && ls -al dist/*.tar.gz + +.PHONE: uninstall +uninstall: clean + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Uninstalling any existing installed VERTEX distribution" + +# --- Documentation --- +.PHONY: clean +docs: clean + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Building Sphinx docs" + make -C docs html + +# --- Pre-commit --- +.PHONY: clean +pre-commit: clean + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Running pre-commit hooks" + pre-commit run --all-files + +# --- Tests --- +# +# Unit tests - use the `MARKER` variable to indicate markers, e.g. +# "critical or high", or "medium or low". Note that in the `test` target +# command below, the `MARKER` variable must be quoted to prevent expansion +# in case of spaces in the marker. +.PHONY: test +test: clean + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Running unit tests + measuring coverage" + PYTHONPATH=src uv run --verbose --active pytest \ + -q -m "$(MARKER)" \ + --cache-clear \ + --capture=no \ + --code-highlight=yes \ + --color=yes \ + --cov=src \ + --cov-report=term-missing:skip-covered \ + -ra \ + --tb=native \ + --verbosity=3 \ + $(TESTS_PATH) diff --git a/pyproject.toml b/pyproject.toml index 449315c..f077631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -146,4 +146,5 @@ testpaths = ["tests"] addopts = "-ra" markers = [ "e2e: browser-based end-to-end smoke tests", + "unit", ] diff --git a/tests/unit/test_analysis_project_validator.py b/tests/unit/test_analysis_project_validator.py index 63a2d9f..a8b3175 100644 --- a/tests/unit/test_analysis_project_validator.py +++ b/tests/unit/test_analysis_project_validator.py @@ -3,6 +3,10 @@ import sys from pathlib import Path +import pytest + +pytestmark = pytest.mark.unit + def _load_validator_module(): module_path = Path(".github/actions/validate-analysis-projects/validate_analysis_projects.py") diff --git a/tests/unit/test_callbacks.py b/tests/unit/test_callbacks.py index 7f9e5c9..1ba891f 100644 --- a/tests/unit/test_callbacks.py +++ b/tests/unit/test_callbacks.py @@ -8,6 +8,8 @@ from vertex import descriptive_dashboard as dashboard +pytestmark = pytest.mark.unit + @pytest.fixture def app_context(): diff --git a/tests/unit/test_descriptive_analytics.py b/tests/unit/test_descriptive_analytics.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/unit/test_io.py b/tests/unit/test_io.py index 42512c1..c05f396 100644 --- a/tests/unit/test_io.py +++ b/tests/unit/test_io.py @@ -6,6 +6,8 @@ from vertex import descriptive_dashboard as dashboard from vertex import io as vertex_io +pytestmark = pytest.mark.unit + @pytest.mark.parametrize( ("value", "expected"), diff --git a/tests/unit/test_legacy_module_shims.py b/tests/unit/test_legacy_module_shims.py index 27addf9..aa5eb01 100644 --- a/tests/unit/test_legacy_module_shims.py +++ b/tests/unit/test_legacy_module_shims.py @@ -3,6 +3,8 @@ import pytest +pytestmark = pytest.mark.unit + @pytest.mark.parametrize( ("legacy_module", "target_module", "exported_name"), diff --git a/tests/unit/test_map_filters.py b/tests/unit/test_map_filters.py index 8904c0c..3fcb51a 100644 --- a/tests/unit/test_map_filters.py +++ b/tests/unit/test_map_filters.py @@ -1,8 +1,11 @@ import pandas as pd +import pytest from vertex.layout.filters import get_filter_options from vertex.map import filter_df_map +pytestmark = pytest.mark.unit + def test_filter_df_map_applies_expected_filters(): df_map = pd.DataFrame( diff --git a/tests/unit/test_prebuilt_project_loading.py b/tests/unit/test_prebuilt_project_loading.py index a032a1c..b73b670 100644 --- a/tests/unit/test_prebuilt_project_loading.py +++ b/tests/unit/test_prebuilt_project_loading.py @@ -2,6 +2,8 @@ from vertex import descriptive_dashboard as dashboard +pytestmark = pytest.mark.unit + @pytest.fixture(autouse=True) def clear_project_cache(): diff --git a/tests/unit/test_project_access.py b/tests/unit/test_project_access.py index 79011d5..d17397f 100644 --- a/tests/unit/test_project_access.py +++ b/tests/unit/test_project_access.py @@ -1,5 +1,9 @@ +import pytest + from vertex.project_access import is_project_visible +pytestmark = pytest.mark.unit + def _base_project(is_public=False): return { diff --git a/tests/unit/test_project_contracts.py b/tests/unit/test_project_contracts.py index 88842c2..4ed6296 100644 --- a/tests/unit/test_project_contracts.py +++ b/tests/unit/test_project_contracts.py @@ -2,6 +2,10 @@ from pathlib import Path from typing import Optional +import pytest + +pytestmark = pytest.mark.unit + def _load_json(path: Path): return json.loads(path.read_text()) diff --git a/tests/unit/test_project_ingestion.py b/tests/unit/test_project_ingestion.py index c2e46c4..477aa57 100644 --- a/tests/unit/test_project_ingestion.py +++ b/tests/unit/test_project_ingestion.py @@ -1,11 +1,14 @@ import json from pathlib import Path +import pytest from sqlalchemy import Boolean, Column, DateTime, Integer, MetaData, String, Table, UniqueConstraint, create_engine, select from sqlalchemy.orm import Session from vertex.project_ingestion import ingest_static_projects +pytestmark = pytest.mark.unit + def _write_project(root: Path, folder: str, project_id: str, name: str, owner: str, is_public: bool = True): project_dir = root / folder diff --git a/tests/unit/test_project_output_validator.py b/tests/unit/test_project_output_validator.py index 2e86443..92f7277 100644 --- a/tests/unit/test_project_output_validator.py +++ b/tests/unit/test_project_output_validator.py @@ -3,6 +3,10 @@ import sys from pathlib import Path +import pytest + +pytestmark = pytest.mark.unit + def _load_validator_module(): module_path = Path(".github/actions/validate-project-outputs/validate_project_outputs.py") diff --git a/tests/unit/test_roundtrip_layout.py b/tests/unit/test_roundtrip_layout.py index b20db28..9831cde 100644 --- a/tests/unit/test_roundtrip_layout.py +++ b/tests/unit/test_roundtrip_layout.py @@ -1,9 +1,12 @@ import json +import pytest from dash import html from vertex import descriptive_dashboard as dashboard +pytestmark = pytest.mark.unit + def _write_roundtrip_panel(project_dir): panel_code = """ diff --git a/tests/unit/test_static_loading.py b/tests/unit/test_static_loading.py index 3fc562b..5c3009c 100644 --- a/tests/unit/test_static_loading.py +++ b/tests/unit/test_static_loading.py @@ -1,6 +1,10 @@ +import pytest + from vertex.io import load_public_dashboard from vertex.layout.insight_panels import get_public_visuals +pytestmark = pytest.mark.unit + def test_load_public_dashboard_reads_default_file(prebuilt_project_factory): project_dir = prebuilt_project_factory() From 59736d36d3684af2875d5ed9e2ba5c11f6ec4ca1 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 10:59:59 +0100 Subject: [PATCH 3/9] Add UV tool section in project TOML --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f077631..35ae2d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,6 +116,9 @@ docs = [ "jupyter-sphinx" ] +[tool.uv] + default-groups = "all" + [project.scripts] run-vertex = "descriptive_dashboard:main" vertex-cli = "vertex.cli:vertex_cli" From f7f758df314b426d866aacecc10e58ca6b3967d1 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 14:13:34 +0100 Subject: [PATCH 4/9] Fixes and improvements in the Makefile, test workflow and project TOML --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/test.yml | 8 ++++---- Dockerfile | 2 +- Makefile | 30 +++++++++++++++--------------- docs/index.rst | 6 +++--- docs/sources/getting-started.rst | 2 +- pyproject.toml | 10 ++++++---- 7 files changed, 31 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5556d4c..dcde9ec 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: - python-version: "3.11" + python-version: "3.12" - name: Run pre-commit hooks run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79b3b51..bd62101 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: - python-version: "3.11" + python-version: "3.12" - name: Validate analysis project schema uses: ./.github/actions/validate-analysis-projects @@ -47,11 +47,11 @@ jobs: - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: - python-version: "3.11" + python-version: "3.12" - name: Install project and unit test dependencies run: | - python -m pip install uv + python3 -m pip install uv make sync-deps-exact - name: Run unit tests and measure code coverage @@ -87,7 +87,7 @@ jobs: - name: Set up Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 with: - python-version: "3.11" + python-version: "3.12" - name: Install frontend smoke test dependencies run: | diff --git a/Dockerfile b/Dockerfile index 3d96127..ff08d95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.12-slim # Set the working directory WORKDIR /app diff --git a/Makefile b/Makefile index d2228ce..c8b81e4 100644 --- a/Makefile +++ b/Makefile @@ -69,12 +69,12 @@ list-callables: sync-deps-exact: @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Syncing all package + development dependencies with lockfile, removing unrelated dependencies" rm -f uv.lock && \ - uv sync --verbose --active --all-groups --no-install-project --no-cache --refresh + uv sync --verbose --all-groups --no-editable --no-install-project --no-cache --refresh --no-managed-python sync-deps-inexact: @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Syncing all package + development dependencies with lockfile, preserving unrelated dependencies" rm -f uv.lock && \ - uv sync --verbose --active --all-groups --no-install-project --no-cache --refresh --inexact + uv sync --verbose --all-groups --no-editable --no-install-project --no-cache --refresh --inexact # --- Package artifacts --- # @@ -91,7 +91,7 @@ uninstall: clean # --- Documentation --- .PHONY: clean docs: clean - @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Building Sphinx docs" + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Building Sphinx docs (using the Sphinx Makefile in ./docs/)" make -C docs html # --- Pre-commit --- @@ -109,15 +109,15 @@ pre-commit: clean .PHONY: test test: clean @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Running unit tests + measuring coverage" - PYTHONPATH=src uv run --verbose --active pytest \ - -q -m "$(MARKER)" \ - --cache-clear \ - --capture=no \ - --code-highlight=yes \ - --color=yes \ - --cov=src \ - --cov-report=term-missing:skip-covered \ - -ra \ - --tb=native \ - --verbosity=3 \ - $(TESTS_PATH) + PYTHONPATH=src uv run --verbose --active -m pytest \ + -q -m "$(MARKER)" \ + --cache-clear \ + --capture=no \ + --code-highlight=yes \ + --color=yes \ + --cov=src \ + --cov-report=term-missing:skip-covered \ + -ra \ + --tb=native \ + --verbosity=3 \ + $(TESTS_PATH) diff --git a/docs/index.rst b/docs/index.rst index ef02759..3bc946f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,12 +23,12 @@ VERTEX processes and visualizes data using the concept of **Reproducible Analyti See the :doc:`quickstart guide ` to start using VERTEX, and the linked pages below for more information on features and code. -VERTEX is licensed under the `Open Source Initiative (OSI) `_-compliant `MIT license `_. +VERTEX is licensed under the `MIT license `_. .. image:: _static/osi-badge-light.svg :target: https://opensource.org/license/mit - :height: 200px - :width: 200px + :height: 100px + :width: 100px .. toctree:: :maxdepth: 1 diff --git a/docs/sources/getting-started.rst b/docs/sources/getting-started.rst index 4af9c5a..4a81e7c 100644 --- a/docs/sources/getting-started.rst +++ b/docs/sources/getting-started.rst @@ -13,7 +13,7 @@ VERTEX is essentially an app, and there is a `public version `_. If you're running VERTEX locally :doc:`in Docker ` then these dependencies (and their sub-dependencies) will be pre-installed inside the container, so no direct user installation is required. diff --git a/pyproject.toml b/pyproject.toml index 35ae2d1..612e3e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ maintainers = [ ] readme = "README.md" -requires-python = ">=3.11" +requires-python = ">=3.12" license = { file = "LICENSE.md" } # These keywords have been taken from the available ISARIC documentation, @@ -81,7 +81,7 @@ dependencies = [ "cryptography>=46.0.7", ] -[project.optional-dependencies] +[dependency-groups] # Deps specific to the pre-commit checks pre-commit = [ "pre-commit", @@ -116,6 +116,8 @@ docs = [ "jupyter-sphinx" ] +[project.optional-dependencies] + [tool.uv] default-groups = "all" @@ -129,7 +131,7 @@ version = {attr = "vertex.__version__"} [tool.ruff] line-length = 128 -target-version = "py311" +target-version = "py312" lint.select = ["E", "F", "W", "I"] # pycodestyle, pyflakes, warnings, import sorting @@ -149,5 +151,5 @@ testpaths = ["tests"] addopts = "-ra" markers = [ "e2e: browser-based end-to-end smoke tests", - "unit", + "unit: unit tests", ] From 2c1d40f84133ff674083a41356ecf4cac7ff4aef Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 14:45:57 +0100 Subject: [PATCH 5/9] Further fixes in the Makefile and project TOML --- Makefile | 3 ++- pyproject.toml | 35 ++++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c8b81e4..7799736 100644 --- a/Makefile +++ b/Makefile @@ -110,12 +110,13 @@ pre-commit: clean test: clean @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Running unit tests + measuring coverage" PYTHONPATH=src uv run --verbose --active -m pytest \ + -p pytest_cov \ -q -m "$(MARKER)" \ --cache-clear \ --capture=no \ --code-highlight=yes \ --color=yes \ - --cov=src \ + --cov=vertex \ --cov-report=term-missing:skip-covered \ -ra \ --tb=native \ diff --git a/pyproject.toml b/pyproject.toml index 612e3e2..fdf309a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ pre-commit = [ # Deps specific to the unit tests test = [ "pytest>=8.0", - "pytest-cov>=5.0", + "pytest-cov>=7.1.0", ] # Deps specific to the frontend smoke tests @@ -147,9 +147,30 @@ quote-style = "double" indent-style = "space" [tool.pytest.ini_options] -testpaths = ["tests"] -addopts = "-ra" -markers = [ - "e2e: browser-based end-to-end smoke tests", - "unit: unit tests", -] + pythonpath = "vertex" + addopts = """\ + -p pytest_cov \ + --cache-clear \ + --capture=no \ + --code-highlight=yes \ + --color=yes \ + --cov=vertex \ + --cov-config=pyproject.toml \ + --cov-report=term-missing:skip-covered \ + -ra \ + --tb=native \ + --verbosity=3 \ + """ + filterwarnings = [ + "ignore::DeprecationWarning" + ] + python_files = ["test_*.py",] + python_classes = ["Test",] + python_functions = ["test"] + testpaths = [ + "tests/", + ] + markers = [ + "e2e: browser-based end-to-end smoke tests", + "unit: unit tests", + ] From 0879f1aea9d780ee73ffab7c0f593349d4cd0ea6 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 15:15:58 +0100 Subject: [PATCH 6/9] Pytest options fixes and additions in the Makefile and project TOML --- Makefile | 2 ++ pyproject.toml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 7799736..ef31c0e 100644 --- a/Makefile +++ b/Makefile @@ -118,6 +118,8 @@ test: clean --color=yes \ --cov=vertex \ --cov-report=term-missing:skip-covered \ + --cov-report=xml \ + --cov-report=html \ -ra \ --tb=native \ --verbosity=3 \ diff --git a/pyproject.toml b/pyproject.toml index fdf309a..e7f35de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,6 +156,8 @@ indent-style = "space" --color=yes \ --cov=vertex \ --cov-config=pyproject.toml \ + --cov-report=xml \ + --cov-report=html \ --cov-report=term-missing:skip-covered \ -ra \ --tb=native \ From 168d8eb5dabe384c90dba05eb8c2aa222b635bd0 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 15:17:11 +0100 Subject: [PATCH 7/9] Tweak Makefile UV sync deps targets --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef31c0e..5098969 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ sync-deps-exact: sync-deps-inexact: @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Syncing all package + development dependencies with lockfile, preserving unrelated dependencies" rm -f uv.lock && \ - uv sync --verbose --all-groups --no-editable --no-install-project --no-cache --refresh --inexact + uv sync --verbose --all-groups --no-editable --no-install-project --no-cache --refresh --inexact --no-managed-python # --- Package artifacts --- # From 8ebadea94934ccd07e4c832e23a78b1bd165e1a4 Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 15:39:47 +0100 Subject: [PATCH 8/9] Makefile tweaks --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 5098969..b217a84 100644 --- a/Makefile +++ b/Makefile @@ -34,14 +34,9 @@ clean: # --- Version commands --- # -# A simple file-based version check for the installed package (local, sdist or wheel) -version-check: - @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Checking installed package version (if it is installed)" - python3 -c "import os; os.chdir('src/arc'); from __init__ import __version__; print(__version__); os.chdir('../')" - # Just display the version version-extract: - echo "$(PACKAGE_VERSION)" + @echo "$(PACKAGE_VERSION)" # --- Member inspection of Python files --- # @@ -62,7 +57,7 @@ version-extract: # # where the '|' represents an OR operator for grep that needs to be escaped with the backslash '\'. list-callables: - @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Lexicographical isting of all callable members ($(MEMBER_REGEX)) of a Python file" + @echo "$(PACKAGE_NAME)[$(BRANCH)@$(HEAD)]: Lexicographical listing of all callable members ($(MEMBER_REGEX)) of a Python file" grep "$(MEMBER_REGEX)" $(FILE_PATH) | sort | cut -d ' ' -f 2 | cut -d '(' -f 1 # --- Dependency management --- From f868a32f3006cd01dab7948f1ca8871fc952f44e Mon Sep 17 00:00:00 2001 From: Sandeep Murthy Date: Mon, 7 Sep 2026 15:50:11 +0100 Subject: [PATCH 9/9] RTD YML fix for installing deps via UV --- .readthedocs.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 854f39a..899d685 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -38,7 +38,7 @@ sphinx: python: install: - - method: pip - path: . - extra_requirements: + - method: uv + command: sync + groups: - docs