Skip to content

Use sysconfig directly to determine python lib dir#378

Merged
cottsay merged 1 commit intomasterfrom
cottsay/sysconfig-not-distutils
Mar 3, 2022
Merged

Use sysconfig directly to determine python lib dir#378
cottsay merged 1 commit intomasterfrom
cottsay/sysconfig-not-distutils

Conversation

@cottsay
Copy link
Copy Markdown
Contributor

@cottsay cottsay commented Feb 16, 2022

The distutils package is deprecated and will be removed in Python 3.12. We can achieve the same behavior using sysconfig directly.

Docs for get_python_lib: https://docs.python.org/3/distutils/apiref.html#distutils.sysconfig.get_python_lib
Docs for get_path: https://docs.python.org/3/library/sysconfig.html#sysconfig.get_path

Note the docs for the purelib value read:

  • purelib: directory for site-specific, non-platform-specific files.

This should resolve build warnings like this:

<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead

The distutils package is deprecated and will be removed in Python 3.12.
We can achieve the same behavior using sysconfig directly.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay self-assigned this Feb 16, 2022
@cottsay
Copy link
Copy Markdown
Contributor Author

cottsay commented Feb 16, 2022

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

Copy link
Copy Markdown
Contributor

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

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

sysconfig was added in python 3.2 so is definitely available on supported platforms.

Even though this is backportable I don't see a reason to backport it.

@cottsay
Copy link
Copy Markdown
Contributor Author

cottsay commented Mar 3, 2022

Even though this is backportable I don't see a reason to backport it

I'm not going to champion a backport until we have confidence in this change, but as a non-Ubuntu user, it would be nice to not be assaulted by this message whenever I build.

@cottsay cottsay merged commit aee9acf into master Mar 3, 2022
@delete-merged-branch delete-merged-branch bot deleted the cottsay/sysconfig-not-distutils branch March 3, 2022 19:13
Blast545 added a commit that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants