Skip to content

split_exp uses deprecated 'pkg_resources' — removed in setuptools>=81 #713

@cailmdaley

Description

@cailmdaley

Symptom

$ python -c "import shapepipe.modules.split_exp_package.split_exp"
ModuleNotFoundError: No module named 'pkg_resources'

Also breaks shapepipe.modules.split_exp_runner.

Root cause (updated)

This is a transitive dependency issue, not a direct one. Shapepipe itself never imports pkg_resources. The chain is:

shapepipe.modules.split_exp_package.split_exp
  → import sip_tpv as stp             # single call site: stp.pv_to_sip(h)
     → import pkg_resources           # module-load; gone in setuptools>=81

sip_tpv v1.1 (the latest release from June 2017, upstream dormant) imports pkg_resources at module load. setuptools>=81 no longer ships pkg_resources, so any import of split_exp fails.

PR #714's setuptools<81 pin in the Dockerfile is a symptom workaround, not a fix. (v2.0 uses the same pin.)

Fix

Drop sip_tpv entirely. Its sole functional use in shapepipe was stp.pv_to_sip(h) in split_exp.create_hdus, which rewrote per-CCD headers' TPV distortion keywords as SIP before save. Modern astropy (≥5) parses TPV natively via WCSLIB, as do SExtractor, PSFEx, and every downstream WCS consumer in the pipeline, so the keyword-level conversion was no longer buying anything.

#716 removes sip_tpv from the code, module depends, environment files, Dockerfile, install_shapepipe, and docs, and adds WCS round-trip tests for SplitExposures that verify per-CCD output matches the source exposure's WCS and round-trips pixel→world→pixel correctly without sip_tpv in the stack.

Caught by

tests/unit/test_imports.py::test_module_imports[shapepipe.modules.split_exp*] (xfailed in #708).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions