Skip to content

Remove pkg resources and switch to importlib#20

Merged
transientlunatic merged 1 commit intov0.7-previewfrom
remove-pkg-resources
Dec 19, 2025
Merged

Remove pkg resources and switch to importlib#20
transientlunatic merged 1 commit intov0.7-previewfrom
remove-pkg-resources

Conversation

@transientlunatic
Copy link
Collaborator

This PR removes the deprecated pkg_resources package and replaces it with importlib from the standard library.

@transientlunatic transientlunatic added this to the asimov 0.7.0 milestone Dec 19, 2025
@transientlunatic transientlunatic self-assigned this Dec 19, 2025
Copilot AI review requested due to automatic review settings December 19, 2025 07:47
@transientlunatic transientlunatic added the refactor Code refactoring label Dec 19, 2025
@transientlunatic transientlunatic changed the base branch from master to v0.7-preview December 19, 2025 07:48
Copy link

Copilot AI left a comment

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 modernizes the package by replacing the deprecated pkg_resources with importlib from the standard library and adds support for htcondor2 alongside several other improvements.

Key Changes:

  • Migrates from pkg_resources to importlib.metadata for version detection and importlib.resources for resource file access
  • Adds backward compatibility for both legacy htcondor and newer htcondor2 packages
  • Includes bug fixes for indentation and safe dictionary access issues

Reviewed changes

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

Show a summary per file
File Description
asimov/init.py Replaces pkg_resources with importlib.metadata for version detection and importlib.resources for configuration file access
asimov/analysis.py Updates resource file access from pkg_resources to importlib.resources for template files; switches to relative imports
asimov/cli/report.py Replaces pkg_resources.resource_filename with importlib.resources.files for theme location
asimov/cli/project.py Improves Python executable discovery with fallback to python3 and better error handling
asimov/cli/review.py Fixes indentation of else block for proper code flow
asimov/cli/manage.py Adds safe dictionary access with .get() to prevent KeyError exceptions
asimov/condor.py Adds try/except for htcondor2 import with fallback to htcondor
asimov/pipeline.py Adds try/except for htcondor2 import with fallback to htcondor
asimov/pipelines/pesummary.py Adds try/except for htcondor2 import with fallback to htcondor
tests/test_asimov.py Updates test to use importlib.metadata.version and PackageNotFoundError instead of pkg_resources
pyproject.toml Changes license format from inline string to file reference; adds missing package entries
LICENSE Updates to MIT license format with 2025 copyright
conda/environment.yaml New file defining conda environment dependencies
tests/tmp/project/.asimov/asimov.conf New test configuration file
tests/test_blueprints/*.yaml New test blueprint files for GWOSC event configuration and analysis setup
.gitlab-ci.yml Adds comprehensive htcondor integration test job
.github/workflows/htcondor-tests.yml New GitHub workflow for HTCondor integration testing
.github/workflows/slurm-tests.yml New GitHub workflow for Slurm integration testing
.github/workflows/python-app.yml Updates to use pip install and adds fetch-depth for proper git history access

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

@transientlunatic transientlunatic merged commit 25b6a9c into v0.7-preview Dec 19, 2025
6 of 15 checks passed
@transientlunatic transientlunatic deleted the remove-pkg-resources branch December 19, 2025 08:19
@transientlunatic transientlunatic linked an issue Dec 20, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix pkg_resources deprecation warning

2 participants