From cf71ebfe7c61a8448957a5141a80d288c582ed88 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 16 Oct 2021 13:12:59 +1000 Subject: [PATCH] drop rules_pip Our vendored Python includes a recent pip, so we no longer need rules_pip's dependencies for our PyQt scripts. --- pip/pyqt5/defs.bzl | 7 +------ pip/pyqt5/install_pyqt5.py | 7 +------ pip/pyqt6/defs.bzl | 7 +------ pip/pyqt6/install_pyqt6.py | 7 ++----- repos.bzl | 15 --------------- 5 files changed, 5 insertions(+), 38 deletions(-) diff --git a/pip/pyqt5/defs.bzl b/pip/pyqt5/defs.bzl index 9daf5ade3..8845e8c49 100644 --- a/pip/pyqt5/defs.bzl +++ b/pip/pyqt5/defs.bzl @@ -1,12 +1,7 @@ # based off https://github.com/ali5h/rules_pip/blob/master/defs.bzl -pip_vendor_label = Label("@com_github_ali5h_rules_pip//:third_party/py/easy_install.py") - def _execute(repository_ctx, arguments, quiet = False): - pip_vendor = str(repository_ctx.path(pip_vendor_label).dirname) - return repository_ctx.execute(arguments, environment = { - "PYTHONPATH": pip_vendor, - }, quiet = quiet) + return repository_ctx.execute(arguments, environment = {}, quiet = quiet) def _install_pyqt5_impl(repository_ctx): python_interpreter = repository_ctx.attr.python_interpreter diff --git a/pip/pyqt5/install_pyqt5.py b/pip/pyqt5/install_pyqt5.py index 4e8de7bd7..110bfe561 100644 --- a/pip/pyqt5/install_pyqt5.py +++ b/pip/pyqt5/install_pyqt5.py @@ -11,8 +11,6 @@ import shutil import subprocess import sys -import pkginfo - from pip._internal.commands import create_command from pip._vendor import pkg_resources @@ -75,9 +73,6 @@ def install_package(pkg, directory, pip_args): dirnames.remove(ignored) _create_nspkg_init(dirpath) - return pkginfo.Wheel(dist_info) - - def _cleanup(directory, pattern): for p in glob.glob(os.path.join(directory, pattern)): shutil.rmtree(p) @@ -149,7 +144,7 @@ def main(): for (name, with_version) in packages: # install package in subfolder folder = os.path.join(base, "temp") - _pkg = install_package(with_version, folder, []) + install_package(with_version, folder, []) # merge into parent merge_files(base, folder) shutil.rmtree(folder) diff --git a/pip/pyqt6/defs.bzl b/pip/pyqt6/defs.bzl index ca4519cff..01b4071b1 100644 --- a/pip/pyqt6/defs.bzl +++ b/pip/pyqt6/defs.bzl @@ -1,12 +1,7 @@ # based off https://github.com/ali5h/rules_pip/blob/master/defs.bzl -pip_vendor_label = Label("@com_github_ali5h_rules_pip//:third_party/py/easy_install.py") - def _execute(repository_ctx, arguments, quiet = False): - pip_vendor = str(repository_ctx.path(pip_vendor_label).dirname) - return repository_ctx.execute(arguments, environment = { - "PYTHONPATH": pip_vendor, - }, quiet = quiet) + return repository_ctx.execute(arguments, environment = {}, quiet = quiet) def _install_pyqt6_impl(repository_ctx): python_interpreter = repository_ctx.attr.python_interpreter diff --git a/pip/pyqt6/install_pyqt6.py b/pip/pyqt6/install_pyqt6.py index a04193c11..cb929961e 100644 --- a/pip/pyqt6/install_pyqt6.py +++ b/pip/pyqt6/install_pyqt6.py @@ -11,8 +11,6 @@ import shutil import subprocess import sys -import pkginfo - from pip._internal.commands import create_command from pip._vendor import pkg_resources @@ -75,8 +73,6 @@ def install_package(pkg, directory, pip_args): dirnames.remove(ignored) _create_nspkg_init(dirpath) - return pkginfo.Wheel(dist_info) - def _cleanup(directory, pattern): for p in glob.glob(os.path.join(directory, pattern)): @@ -149,7 +145,8 @@ def main(): for (name, with_version) in packages: # install package in subfolder folder = os.path.join(base, "temp") - _pkg = install_package(with_version, folder, []) + pip_args = [] + install_package(with_version, folder, pip_args) # merge into parent merge_files(base, folder) shutil.rmtree(folder) diff --git a/repos.bzl b/repos.bzl index 994c8225c..fd8b4eb1c 100644 --- a/repos.bzl +++ b/repos.bzl @@ -59,21 +59,6 @@ def register_repos(): ], ) - # native.local_repository( - # name = "com_github_ali5h_rules_pip", - # path = "../rules_pip", - # ) - - maybe( - http_archive, - name = "com_github_ali5h_rules_pip", - strip_prefix = "rules_pip-fb02cb7bf5c03bc8cd4269679e4aea2e1839b501", - urls = [ - "https://github.com/ali5h/rules_pip/archive/fb02cb7bf5c03bc8cd4269679e4aea2e1839b501.zip", - ], - sha256 = "34195cd437d34a7490276665225de353421e31e34c048715b66918e31d735ff6", - ) - # javascript ##############