Skip to content

Query site packages path using the Python site module #760

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

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

YakoYakoYokuYoku
Copy link
Member

PR Description

What type of PR is this? (Check one of the boxes below)

  • Bug fix (non-breaking change which fixes an issue)

What does this pull request do?

Running QMake to generate the Makefiles displays various DeprecationWarnings under Python 3.10 due to the usage of distutils, which is indeed deprecated. Replacing the usage of the module with site maintains compatibility with Python 2.7.

Show a few screenshots (if this is a visual change)

>>> from distutils.sysconfig import get_python_lib
<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
>>> print(get_python_lib())
/usr/lib/python3.10/site-packages
>>> # Although ``site`` fits the bill
>>> import site
>>> print(site.getsitepackages()[0])
/usr/lib/python3.10/site-packages

Have you tested your changes (if applicable)? If so, how?

By building Natron.

Futher details of this pull request

I'm planning to do the same for the initialization process by using both site and sysconfig.

@devernay devernay merged commit 73f1ffe into RB-2.5 Feb 1, 2022
@YakoYakoYokuYoku YakoYakoYokuYoku deleted the site-info-global branch June 18, 2022 18:53
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.

2 participants