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

Change site packages look up to use sysconfig instead of distutils #1322

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

DanielNoord
Copy link
Collaborator

@DanielNoord DanielNoord commented Dec 31, 2021

Steps

  • Write a good description on what the PR does.

Description

While is was reading up on distutils etc I thought I would try and see if we can remove all calls to it.

There are three calls to distutils, which should all be done in separate PRs because of the complexity and risk of errors. If you agree I think we should try and put them in 2.9.1 as well (I know, another delay) so we can combine all fixes to the YOLO-option and removal of distutils at the same time. (YOLO-option from #1321, that is.)

For the change in this PR:
get_python_lib returns the directory of site-packages. "Return the directory for either the general or platform-dependent library installation. If plat_specific is true, the platform-dependent include directory is returned; if false or omitted, the platform-independent directory is returned."
This functionality is "replaced" by sysconfig.get_path. By using both purelib and platlib we got both of them again.

Type of Changes

Type
🔨 Refactoring

Related Issue

@DanielNoord DanielNoord added the Maintenance Discussion or action around maintaining astroid or the dev workflow label Dec 31, 2021
@cdce8p cdce8p self-assigned this Dec 31, 2021
@cdce8p
Copy link
Member

cdce8p commented Dec 31, 2021

I haven't looked at it yet. Just one comment about the timeline. I would suggest / prefer to put this into 2.10. Yeah it's awesome that we'll remove the distutils dependency, but it isn't that urgent. Better to do one step at a time. That would also make debugging any issues much easier.

@DanielNoord
Copy link
Collaborator Author

I haven't looked at it yet. Just one comment about the timeline. I would suggest / prefer to put this into 2.10. Yeah it's awesome that we'll remove the distutils dependency, but it isn't that urgent. Better to do one step at a time. That would also make debugging any issues much easier.

Okay! I have added it as the milestone to all PRs.

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Dec 31, 2021

We could also create a 2.9.2 release, there's almost 50 issues in 2.9.1, it's a lot for astroid. (Especially since the fix to symlinks is a much awaited bug fix). I released 2.9.1, I'll let you judge if 2.9.2 is necessary.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

🎉 Small step toward removing distutils, great !

Copy link
Member

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks @DanielNoord!
I'll review the others too, but we could start with merging this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining astroid or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants