-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: improve-remediation #95
Conversation
733d9be
to
ef2b1ca
Compare
test/remediation.spec.ts
Outdated
beforeEach(() => { | ||
activateVirtualenv('remediation'); | ||
// const manifests = { 'requirements.txt': 'Jinja==2.7.2' }; | ||
// const upgrades = { 'jinja@2.7.2': { upgradeTo: 'jinja@2.8.1' } }; |
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.
unused?
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.
Oops! Yes, will remove.
lib/index.ts
Outdated
return originalText; | ||
} | ||
|
||
const newVersion = upgrade.upgradeTo.split('@')[1]; |
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.
are we sure the package name will never have a '@' in the name?
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.
I believe so. See
https://pypi.org/search/?q=%22s%22&o= vs https://pypi.org/search/?q=%22%40%22&o=
This patch is a rewrite of the remediation implementation. It makes several changes: - Remove the reliance on `inspect`, and instead get top level deps by parsing the manifest file. This should be significantly quicker than a pip install, making the fix process much faster for larger projects - Change the parser to attempt to better preserve package casing, version comparators, and extras (comments, markers, etc) - Update tests and add new tests. In a couple of cases, this actually involves fixing the test fixture, as the fixture itself was making changes such as package name casing, adding extra new lines to the manifest etc.
ef2b1ca
to
61cfb58
Compare
🎉 This PR is included in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This patch is a rewrite of the remediation implementation. It makes several changes:
inspect
, and instead get top level deps by parsing the manifest file. This should be significantly quicker than a pip install, making the fix process much faster for larger projects