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

Ensure that removing shim in older setuptools does not error #11315

Merged
merged 1 commit into from
Jul 30, 2022

Conversation

bdrosen96
Copy link
Contributor

Addresses #11314

news/11314.bugfix.rst Outdated Show resolved Hide resolved
@sbidoul
Copy link
Member

sbidoul commented Jul 28, 2022

Also, if remove_shim is absent, don't we loose the fix for #11294 ?

Not sure what to do here. Any suggestion @jaraco @pradyunsg ?

@jaraco
Copy link
Member

jaraco commented Jul 28, 2022

Also, if remove_shim is absent, don't we loose the fix for #11294 ?

Not sure what to do here. Any suggestion @jaraco @pradyunsg ?

If remove_shim is absent, it probably means that the shim isn't present, so it's fine. I confirmed that the first appearance of _distutils_hack in 49.3.0 had remove_shim.

The issue appears to be that some form of downgrade of Setuptools is leading to an empty _distutils_hack directory, which is a namespace package containing no functionality. Let's just suppress the error in that case.

Separately, it would be nice to understand why a downgrade is leading to directories left behind.

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

If remove_shim is absent, it probably means that the shim isn't present, so it's fine. I confirmed that the first appearance of _distutils_hack in 49.3.0 had remove_shim.

Thanks for the analysis, @jaraco !

@@ -0,0 +1 @@
Avoid AttributeError when _distutils_hack is missing its implementation.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Avoid AttributeError when _distutils_hack is missing its implementation.
Avoid ``AttributeError`` when removing the setuptools-provided ``_distutils_hack`` is missing its implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should that be:

Avoid AttributeError when removing the setuptools-provided _distutils_hack and it is missing its implementation.

Copy link
Member

@sbidoul sbidoul Jul 29, 2022

Choose a reason for hiding this comment

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

@bdrosen96 can you please update the news fragment as you suggest and squash the commits in this PR? This will then go in 22.2.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sbidoul sbidoul added this to the 22.2.2 milestone Jul 29, 2022
news/11314.bugfix.rst Outdated Show resolved Hide resolved
@uranusjr uranusjr merged commit 74f850d into pypa:main Jul 30, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants