Skip to content
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 special case for virtualenv's patching of distutils from catching other submodules #1544

Merged

Conversation

jacobtylerwalls
Copy link
Member

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

Apparently, #1386 traded a false positive created by virtualenv for a false positive in numpy.distutils. This PR tightens the condition to pass both cases.

The regression test for virtualenv has to be manually triggered on PyCQA. So I tested this on my fork where I could fiddle with the workflow trigger. Or I could push this branch to PyCQA; that might allow us to trigger the workflow on a branch, but not certain.

Type of Changes

Type
🐛 Bug fix

Related Issue

Refs pylint-dev/pylint#6497

@jacobtylerwalls jacobtylerwalls added needs-backport Regression pylint-tested PRs that don't cause major regressions with pylint labels May 4, 2022
@jacobtylerwalls jacobtylerwalls added this to the 2.11.5 milestone May 4, 2022
@coveralls
Copy link

coveralls commented May 4, 2022

Pull Request Test Coverage Report for Build 2272648242

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 26 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.09%) to 91.713%

Files with Coverage Reduction New Missed Lines %
astroid/manager.py 26 87.44%
Totals Coverage Status
Change from base Build 2268781407: 0.09%
Covered Lines: 9153
Relevant Lines: 9980

💛 - Coveralls

@DanielNoord
Copy link
Collaborator

Do you have a Windows to debug this? Seems to pass on 3.8...

@unittest.skipUnless(HAS_NUMPY, "Needs numpy")
def test_numpy_distutils(self):
"""Special handling of virtualenv's patching of distutils shouldn't interfere
with numpy.distutils"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to define a specific version of numpy here ? I suppose numpy won't embark distutils forever.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, it's already deprecated, but won't be removed until Python 3.12 is minimum. I could add a TODO I guess.

@Pierre-Sassoulas Pierre-Sassoulas merged commit c2d2057 into pylint-dev:main May 5, 2022
@jacobtylerwalls jacobtylerwalls deleted the distutils-follow-up branch May 5, 2022 12:31
Pierre-Sassoulas pushed a commit that referenced this pull request May 9, 2022
Pierre-Sassoulas pushed a commit that referenced this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pylint-tested PRs that don't cause major regressions with pylint Regression
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants