xref: /aosp_15_r20/external/bazelbuild-rules_python/WORKSPACE.bzlmod (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Worker# Copyright 2024 The Bazel Authors. All rights reserved.
2*60517a1eSAndroid Build Coastguard Worker#
3*60517a1eSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*60517a1eSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*60517a1eSAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*60517a1eSAndroid Build Coastguard Worker#
7*60517a1eSAndroid Build Coastguard Worker#    http://www.apache.org/licenses/LICENSE-2.0
8*60517a1eSAndroid Build Coastguard Worker#
9*60517a1eSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*60517a1eSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*60517a1eSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*60517a1eSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*60517a1eSAndroid Build Coastguard Worker# limitations under the License.
14*60517a1eSAndroid Build Coastguard Worker
15*60517a1eSAndroid Build Coastguard Worker# This file contains everything that is needed when using bzlmod
16*60517a1eSAndroid Build Coastguard Workerworkspace(name = "rules_python")
17*60517a1eSAndroid Build Coastguard Worker
18*60517a1eSAndroid Build Coastguard Workerload("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
19*60517a1eSAndroid Build Coastguard Worker
20*60517a1eSAndroid Build Coastguard Worker# Used for Bazel CI
21*60517a1eSAndroid Build Coastguard Workerhttp_archive(
22*60517a1eSAndroid Build Coastguard Worker    name = "bazelci_rules",
23*60517a1eSAndroid Build Coastguard Worker    sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
24*60517a1eSAndroid Build Coastguard Worker    strip_prefix = "bazelci_rules-1.0.0",
25*60517a1eSAndroid Build Coastguard Worker    url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
26*60517a1eSAndroid Build Coastguard Worker)
27*60517a1eSAndroid Build Coastguard Worker
28*60517a1eSAndroid Build Coastguard Workerload("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
29*60517a1eSAndroid Build Coastguard Worker
30*60517a1eSAndroid Build Coastguard Worker# Creates a default toolchain config for RBE.
31*60517a1eSAndroid Build Coastguard Worker# Use this as is if you are using the rbe_ubuntu16_04 container,
32*60517a1eSAndroid Build Coastguard Worker# otherwise refer to RBE docs.
33*60517a1eSAndroid Build Coastguard Workerrbe_preconfig(
34*60517a1eSAndroid Build Coastguard Worker    name = "buildkite_config",
35*60517a1eSAndroid Build Coastguard Worker    toolchain = "ubuntu1804-bazel-java11",
36*60517a1eSAndroid Build Coastguard Worker)
37*60517a1eSAndroid Build Coastguard Worker
38*60517a1eSAndroid Build Coastguard Worker# Add gazelle plugin so that we can run the gazelle example as an e2e integration
39*60517a1eSAndroid Build Coastguard Worker# test and include the distribution files.
40*60517a1eSAndroid Build Coastguard Workerlocal_repository(
41*60517a1eSAndroid Build Coastguard Worker    name = "rules_python_gazelle_plugin",
42*60517a1eSAndroid Build Coastguard Worker    path = "gazelle",
43*60517a1eSAndroid Build Coastguard Worker)
44*60517a1eSAndroid Build Coastguard Worker
45*60517a1eSAndroid Build Coastguard Worker#####################
46*60517a1eSAndroid Build Coastguard Worker
47*60517a1eSAndroid Build Coastguard Worker# This wheel is purely here to validate the wheel extraction code. It's not
48*60517a1eSAndroid Build Coastguard Worker# intended for anything else.
49*60517a1eSAndroid Build Coastguard Workerhttp_file(
50*60517a1eSAndroid Build Coastguard Worker    name = "wheel_for_testing",
51*60517a1eSAndroid Build Coastguard Worker    downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
52*60517a1eSAndroid Build Coastguard Worker    sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
53*60517a1eSAndroid Build Coastguard Worker    urls = [
54*60517a1eSAndroid Build Coastguard Worker        "https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
55*60517a1eSAndroid Build Coastguard Worker    ],
56*60517a1eSAndroid Build Coastguard Worker)
57*60517a1eSAndroid Build Coastguard Worker
58*60517a1eSAndroid Build Coastguard Worker# rules_proto expects //external:python_headers to point at the python headers.
59*60517a1eSAndroid Build Coastguard Workerbind(
60*60517a1eSAndroid Build Coastguard Worker    name = "python_headers",
61*60517a1eSAndroid Build Coastguard Worker    actual = "//python/cc:current_py_cc_headers",
62*60517a1eSAndroid Build Coastguard Worker)
63