-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Prevent first-party imports from being resolved to site-packages
#1756
Merged
DanielNoord
merged 8 commits into
pylint-dev:main
from
jacobtylerwalls:first-party-import-ext-lib
Aug 29, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9b99b64
Prevent first-party imports from being resolved to `site-packages`
jacobtylerwalls ce62502
fixup! Prevent first-party
jacobtylerwalls ffad944
Merge branch 'main' into first-party-import-ext-lib
Pierre-Sassoulas b89ef27
fixup test
jacobtylerwalls 776218a
wip -- debug result on ci
jacobtylerwalls 4c60c9d
another debug stmt
jacobtylerwalls 22ce69e
fixup path comparison
jacobtylerwalls 5b3b37c
fixup -- update comments
jacobtylerwalls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
Can we move these to
const
to remove any import cycles? We could also move the union there.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 considered that, but there's too much logic in
modutils
that would have to be moved. My preference would be to moveis_namespace
intomodutils
, but I'd prefer to do that in a followup commit that wouldn't be backported. What do you think?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 think it would be good to back port this. We never know how long it takes until we release a minor version and we might want to make more fixes here.
I'd be happy to make a back port PR π
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 opened #1759 we just need to merge this and cherry pick it before releasing 2.12.5.
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.
Ah, we might be miscommunicating! I'm saying yes, we should definitely backport the crash fix, but also that I wouldn't want to block that on refactoring the cyclic import out. There's a lot of logic in modutils that would have to be moved, and it's all public, so I wouldn't want to break backwards compatibility on that in a patch release.
So I was hoping to merge and backport this in its current form, and leave the refactor for another day (and not backport the refactor, as usual). How does that sound?
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.
Let's merge this as is, but let's also back port the refactor. Like I said: with
astroid
the time in between minor versions can be quite long and we might need to fix something and release a patch version after the refactor. To avoid future merge issues I would also merge any refactor to this particular piece of code.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 agree with @DanielNoord about cherry-picking the refactors. Case in point the 2.12 maintenance branch has been live for 2 months now. Cherry-picking things after a refactor without the refactor is a lot harder than just cherry-picking the refactor too. (We do need to make sure our refactor are just refactor, but we never had any problem with this so far).