drop rules_pip

Our vendored Python includes a recent pip, so we no longer need rules_pip's
dependencies for our PyQt scripts.
This commit is contained in:
Damien Elmes 2021-10-16 13:12:59 +10:00
parent d0feffde74
commit cf71ebfe7c
5 changed files with 5 additions and 38 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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
##############