-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cleanup unused dependencies #6386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 cleans up unused dependencies after upgrading packages by removing entries from the lockfile that are no longer required.
- Added an integration test (tests/integration/test_upgrade_cleanup.py) that verifies the removal of now-unused dependencies.
- Introduced a new helper function (_clean_unused_dependencies) in pipenv/routines/update.py to perform the cleanup.
- Updated the upgrade process to store the original lockfile and remove stale entries post-dependency resolution.
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/integration/test_upgrade_cleanup.py | New integration test to verify removal of unused dependencies |
pipenv/routines/update.py | Added _clean_unused_dependencies and updated upgrade workflow to invoke it |
Files not reviewed (1)
- news/6386.bugfix.rst: Language not supported
Comments suppressed due to low confidence (1)
pipenv/routines/update.py:492
- [nitpick] A shallow copy is used for 'original_lockfile', which might lead to unintended shared references if the inner dictionaries are mutated. Consider using a deep copy to ensure the original lockfile remains unaffected by later modifications.
original_lockfile = { k: v.copy() if isinstance(v, dict) else v for k, v in lockfile.items() }
4f295f7
to
68cbf59
Compare
import pytest | ||
|
||
|
||
@pytest.mark.upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Thank you for contributing to Pipenv!
The issue
Fixes #
The checklist
news/
directory to describe this fix with the extension.bugfix.rst
,.feature.rst
,.behavior.rst
,.doc.rst
..vendor.rst
. or.trivial.rst
(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.