Skip to content

Commit

Permalink
Merge branch 'bazelbuild:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelreneer authored Dec 13, 2024
2 parents 502b432 + 2da0165 commit 2fba3f3
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 15 deletions.
20 changes: 20 additions & 0 deletions modules/jsonnet/0.20.0.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module(name = "jsonnet", version = "0.20.0.bcr.1")

bazel_dep(name = "googletest", version = "1.11.0", repo_name = "com_google_googletest")
bazel_dep(name = "rules_jsonnet", version = "0.6.0", repo_name = "io_bazel_rules_jsonnet")
bazel_dep(name = "rules_python", version = "1.0.0")

PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1], # Choose last version as default.
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
]
39 changes: 39 additions & 0 deletions modules/jsonnet/0.20.0.bcr.1/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 0000000..98229ee
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,20 @@
+module(name = "jsonnet", version = "0.20.0.bcr.1")
+
+bazel_dep(name = "googletest", version = "1.11.0", repo_name = "com_google_googletest")
+bazel_dep(name = "rules_jsonnet", version = "0.6.0", repo_name = "io_bazel_rules_jsonnet")
+bazel_dep(name = "rules_python", version = "1.0.0")
+
+PYTHON_VERSIONS = [
+ "3.10",
+ "3.11",
+ "3.12",
+ "3.13",
+]
+python = use_extension("@rules_python//python/extensions:python.bzl", "python")
+[
+ python.toolchain(
+ is_default = python_version == PYTHON_VERSIONS[-1], # Choose last version as default.
+ python_version = python_version,
+ )
+ for python_version in PYTHON_VERSIONS
+]
diff --git a/python/BUILD b/python/BUILD
index 12936ad..0afe833 100644
--- a/python/BUILD
+++ b/python/BUILD
@@ -4,7 +4,7 @@ cc_binary(
linkshared = 1,
deps = [
"//core:libjsonnet",
- "@default_python3_headers//:headers",
+ "@rules_python//python/cc:current_py_cc_headers",
],
)

24 changes: 24 additions & 0 deletions modules/jsonnet/0.20.0.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2023 The Bazel Authors. All rights reserved.
#
# 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.

matrix:
platform: ["debian11", "ubuntu2004"]
bazel: ["7.x"]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@jsonnet//...'
9 changes: 9 additions & 0 deletions modules/jsonnet/0.20.0.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/google/jsonnet/archive/refs/tags/v0.20.0.zip",
"integrity": "sha256-Z0/yQbHE2OFbGYwy1d50fUklc/lbS9MesYZNm9m7CYU=",
"patches": {
"module_dot_bazel.patch": "sha256-mNaqoX5mQP61b0oA7TEsPqcTLLQ4bJKCY9osA1Ueycg="
},
"strip_prefix": "jsonnet-0.20.0",
"patch_strip": 1
}
29 changes: 15 additions & 14 deletions modules/jsonnet/metadata.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"homepage": "https://jsonnet.org",
"maintainers": [
{
"email": "[email protected]",
"name": "No Maintainer Specified"
}
],
"repository": [
"github:google/jsonnet"
],
"versions": [
"0.20.0"
],
"yanked_versions": {}
"homepage": "https://jsonnet.org",
"maintainers": [
{
"email": "[email protected]",
"name": "No Maintainer Specified"
}
],
"repository": [
"github:google/jsonnet"
],
"versions": [
"0.20.0",
"0.20.0.bcr.1"
],
"yanked_versions": {}
}
36 changes: 36 additions & 0 deletions modules/rules_mypy/0.20.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"rules_mypy"

module(
name = "rules_mypy",
version = "0.20.0",
)

bazel_dep(name = "bazel_skylib", version = "1.4.1")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_python", version = "0.34.0")
bazel_dep(name = "rules_uv", version = "0.21.0")

# configuration
PYTHON_VERSION = "3.12"

PYTHON_VERSION_SNAKE = PYTHON_VERSION.replace(".", "_")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = PYTHON_VERSION,
)
use_repo(python, "python_" + PYTHON_VERSION_SNAKE, "python_versions")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
enable_implicit_namespace_pkgs = True,
experimental_index_url = "https://pypi.org/simple", # use Bazel downloader
hub_name = "rules_mypy_pip",
python_version = PYTHON_VERSION,
requirements_by_platform = {
"//mypy/private:requirements.txt": "*",
},
)
use_repo(pip, "rules_mypy_pip")
15 changes: 15 additions & 0 deletions modules/rules_mypy/0.20.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
bazel:
- 7.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- "@rules_mypy//..."
5 changes: 5 additions & 0 deletions modules/rules_mypy/0.20.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "sha256-WzgqerCgruMfeYtAAYnEmYwSVf/N/6WPgo0bhkep7gg=",
"strip_prefix": "rules_mypy-0.20.0",
"url": "https://github.com/theoremlp/rules_mypy/releases/download/v0.20.0/rules_mypy-0.20.0.tar.gz"
}
3 changes: 2 additions & 1 deletion modules/rules_mypy/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"0.16.0",
"0.17.0",
"0.18.0",
"0.19.0"
"0.19.0",
"0.20.0"
],
"yanked_versions": {}
}

0 comments on commit 2fba3f3

Please sign in to comment.