Skip to content

Add CI minimal install tests and optional plotting import - #67

Merged
cmungall merged 5 commits into
mainfrom
fix/optional-deps-and-ci-tests
Jan 24, 2026
Merged

Add CI minimal install tests and optional plotting import#67
cmungall merged 5 commits into
mainfrom
fix/optional-deps-and-ci-tests

Conversation

@cmungall

Copy link
Copy Markdown
Member

Summary

Improve release quality and installation experience by:

  1. Adding CI tests for minimal (no extras) installs
  2. Adding pre-flight tests before PyPI release
  3. Making plotting imports optional
  4. Adding ADBC driver to dremio extra for faster queries

Problem

Users running uvx linkml-store --with dremio hit ImportError for matplotlib because:

  • CLI unconditionally imports plotting module
  • No CI tests verify minimal installs work
  • Release workflow publishes without testing

Changes

CI: Add minimal dependency test job

.github/workflows/main.yaml

  • New test-minimal job runs BEFORE full test suite
  • Tests with NO extras installed
  • Verifies linkml-store --help and basic imports work
  • Catches accidental hard dependencies on optional packages

Release: Add pre-flight tests

.github/workflows/pypi-publish.yaml

  • Run critical tests before building wheel
  • Test minimal install viability in fresh venv
  • Prevents broken releases reaching PyPI

CLI: Optional plotting import

src/linkml_store/cli.py

  • Wrap plot_cli import in try/except
  • Only add plot command if matplotlib available
  • Graceful degradation instead of crash

Dependencies: ADBC for Dremio

pyproject.toml

  • Add adbc-driver-flightsql to [dremio] extra
  • Enables faster Arrow Flight SQL with connection caching
  • First query ~10s (connection), subsequent queries ~0.05s

Testing

# Test minimal install locally
uv venv /tmp/test-minimal
source /tmp/test-minimal/bin/activate
pip install -e .  # no extras
linkml-store --help  # should work without matplotlib

Related

Follows up on #66 (Dremio SQL support) by ensuring the new features don't break minimal installs.

🤖 Generated with Claude Code

- Add test-minimal CI job that tests with NO extras installed
- Add pre-flight tests to release workflow before PyPI publish
- Make plotting CLI import optional (graceful degradation)
- Add adbc-driver-flightsql to [dremio] extra for faster queries

This prevents ImportError crashes when running with minimal deps:
  uvx linkml-store --with dremio

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 23, 2026 23:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve the installation experience and release quality by adding CI tests for minimal installs, making plotting imports optional, and adding ADBC driver support for Dremio. The primary motivation is to fix ImportError issues when running uvx linkml-store --with dremio without matplotlib installed.

Changes:

  • Added CI job (test-minimal) to verify minimal installs work without optional dependencies
  • Added pre-flight tests in the release workflow to catch issues before PyPI publication
  • Made the plot CLI command optional by wrapping its import in try/except
  • Added adbc-driver-flightsql to the dremio extra for faster Arrow Flight SQL queries

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/main.yaml Adds test-minimal job to verify core CLI works without optional extras
.github/workflows/pypi-publish.yaml Adds pre-flight tests including minimal install viability checks before PyPI release
src/linkml_store/cli.py Wraps plot_cli import in try/except and conditionally adds plot command
pyproject.toml Adds adbc-driver-flightsql to dremio extra and updates all extra dependencies
uv.lock Updates lock file with ADBC driver packages (version 1.10.0)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
"pyarrow",
"adbc-driver-flightsql",
"matplotlib",
"seaborn",

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "all" extra is missing "plotly" which is included in the "analytics" extra (line 41). Since the "all" extra should include all optional dependencies, it should also include "plotly". This is inconsistent with the analytics extra definition.

Suggested change
"seaborn",
"seaborn",
"plotly",

Copilot uses AI. Check for mistakes.
cmungall and others added 4 commits January 23, 2026 16:31
- Add pytest markers infrastructure for core vs optional tests
- Run CLI tests (except RAG inference) with minimal deps
- Run API tests filtered to DuckDB only (skip mongodb, ibis, dremio)
- Auto-skip tests when optional deps not installed
The test_validation tests require the `linkml` package which is only
available with the `validation` extra. Since test-minimal runs with
no extras to verify core functionality works without optional deps,
these tests must be excluded.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cmungall
cmungall merged commit 1383991 into main Jan 24, 2026
5 checks passed
turbomam added a commit to microbiomedata/nmdc-lakehouse that referenced this pull request Apr 24, 2026
)

* Pin linkml>=1.11.0rc1 and linkml-store>=0.3.1 to fix broken dev env

The previous loose pins on main resolve to linkml 1.10.0 +
linkml-runtime 1.10.0, which is broken on its own: linkml 1.10.0's
__init__ references Format.JSON but linkml-runtime 1.10.0's Format
enum no longer exposes it. Any code that imports linkml (including
uv run linkml-store --help) hits AttributeError: JSON.

linkml 1.11.0rc1 and linkml-runtime 1.11.0rc1 resolve the mismatch.
They're on PyPI as pre-releases; the explicit rc marker in the spec
lets uv resolve them.

linkml-store 0.3.1 (released 2026-04-21) includes
linkml/linkml-store#67, which makes the CLI survive minimal installs
that don't have matplotlib/seaborn/scipy.

Once linkml 1.11.0 final is released the rc markers can be dropped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Fix linkml pins: drop RC, use linkml-store[all]>=0.3.1 + linkml>=1.10.0

linkml 1.11.0rc1 is not on public PyPI; the RC pin broke fresh installs.
Resolves to linkml 1.10.0 + linkml-runtime 1.10.0 (verified via uv lock
--upgrade-package). linkml-runtime is not pinned directly — linkml 1.10.0
requires >=1.9.5 and the resolver picks up 1.10.0 automatically.
[all] extra on linkml-store satisfies Sierra's suggestion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Pin linkml-runtime>=1.10.0 explicitly to close version-skew gap

linkml 1.10.0's own floor (linkml-runtime>=1.9.5) is too loose — 1.9.x
versions have documented version-skew breakage (linkml/linkml#3241,
linkml/linkml PR#3183). The transitive constraint is not sufficient;
an explicit floor is the only guarantee.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants