-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMODULE.bazel
More file actions
119 lines (104 loc) · 4.5 KB
/
MODULE.bazel
File metadata and controls
119 lines (104 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module defines the dependencies and extensions for the NCore project.
"""
module(
name = "ncore",
repo_name = "ncore_repo",
)
bazel_dep(name = "aspect_rules_lint", version = "1.9.1")
bazel_dep(name = "rules_mypy", version = "0.40.0")
bazel_dep(name = "rules_uv", version = "0.88.0")
bazel_dep(name = "rules_shell", version = "0.5.0")
bazel_dep(name = "rules_multirun", version = "0.13.0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "platforms", version = "1.0.0")
## rules_python
bazel_dep(name = "rules_python", version = "1.2.0")
# Patch rules_python to support --repo_contents_cache (Bazel 8.3.0+)
# This allows Bazel to cache fetched repo contents across workspaces and clean builds,
# significantly speeding up cold CI builds by avoiding re-downloads of Python interpreters and wheels.
# See: https://github.com/bazel-contrib/rules_python/issues/3039
single_version_override(
module_name = "rules_python",
patch_strip = 1,
patches = ["//bazel/rules_python:rules_python_repo_contents_cache.patch"],
)
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.11",
)
python.toolchain(
python_version = "3.8",
)
use_repo(python, "python_3_11", "python_3_8", "python_versions")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
experimental_index_url = "https://pypi.org/simple", # download wheels via bazel downloader instead of pip
hub_name = "ncore_pip_deps",
python_version = "3.11",
requirements_lock = "//deps/pip:requirements_3_11.txt",
)
pip.parse(
experimental_index_url = "https://pypi.org/simple", # download wheels via bazel downloader instead of pip
hub_name = "ncore_pip_deps",
python_version = "3.8",
requirements_lock = "//deps/pip:requirements_3_8.txt",
)
use_repo(pip, "ncore_pip_deps")
## rules_multitool (for ruff formatter)
bazel_dep(name = "rules_multitool", version = "1.0.0")
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
use_repo(multitool, "multitool")
## external / test data
# GitHub Packages requires authentication - configure ~/.netrc with GitHub credentials as described in `CONTRIBUTING.md`
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# unit test data
http_archive(
name = "test-data-v4",
sha256 = "c9f52f182994b5c4027f74f380b75f05bc64bdc15ccc2934558f373b44606ae9",
urls = ["https://maven.pkg.github.com/NVIDIA/ncore/com/nvidia/ncore/test-data-v4/0.2/test-data-v4-0.2.tar.gz"],
)
# documentation binary data
http_archive(
name = "ncore_docs_data",
sha256 = "7dd07e216e2c63aa1e3048a02ed3cad777897245e050345c8f877e31d6fe35d2",
urls = ["https://maven.pkg.github.com/NVIDIA/ncore/com/nvidia/ncore/ncore-docs-data/0.4/ncore-docs-data.tar.gz"],
)
# Waymo Open Dataset (http_archive for proto definitions)
http_archive(
name = "waymo_open_dataset",
patch_strip = 2,
patches = [
"//deps/waymo-open-dataset:cc-proto.patch",
"//deps/waymo-open-dataset:py-utils.patch",
],
sha256 = "7b08fce2b94d45ed26590dcb7d552e2f7d5b3080ad5c59abf2b5a4207f7553d2",
strip_prefix = "waymo-open-dataset-1.6.1/src",
urls = ["https://github.com/waymo-research/waymo-open-dataset/archive/refs/tags/v1.6.1.tar.gz"],
)
# pycolmap-reader
http_archive(
name = "pycolmap",
build_file = "//deps/pycolmap:pycolmap.BUILD",
integrity = "sha256-cOv2KrC75S1ABt9zdcoLE+TP7lnM4o6QZM9RxN1TdPA=",
strip_prefix = "pycolmap-fe7a7c45df803b6c391777e349f0d8d65d39d777",
urls = ["https://github.com/trueprice/pycolmap/archive/fe7a7c45df803b6c391777e349f0d8d65d39d777.tar.gz"],
)