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:
- Audit — find every import path that touches pandas (our code + dlt source types used in templates)
- Lazy imports — any tycoon-owned code that imports pandas should do so lazily with a clear error pointing at
[pandas]
- Test markers — add
@pytest.mark.pandas marker; gate csv-import tests behind it
- 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
- Recipe doctest harness — add
requires= attribute to the <!-- tycoon-test --> marker grammar so README blocks can declare optional deps
References
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:
[pandas]@pytest.mark.pandasmarker; gate csv-import tests behind ittest-core(no pandas, runspytest -m "not pandas") andtest-pandas(installs[pandas], runspytest -m pandas); core job asserts pandas is not importablerequires=attribute to the<!-- tycoon-test -->marker grammar so README blocks can declare optional depsReferences
dlt[pandas]for the same reason