Skip to content

feat: make pandas an optional extra with proper CI matrix #148

Description

@JesuFemi-O

Background

Pandas is currently a core dependency pulled in to support dlt's filesystem source (used by the csv-import template). It was previously a transitive dep of dagster; after dropping dagster in #147 it had to become explicit.

Pandas + numpy is ~35MB of install weight that most users don't need.

Goal

Move pandas to an optional extra (pip install 'database-tycoon[pandas]') without breaking the csv-import template or its tests.

Work required

Before making the change, do a full sweep of the repo to understand every place pandas is needed (directly or transitively via dlt sources), then plan the full strategy:

  1. Audit — find every import path that touches pandas (our code + dlt source types used in templates)
  2. Lazy imports — any tycoon-owned code that imports pandas should do so lazily with a clear error pointing at [pandas]
  3. Test markers — add @pytest.mark.pandas marker; gate csv-import tests behind it
  4. CI matrix — two jobs: test-core (no pandas, runs pytest -m "not pandas") and test-pandas (installs [pandas], runs pytest -m pandas); core job asserts pandas is not importable
  5. Recipe doctest harness — add requires= attribute to the <!-- tycoon-test --> marker grammar so README blocks can declare optional deps

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions