Skip to content

remove distutils #38

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions python_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def _get_python_lib(repository_ctx, python_bin):
"try:\n" +
" library_paths = site.getsitepackages()\n" +
"except AttributeError:\n" +
" from distutils.sysconfig import get_python_lib\n" +
" library_paths = [get_python_lib()]\n" +
" from sysconfig import get_path\n" +
" library_paths = [get_path(\"purelib\")]\n" +
"all_paths = set(python_paths + library_paths)\n" +
"paths = []\n" +
"for path in all_paths:\n" +
Expand Down Expand Up @@ -252,13 +252,12 @@ def _get_python_include(repository_ctx, python_bin):
python_bin,
"-c",
"from __future__ import print_function;" +
"from distutils import sysconfig;" +
"print(sysconfig.get_python_inc())",
"import sysconfig;" +
"print(sysconfig.get_path(\"include\"))",
],
error_msg = "Problem getting python include path.",
error_details = ("Is the Python binary path set up right? " +
"(See ./configure or " + _PYTHON_BIN_PATH + ".) " +
"Is distutils installed?"),
"(See ./configure or " + _PYTHON_BIN_PATH + ".)"),
)
return result.stdout.splitlines()[0]

Expand Down