diff --git a/examples/helloworld/BUILD b/examples/helloworld/BUILD index 43ac6c12da..1e1a749adb 100644 --- a/examples/helloworld/BUILD +++ b/examples/helloworld/BUILD @@ -28,5 +28,5 @@ py_test( name = "helloworld_test", srcs = ["helloworld_test.py"], deps = [":helloworld"], - python_version = "PY2", + python_version = "PY3", ) diff --git a/packaging/piptool.py b/packaging/piptool.py index 2544032ee8..d5aaf7896f 100644 --- a/packaging/piptool.py +++ b/packaging/piptool.py @@ -78,7 +78,7 @@ def pip_main(argv): atexit.register(lambda: shutil.rmtree(cert_tmpdir, ignore_errors=True)) with open(cert_path, "wb") as cert: cert.write(pkgutil.get_data("pip._vendor.requests", "cacert.pem")) - argv = ["--isolated", "--disable-pip-version-check", "--cert", cert_path] + argv + argv = ["--isolated", "--python-version=37", "--disable-pip-version-check", "--cert", cert_path] + argv return pip.main(argv) from packaging.whl import Wheel diff --git a/packaging/whl.py b/packaging/whl.py index 63a6d62b8f..3ed6e87ebe 100644 --- a/packaging/whl.py +++ b/packaging/whl.py @@ -149,6 +149,7 @@ def main(): name = "pkg", srcs = glob(["**/*.py"]), data = glob(["**/*"], exclude=["**/*.py", "**/* *", "BUILD", "WORKSPACE"]), + python_version = "PY3", # This makes this directory a top-level in the python import # search path for anything that depends on this. imports = ["."], @@ -163,6 +164,7 @@ def main(): extras='\n\n'.join([ """py_library( name = "{extra}", + python_version = "PY3", deps = [ ":pkg",{deps} ], diff --git a/python/pip.bzl b/python/pip.bzl index b69eb9366e..3ae33aa06a 100644 --- a/python/pip.bzl +++ b/python/pip.bzl @@ -24,7 +24,7 @@ def _pip_import_impl(repository_ctx): # To see the output, pass: quiet=False result = repository_ctx.execute([ - "python", + "python3.7", repository_ctx.path(repository_ctx.attr._script), "--name", repository_ctx.attr.name, diff --git a/python/whl.bzl b/python/whl.bzl index 3f869c29ec..4b7f8b259e 100644 --- a/python/whl.bzl +++ b/python/whl.bzl @@ -17,7 +17,7 @@ def _whl_impl(repository_ctx): """Core implementation of whl_library.""" args = [ - "python", + "python3.7", repository_ctx.path(repository_ctx.attr._script), "--whl", repository_ctx.path(repository_ctx.attr.whl),