Remove pkg resources and switch to importlib#20
Merged
transientlunatic merged 1 commit intov0.7-previewfrom Dec 19, 2025
Merged
Remove pkg resources and switch to importlib#20transientlunatic merged 1 commit intov0.7-previewfrom
transientlunatic merged 1 commit intov0.7-previewfrom
Conversation
There was a problem hiding this comment.
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_resourcestoimportlib.metadatafor version detection andimportlib.resourcesfor resource file access - Adds backward compatibility for both legacy
htcondorand newerhtcondor2packages - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the deprecated
pkg_resourcespackage and replaces it withimportlibfrom the standard library.