Skip to content

replace pkg_resources with importlib.resources.files#457

Merged
akremin merged 1 commit into
mainfrom
pkgresource
Jun 3, 2026
Merged

replace pkg_resources with importlib.resources.files#457
akremin merged 1 commit into
mainfrom
pkgresource

Conversation

@akremin

@akremin akremin commented Jun 3, 2026

Copy link
Copy Markdown
Member

Small fix to update desisurveyops code to modern standards that don't use pkg_resources. This was causing the code to crash with the new 2026 desiconda installation. This is a trivial change, so I'm self-merging.

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 updates desisurveyops to avoid pkg_resources (which can be absent in newer environments) by switching resource/path resolution to stdlib mechanisms, preventing runtime crashes in the 2026 desiconda install.

Changes:

  • Removed pkg_resources.resource_filename usage and imports.
  • Resolved the repository data/ directory via a path relative to status_utils.py (__file__).
  • Loaded the desiutil footprint file via importlib.resources.files, and reused get_history_tiles_dir() for locating the CSS template file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
py/desisurveyops/status_utils.py Removes pkg_resources and updates data/ and desiutil resource path resolution.
py/desisurveyops/status_html.py Drops pkg_resources import and uses get_history_tiles_dir() to locate the CSS template in data/.

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

@akremin akremin merged commit ce12f39 into main Jun 3, 2026
1 check passed
@akremin akremin deleted the pkgresource branch June 3, 2026 22:35
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