grpc_python_deps.bzl 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 2021 The gRPC Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. """Load dependencies needed to compile and test the grpc python library as a 3rd-party consumer."""
  15. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
  16. load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
  17. # buildifier: disable=unnamed-macro
  18. def grpc_python_deps():
  19. """Loads dependencies for gRPC Python."""
  20. # protobuf binds to the name "six", so we can't use it here.
  21. # See https://github.com/bazelbuild/bazel/issues/1952 for why bind is
  22. # horrible.
  23. if "six" not in native.existing_rules():
  24. http_archive(
  25. name = "six",
  26. build_file = "@com_github_grpc_grpc//third_party:six.BUILD",
  27. sha256 = "1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
  28. urls = ["https://files.pythonhosted.org/packages/71/39/171f1c67cd00715f190ba0b100d606d440a28c93c7714febeca8b79af85e/six-1.16.0.tar.gz"],
  29. )
  30. if "enum34" not in native.existing_rules():
  31. http_archive(
  32. name = "enum34",
  33. build_file = "@com_github_grpc_grpc//third_party:enum34.BUILD",
  34. strip_prefix = "enum34-1.1.6",
  35. sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1",
  36. urls = ["https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"],
  37. )
  38. if "futures" not in native.existing_rules():
  39. http_archive(
  40. name = "futures",
  41. build_file = "@com_github_grpc_grpc//third_party:futures.BUILD",
  42. strip_prefix = "futures-3.3.0",
  43. sha256 = "7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794",
  44. urls = ["https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz"],
  45. )
  46. if "io_bazel_rules_python" not in native.existing_rules():
  47. http_archive(
  48. name = "io_bazel_rules_python",
  49. url = "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz",
  50. sha256 = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea",
  51. patches = ["@com_github_grpc_grpc//third_party:rules_python.patch"],
  52. patch_args = ["-p1"],
  53. )
  54. python_configure(name = "local_config_python")
  55. native.bind(
  56. name = "python_headers",
  57. actual = "@local_config_python//:python_headers",
  58. )
  59. if "cython" not in native.existing_rules():
  60. http_archive(
  61. name = "cython",
  62. build_file = "@com_github_grpc_grpc//third_party:cython.BUILD",
  63. sha256 = "bb72b2f0ef029472759c711f0a4bded6e15e3f9bda3797550cef3c1d87d02283",
  64. strip_prefix = "cython-0.29.26",
  65. urls = [
  66. "https://github.com/cython/cython/archive/0.29.26.tar.gz",
  67. ],
  68. )